pseudofs.h (230249) | pseudofs.h (232278) |
---|---|
1/*- 2 * Copyright (c) 2001 Dag-Erling Co��dan Sm��rgrav 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 2001 Dag-Erling Co��dan Sm��rgrav 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/fs/pseudofs/pseudofs.h 230249 2012-01-17 01:08:01Z mckusick $ | 28 * $FreeBSD: head/sys/fs/pseudofs/pseudofs.h 232278 2012-02-29 00:30:18Z mm $ |
29 */ 30 31#ifndef _PSEUDOFS_H_INCLUDED 32#define _PSEUDOFS_H_INCLUDED 33 | 29 */ 30 31#ifndef _PSEUDOFS_H_INCLUDED 32#define _PSEUDOFS_H_INCLUDED 33 |
34#include <sys/jail.h> 35 |
|
34/* 35 * Opaque structures 36 */ 37struct mntarg; 38struct mount; 39struct nameidata; 40struct proc; 41struct sbuf; --- 224 unchanged lines hidden (view full) --- 266 int flags); 267struct pfs_node *pfs_find_node (struct pfs_node *parent, const char *name); 268void pfs_purge (struct pfs_node *pn); 269int pfs_destroy (struct pfs_node *pn); 270 271/* 272 * Now for some initialization magic... 273 */ | 36/* 37 * Opaque structures 38 */ 39struct mntarg; 40struct mount; 41struct nameidata; 42struct proc; 43struct sbuf; --- 224 unchanged lines hidden (view full) --- 268 int flags); 269struct pfs_node *pfs_find_node (struct pfs_node *parent, const char *name); 270void pfs_purge (struct pfs_node *pn); 271int pfs_destroy (struct pfs_node *pn); 272 273/* 274 * Now for some initialization magic... 275 */ |
274#define PSEUDOFS(name, version) \ | 276#define PSEUDOFS(name, version, jflag) \ |
275 \ 276static struct pfs_info name##_info = { \ 277 #name, \ 278 name##_init, \ 279 name##_uninit, \ 280}; \ 281 \ 282static int \ 283_##name##_mount(struct mount *mp) { \ | 277 \ 278static struct pfs_info name##_info = { \ 279 #name, \ 280 name##_init, \ 281 name##_uninit, \ 282}; \ 283 \ 284static int \ 285_##name##_mount(struct mount *mp) { \ |
286 if (jflag && !prison_allow(curthread->td_ucred, jflag)) \ 287 return (EPERM); \ |
|
284 return pfs_mount(&name##_info, mp); \ 285} \ 286 \ 287static int \ 288_##name##_init(struct vfsconf *vfc) { \ 289 return pfs_init(&name##_info, vfc); \ 290} \ 291 \ --- 6 unchanged lines hidden (view full) --- 298 .vfs_cmount = pfs_cmount, \ 299 .vfs_init = _##name##_init, \ 300 .vfs_mount = _##name##_mount, \ 301 .vfs_root = pfs_root, \ 302 .vfs_statfs = pfs_statfs, \ 303 .vfs_uninit = _##name##_uninit, \ 304 .vfs_unmount = pfs_unmount, \ 305}; \ | 288 return pfs_mount(&name##_info, mp); \ 289} \ 290 \ 291static int \ 292_##name##_init(struct vfsconf *vfc) { \ 293 return pfs_init(&name##_info, vfc); \ 294} \ 295 \ --- 6 unchanged lines hidden (view full) --- 302 .vfs_cmount = pfs_cmount, \ 303 .vfs_init = _##name##_init, \ 304 .vfs_mount = _##name##_mount, \ 305 .vfs_root = pfs_root, \ 306 .vfs_statfs = pfs_statfs, \ 307 .vfs_uninit = _##name##_uninit, \ 308 .vfs_unmount = pfs_unmount, \ 309}; \ |
306VFS_SET(name##_vfsops, name, VFCF_SYNTHETIC); \ | 310VFS_SET(name##_vfsops, name, VFCF_SYNTHETIC | (jflag ? VFCF_JAIL : 0)); \ |
307MODULE_VERSION(name, version); \ 308MODULE_DEPEND(name, pseudofs, 1, 1, 1); 309 310#endif | 311MODULE_VERSION(name, version); \ 312MODULE_DEPEND(name, pseudofs, 1, 1, 1); 313 314#endif |