diff options
author | Brian Behlendorf <[email protected]> | 2011-01-07 11:51:27 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-02-10 09:21:43 -0800 |
commit | 9ee7fac5312f9c6b33155aed77e50b0dfd68a77d (patch) | |
tree | a1aceb9dcc64be269ac06bd130bab6e41c2b4c17 | |
parent | bc3e15e386a62c29e10194e5fae3c4f8a76337df (diff) |
VFS: Wrap with HAVE_SHARE
Certain NFS/SMB share functionality is not yet in place. These
functions used to be wrapped with the generic HAVE_ZPL to prevent
them from being compiled. I still don't want them compiled but
I'm working toward eliminating the use of HAVE_ZPL. So I'm just
renaming the wrapper here to HAVE_SHARE. They still won't be
compiled until all the share issues are worked through. Share
support is the last missing piece from zfs_ioctl.c.
-rw-r--r-- | module/zfs/zfs_ioctl.c | 36 | ||||
-rw-r--r-- | module/zfs/zfs_znode.c | 4 |
2 files changed, 22 insertions, 18 deletions
diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index 6e8422bb0..17f3ff60b 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -592,7 +592,7 @@ zfs_secpolicy_send(zfs_cmd_t *zc, cred_t *cr) return (error); } -#ifdef HAVE_ZPL +#ifdef HAVE_SHARE static int zfs_secpolicy_deleg_share(zfs_cmd_t *zc, cred_t *cr) { @@ -616,12 +616,12 @@ zfs_secpolicy_deleg_share(zfs_cmd_t *zc, cred_t *cr) return (dsl_deleg_access(zc->zc_name, ZFS_DELEG_PERM_SHARE, cr)); } -#endif /* HAVE_ZPL */ +#endif /* HAVE_SHARE */ int zfs_secpolicy_share(zfs_cmd_t *zc, cred_t *cr) { -#ifdef HAVE_ZPL +#ifdef HAVE_SHARE if (!INGLOBALZONE(curproc)) return (EPERM); @@ -632,13 +632,13 @@ zfs_secpolicy_share(zfs_cmd_t *zc, cred_t *cr) } #else return (ENOTSUP); -#endif /* HAVE_ZPL */ +#endif /* HAVE_SHARE */ } int zfs_secpolicy_smb_acl(zfs_cmd_t *zc, cred_t *cr) { -#ifdef HAVE_ZPL +#ifdef HAVE_SHARE if (!INGLOBALZONE(curproc)) return (EPERM); @@ -649,7 +649,7 @@ zfs_secpolicy_smb_acl(zfs_cmd_t *zc, cred_t *cr) } #else return (ENOTSUP); -#endif /* HAVE_ZPL */ +#endif /* HAVE_SHARE */ } static int @@ -4205,7 +4205,7 @@ zfs_ioc_userspace_upgrade(zfs_cmd_t *zc) * the first file system is shared. * Neither sharefs, nfs or smbsrv are unloadable modules. */ -#ifdef HAVE_ZPL +#ifdef HAVE_SHARE int (*znfsexport_fs)(void *arg); int (*zshare_fs)(enum sharefs_sys_op, share_t *, uint32_t); int (*zsmbexport_fs)(void *arg, boolean_t add_share); @@ -4237,12 +4237,12 @@ zfs_init_sharefs() } return (0); } -#endif /* HAVE_ZPL */ +#endif /* HAVE_SHARE */ static int zfs_ioc_share(zfs_cmd_t *zc) { -#ifdef HAVE_ZPL +#ifdef HAVE_SHARE int error; int opcode; @@ -4334,7 +4334,7 @@ zfs_ioc_share(zfs_cmd_t *zc) return (error); #else return (ENOTSUP); -#endif /* HAVE_ZPL */ +#endif /* HAVE_SHARE */ } ace_t full_access[] = { @@ -4451,7 +4451,7 @@ zfs_ioc_diff(zfs_cmd_t *zc) /* * Remove all ACL files in shares dir */ -#ifdef HAVE_ZPL +#ifdef HAVE_SHARE static int zfs_smb_acl_purge(znode_t *dzp) { @@ -4470,12 +4470,12 @@ zfs_smb_acl_purge(znode_t *dzp) zap_cursor_fini(&zc); return (error); } -#endif /* HAVE ZPL */ +#endif /* HAVE SHARE */ static int zfs_ioc_smb_acl(zfs_cmd_t *zc) { -#ifdef HAVE_ZPL +#ifdef HAVE_SHARE vnode_t *vp; znode_t *dzp; vnode_t *resourcevp = NULL; @@ -4600,7 +4600,7 @@ zfs_ioc_smb_acl(zfs_cmd_t *zc) return (error); #else return (ENOTSUP); -#endif /* HAVE_ZPL */ +#endif /* HAVE_SHARE */ } /* @@ -5221,12 +5221,12 @@ _init(void) if ((error = zfs_attach()) != 0) goto out2; -#ifdef HAVE_ZPL tsd_create(&zfs_fsyncer_key, NULL); tsd_create(&rrw_tsd_key, NULL); +#ifdef HAVE_SHARE mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); -#endif /* HAVE_ZPL */ +#endif /* HAVE_SHARE */ printk(KERN_NOTICE "ZFS: Loaded ZFS Filesystem v%s%s\n", ZFS_META_VERSION, ZFS_DEBUG_STR); @@ -5251,7 +5251,7 @@ _fini(void) zvol_fini(); zfs_fini(); spa_fini(); -#ifdef HAVE_ZPL +#ifdef HAVE_SHARE if (zfs_nfsshare_inited) (void) ddi_modclose(nfs_mod); if (zfs_smbshare_inited) @@ -5260,8 +5260,8 @@ _fini(void) (void) ddi_modclose(sharefs_mod); mutex_destroy(&zfs_share_lock); +#endif /* HAVE_SHARE */ tsd_destroy(&zfs_fsyncer_key); -#endif /* HAVE_ZPL */ printk(KERN_NOTICE "ZFS: Unloaded ZFS Filesystem v%s%s\n", ZFS_META_VERSION, ZFS_DEBUG_STR); diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c index 908ac6d49..137a06810 100644 --- a/module/zfs/zfs_znode.c +++ b/module/zfs/zfs_znode.c @@ -285,6 +285,7 @@ zfs_create_op_tables() int zfs_create_share_dir(zfsvfs_t *zfsvfs, dmu_tx_t *tx) { +#ifdef HAVE_SHARE zfs_acl_ids_t acl_ids; vattr_t vattr; znode_t *sharezp; @@ -326,6 +327,9 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, dmu_tx_t *tx) kmem_cache_free(znode_cache, sharezp); return (error); +#else + return (0); +#endif /* HAVE_SHARE */ } /* |