xref: /freebsd/usr.sbin/makefs/msdos.h (revision 2a63c3be)
10661ef2aSEd Maste /*	$NetBSD: msdos.h,v 1.3 2015/10/16 16:40:02 christos Exp $	*/
20661ef2aSEd Maste 
30661ef2aSEd Maste /*-
40661ef2aSEd Maste  * Copyright (c) 2013 The NetBSD Foundation, Inc.
50661ef2aSEd Maste  * All rights reserved.
60661ef2aSEd Maste  *
70661ef2aSEd Maste  * This code is derived from software contributed to The NetBSD Foundation
80661ef2aSEd Maste  * by Christos Zoulas.
90661ef2aSEd Maste  *
100661ef2aSEd Maste  * Redistribution and use in source and binary forms, with or without
110661ef2aSEd Maste  * modification, are permitted provided that the following conditions
120661ef2aSEd Maste  * are met:
130661ef2aSEd Maste  * 1. Redistributions of source code must retain the above copyright
140661ef2aSEd Maste  *    notice, this list of conditions and the following disclaimer.
150661ef2aSEd Maste  * 2. Redistributions in binary form must reproduce the above copyright
160661ef2aSEd Maste  *    notice, this list of conditions and the following disclaimer in the
170661ef2aSEd Maste  *    documentation and/or other materials provided with the distribution.
180661ef2aSEd Maste  *
190661ef2aSEd Maste  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
200661ef2aSEd Maste  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
210661ef2aSEd Maste  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
220661ef2aSEd Maste  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
230661ef2aSEd Maste  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
240661ef2aSEd Maste  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
250661ef2aSEd Maste  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
260661ef2aSEd Maste  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
270661ef2aSEd Maste  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
280661ef2aSEd Maste  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
290661ef2aSEd Maste  * POSSIBILITY OF SUCH DAMAGE.
300661ef2aSEd Maste  */
310661ef2aSEd Maste 
3298dc8da5SEd Maste #ifndef _MAKEFS_MSDOS_H
3398dc8da5SEd Maste #define _MAKEFS_MSDOS_H
3498dc8da5SEd Maste 
3598dc8da5SEd Maste #define NOCRED NULL
3698dc8da5SEd Maste 
3798dc8da5SEd Maste #define MSDOSFS_DPRINTF(args) do {	\
3898dc8da5SEd Maste 	if (debug & DEBUG_MSDOSFS)	\
3998dc8da5SEd Maste 		printf args;		\
4098dc8da5SEd Maste } while (0);
4198dc8da5SEd Maste 
4298dc8da5SEd Maste 
430661ef2aSEd Maste struct denode;
4498dc8da5SEd Maste struct fsnode;
4598dc8da5SEd Maste struct msdosfsmount;
460661ef2aSEd Maste 
4798dc8da5SEd Maste struct componentname {
4898dc8da5SEd Maste 	char *cn_nameptr;
4998dc8da5SEd Maste 	size_t cn_namelen;
5098dc8da5SEd Maste };
5198dc8da5SEd Maste 
52d485c77fSKonstantin Belousov struct m_vnode;
53d485c77fSKonstantin Belousov struct m_buf;
54d485c77fSKonstantin Belousov 
558651679aSXin LI int msdosfs_fsiflush(struct msdosfsmount *);
56d485c77fSKonstantin Belousov struct msdosfsmount *msdosfs_mount(struct m_vnode *);
57d485c77fSKonstantin Belousov int msdosfs_root(struct msdosfsmount *, struct m_vnode *);
580661ef2aSEd Maste 
590661ef2aSEd Maste struct denode *msdosfs_mkfile(const char *, struct denode *, fsnode *);
600661ef2aSEd Maste struct denode *msdosfs_mkdire(const char *, struct denode *, fsnode *);
6198dc8da5SEd Maste 
62d485c77fSKonstantin Belousov int m_readde(struct denode *dep, struct m_buf **bpp, struct direntry **epp);
63d485c77fSKonstantin Belousov int m_readep(struct msdosfsmount *pmp, u_long dirclust, u_long diroffset,
64d485c77fSKonstantin Belousov     struct m_buf **bpp, struct direntry **epp);
65d485c77fSKonstantin Belousov int m_extendfile(struct denode *dep, u_long count, struct m_buf **bpp,
66d485c77fSKonstantin Belousov     u_long *ncp, int flags);
67d485c77fSKonstantin Belousov 
68d485c77fSKonstantin Belousov struct msdosfsmount *m_msdosfs_mount(struct m_vnode *devvp);
6998dc8da5SEd Maste #endif
70