1*20f6ddd0STomohiro Kusumi /* $FreeBSD$ */ 2*20f6ddd0STomohiro Kusumi /* $NetBSD: msdos.h,v 1.3 2015/10/16 16:40:02 christos Exp $ */ 3*20f6ddd0STomohiro Kusumi 4*20f6ddd0STomohiro Kusumi /*- 5*20f6ddd0STomohiro Kusumi * Copyright (c) 2013 The NetBSD Foundation, Inc. 6*20f6ddd0STomohiro Kusumi * All rights reserved. 7*20f6ddd0STomohiro Kusumi * 8*20f6ddd0STomohiro Kusumi * This code is derived from software contributed to The NetBSD Foundation 9*20f6ddd0STomohiro Kusumi * by Christos Zoulas. 10*20f6ddd0STomohiro Kusumi * 11*20f6ddd0STomohiro Kusumi * Redistribution and use in source and binary forms, with or without 12*20f6ddd0STomohiro Kusumi * modification, are permitted provided that the following conditions 13*20f6ddd0STomohiro Kusumi * are met: 14*20f6ddd0STomohiro Kusumi * 1. Redistributions of source code must retain the above copyright 15*20f6ddd0STomohiro Kusumi * notice, this list of conditions and the following disclaimer. 16*20f6ddd0STomohiro Kusumi * 2. Redistributions in binary form must reproduce the above copyright 17*20f6ddd0STomohiro Kusumi * notice, this list of conditions and the following disclaimer in the 18*20f6ddd0STomohiro Kusumi * documentation and/or other materials provided with the distribution. 19*20f6ddd0STomohiro Kusumi * 20*20f6ddd0STomohiro Kusumi * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 21*20f6ddd0STomohiro Kusumi * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22*20f6ddd0STomohiro Kusumi * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23*20f6ddd0STomohiro Kusumi * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 24*20f6ddd0STomohiro Kusumi * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25*20f6ddd0STomohiro Kusumi * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26*20f6ddd0STomohiro Kusumi * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27*20f6ddd0STomohiro Kusumi * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28*20f6ddd0STomohiro Kusumi * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29*20f6ddd0STomohiro Kusumi * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30*20f6ddd0STomohiro Kusumi * POSSIBILITY OF SUCH DAMAGE. 31*20f6ddd0STomohiro Kusumi */ 32*20f6ddd0STomohiro Kusumi 33*20f6ddd0STomohiro Kusumi #ifndef _MAKEFS_MSDOS_H 34*20f6ddd0STomohiro Kusumi #define _MAKEFS_MSDOS_H 35*20f6ddd0STomohiro Kusumi 36*20f6ddd0STomohiro Kusumi #include <sys/ucred.h> /* NOCRED */ 37*20f6ddd0STomohiro Kusumi 38*20f6ddd0STomohiro Kusumi #define MSDOSFS_DPRINTF(args) do { \ 39*20f6ddd0STomohiro Kusumi if (debug & DEBUG_MSDOSFS) \ 40*20f6ddd0STomohiro Kusumi printf args; \ 41*20f6ddd0STomohiro Kusumi } while (0); 42*20f6ddd0STomohiro Kusumi 43*20f6ddd0STomohiro Kusumi 44*20f6ddd0STomohiro Kusumi struct denode; 45*20f6ddd0STomohiro Kusumi struct fsnode; 46*20f6ddd0STomohiro Kusumi struct msdosfsmount; 47*20f6ddd0STomohiro Kusumi 48*20f6ddd0STomohiro Kusumi struct componentname { 49*20f6ddd0STomohiro Kusumi char *cn_nameptr; 50*20f6ddd0STomohiro Kusumi size_t cn_namelen; 51*20f6ddd0STomohiro Kusumi }; 52*20f6ddd0STomohiro Kusumi 53*20f6ddd0STomohiro Kusumi struct m_vnode; 54*20f6ddd0STomohiro Kusumi struct m_buf; 55*20f6ddd0STomohiro Kusumi 56*20f6ddd0STomohiro Kusumi int msdosfs_fsiflush(struct msdosfsmount *); 57*20f6ddd0STomohiro Kusumi struct msdosfsmount *msdosfs_mount(struct m_vnode *); 58*20f6ddd0STomohiro Kusumi int msdosfs_root(struct msdosfsmount *, struct m_vnode *); 59*20f6ddd0STomohiro Kusumi 60*20f6ddd0STomohiro Kusumi struct denode *msdosfs_mkfile(const char *, struct denode *, fsnode *); 61*20f6ddd0STomohiro Kusumi struct denode *msdosfs_mkdire(const char *, struct denode *, fsnode *); 62*20f6ddd0STomohiro Kusumi 63*20f6ddd0STomohiro Kusumi int m_readde(struct denode *dep, struct m_buf **bpp, struct direntry **epp); 64*20f6ddd0STomohiro Kusumi int m_readep(struct msdosfsmount *pmp, u_long dirclust, u_long diroffset, 65*20f6ddd0STomohiro Kusumi struct m_buf **bpp, struct direntry **epp); 66*20f6ddd0STomohiro Kusumi int m_extendfile(struct denode *dep, u_long count, struct m_buf **bpp, 67*20f6ddd0STomohiro Kusumi u_long *ncp, int flags); 68*20f6ddd0STomohiro Kusumi 69*20f6ddd0STomohiro Kusumi struct msdosfsmount *m_msdosfs_mount(struct m_vnode *devvp); 70*20f6ddd0STomohiro Kusumi #endif 71