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
43struct denode;
44struct fsnode;
45struct msdosfsmount;
46
47struct componentname {
48	char *cn_nameptr;
49	size_t cn_namelen;
50};
51
52struct m_vnode;
53struct m_buf;
54
55int msdosfs_fsiflush(struct msdosfsmount *);
56struct msdosfsmount *msdosfs_mount(struct m_vnode *);
57int msdosfs_root(struct msdosfsmount *, struct m_vnode *);
58
59struct denode *msdosfs_mkfile(const char *, struct denode *, fsnode *);
60struct denode *msdosfs_mkdire(const char *, struct denode *, fsnode *);
61
62int m_readde(struct denode *dep, struct m_buf **bpp, struct direntry **epp);
63int m_readep(struct msdosfsmount *pmp, u_long dirclust, u_long diroffset,
64    struct m_buf **bpp, struct direntry **epp);
65int m_extendfile(struct denode *dep, u_long count, struct m_buf **bpp,
66    u_long *ncp, int flags);
67
68struct msdosfsmount *m_msdosfs_mount(struct m_vnode *devvp);
69#endif
70