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