1 1.22 dholland /* $NetBSD: filecore_extern.h,v 1.22 2013/06/23 07:28:36 dholland Exp $ */ 2 1.1 jdolecek 3 1.1 jdolecek /*- 4 1.1 jdolecek * Copyright (c) 1994 The Regents of the University of California. 5 1.1 jdolecek * All rights reserved. 6 1.5 agc * 7 1.5 agc * Redistribution and use in source and binary forms, with or without 8 1.5 agc * modification, are permitted provided that the following conditions 9 1.5 agc * are met: 10 1.5 agc * 1. Redistributions of source code must retain the above copyright 11 1.5 agc * notice, this list of conditions and the following disclaimer. 12 1.5 agc * 2. Redistributions in binary form must reproduce the above copyright 13 1.5 agc * notice, this list of conditions and the following disclaimer in the 14 1.5 agc * documentation and/or other materials provided with the distribution. 15 1.5 agc * 3. Neither the name of the University nor the names of its contributors 16 1.5 agc * may be used to endorse or promote products derived from this software 17 1.5 agc * without specific prior written permission. 18 1.5 agc * 19 1.5 agc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20 1.5 agc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 1.5 agc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 1.5 agc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23 1.5 agc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 1.5 agc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 1.5 agc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 1.5 agc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 1.5 agc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 1.5 agc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 1.5 agc * SUCH DAMAGE. 30 1.5 agc * 31 1.5 agc * filecore_extern.h 1.1 1998/6/26 32 1.5 agc */ 33 1.5 agc 34 1.5 agc /*- 35 1.5 agc * Copyright (c) 1998 Andrew McMurry 36 1.1 jdolecek * 37 1.1 jdolecek * Redistribution and use in source and binary forms, with or without 38 1.1 jdolecek * modification, are permitted provided that the following conditions 39 1.1 jdolecek * are met: 40 1.1 jdolecek * 1. Redistributions of source code must retain the above copyright 41 1.1 jdolecek * notice, this list of conditions and the following disclaimer. 42 1.1 jdolecek * 2. Redistributions in binary form must reproduce the above copyright 43 1.1 jdolecek * notice, this list of conditions and the following disclaimer in the 44 1.1 jdolecek * documentation and/or other materials provided with the distribution. 45 1.1 jdolecek * 3. All advertising materials mentioning features or use of this software 46 1.1 jdolecek * must display the following acknowledgement: 47 1.1 jdolecek * This product includes software developed by the University of 48 1.1 jdolecek * California, Berkeley and its contributors. 49 1.1 jdolecek * 4. Neither the name of the University nor the names of its contributors 50 1.1 jdolecek * may be used to endorse or promote products derived from this software 51 1.1 jdolecek * without specific prior written permission. 52 1.1 jdolecek * 53 1.1 jdolecek * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 54 1.1 jdolecek * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 55 1.1 jdolecek * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 56 1.1 jdolecek * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 57 1.1 jdolecek * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 58 1.1 jdolecek * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 59 1.1 jdolecek * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 60 1.1 jdolecek * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 61 1.1 jdolecek * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 62 1.1 jdolecek * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 63 1.1 jdolecek * SUCH DAMAGE. 64 1.1 jdolecek * 65 1.1 jdolecek * filecore_extern.h 1.1 1998/6/26 66 1.1 jdolecek */ 67 1.1 jdolecek 68 1.1 jdolecek /* 69 1.1 jdolecek * Definitions used in the kernel for Acorn Filecore file system support. 70 1.1 jdolecek */ 71 1.11 christos #if !defined(_KERNEL) 72 1.11 christos #error not supposed to be exposed to userland. 73 1.11 christos #endif 74 1.1 jdolecek 75 1.1 jdolecek #ifndef FILECOREMNT_ROOT 76 1.1 jdolecek #define FILECOREMNT_ROOT 0 77 1.1 jdolecek #endif 78 1.2 thorpej 79 1.1 jdolecek struct filecore_mnt { 80 1.1 jdolecek struct mount *fc_mountp; 81 1.1 jdolecek dev_t fc_dev; 82 1.1 jdolecek struct vnode *fc_devvp; 83 1.1 jdolecek 84 1.1 jdolecek u_int32_t blksize; 85 1.1 jdolecek u_int32_t log2bsize; 86 1.1 jdolecek u_int32_t map; 87 1.1 jdolecek u_int32_t idspz; 88 1.1 jdolecek u_int32_t mask; 89 1.1 jdolecek u_int64_t nblks; 90 1.1 jdolecek 91 1.1 jdolecek uid_t fc_uid; /* uid to set as owner of the files */ 92 1.1 jdolecek gid_t fc_gid; /* gid to set as owner of the files */ 93 1.1 jdolecek int fc_mntflags; 94 1.1 jdolecek struct filecore_disc_record drec; 95 1.1 jdolecek }; 96 1.1 jdolecek 97 1.1 jdolecek #define VFSTOFILECORE(mp) ((struct filecore_mnt *)((mp)->mnt_data)) 98 1.1 jdolecek 99 1.21 dholland #define filecore_blkoff(fcp, loc) ((loc) & ((fcp)->blksize-1)) 100 1.22 dholland #define filecore_lblktosize(fcp, blk) ((blk) << (fcp)->log2bsize) 101 1.22 dholland #define filecore_lblkno(fcp, loc) ((loc) >> (fcp)->log2bsize) 102 1.21 dholland #define filecore_blksize(fcp, ip, lbn) ((fcp)->blksize) 103 1.1 jdolecek 104 1.1 jdolecek extern struct pool filecore_node_pool; 105 1.1 jdolecek 106 1.16 pooka VFS_PROTOS(filecore); 107 1.1 jdolecek 108 1.19 dsl extern int (**filecore_vnodeop_p)(void *); 109 1.1 jdolecek 110 1.19 dsl int filecore_bbchecksum(void *); 111 1.19 dsl int filecore_bread(struct filecore_mnt *, u_int32_t, int, 112 1.19 dsl kauth_cred_t, struct buf **); 113 1.19 dsl int filecore_map(struct filecore_mnt *, u_int32_t, daddr_t, daddr_t *); 114