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 232278 2012-02-29 00:30:18Z mm $ |
29 */ 30 31#ifndef _PSEUDOFS_H_INCLUDED 32#define _PSEUDOFS_H_INCLUDED 33 |
34#include <sys/jail.h> 35 |
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 */ |
276#define PSEUDOFS(name, version, jflag) \ |
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); \ |
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}; \ |
310VFS_SET(name##_vfsops, name, VFCF_SYNTHETIC | (jflag ? VFCF_JAIL : 0)); \ |
311MODULE_VERSION(name, version); \ 312MODULE_DEPEND(name, pseudofs, 1, 1, 1); 313 314#endif |