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