Merge commit 'refs/top-bases/linux-zfs-branch' into linux-zfs-branch
This commit is contained in:
commit
04654e9620
|
@ -554,7 +554,6 @@ zfs_do_clone(int argc, char **argv)
|
|||
ret = zfs_clone(zhp, argv[1], props);
|
||||
|
||||
/* create the mountpoint if necessary */
|
||||
#ifdef HAVE_ZPL
|
||||
if (ret == 0) {
|
||||
zfs_handle_t *clone;
|
||||
|
||||
|
@ -565,7 +564,6 @@ zfs_do_clone(int argc, char **argv)
|
|||
zfs_close(clone);
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
zfs_close(zhp);
|
||||
nvlist_free(props);
|
||||
|
@ -763,7 +761,6 @@ zfs_do_create(int argc, char **argv)
|
|||
* in fact created, even if we failed to mount or share it.
|
||||
*/
|
||||
ret = 0;
|
||||
#ifdef HAVE_ZPL
|
||||
if (canmount == ZFS_CANMOUNT_ON) {
|
||||
if (zfs_mount(zhp, NULL, 0) != 0) {
|
||||
(void) fprintf(stderr, gettext("filesystem "
|
||||
|
@ -775,7 +772,6 @@ zfs_do_create(int argc, char **argv)
|
|||
ret = 1;
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
error:
|
||||
if (zhp)
|
||||
|
@ -876,9 +872,7 @@ out:
|
|||
static int
|
||||
destroy_callback(zfs_handle_t *zhp, void *data)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
destroy_cbdata_t *cbp = data;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Ignore pools (which we've already flagged as an error before getting
|
||||
|
@ -890,7 +884,6 @@ destroy_callback(zfs_handle_t *zhp, void *data)
|
|||
return (0);
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
/*
|
||||
* Bail out on the first error.
|
||||
*/
|
||||
|
@ -899,7 +892,6 @@ destroy_callback(zfs_handle_t *zhp, void *data)
|
|||
zfs_close(zhp);
|
||||
return (-1);
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
zfs_close(zhp);
|
||||
return (0);
|
||||
|
@ -2795,7 +2787,6 @@ typedef struct get_all_cbdata {
|
|||
#define SPINNER_TIME 3 /* seconds */
|
||||
#define MOUNT_TIME 5 /* seconds */
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
static int
|
||||
get_one_dataset(zfs_handle_t *zhp, void *data)
|
||||
{
|
||||
|
@ -3347,7 +3338,6 @@ share_mount(int op, int argc, char **argv)
|
|||
|
||||
return (ret);
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
/*
|
||||
* zfs mount -a [nfs | iscsi]
|
||||
|
@ -3358,11 +3348,7 @@ share_mount(int op, int argc, char **argv)
|
|||
static int
|
||||
zfs_do_mount(int argc, char **argv)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
return (share_mount(OP_MOUNT, argc, argv));
|
||||
#else
|
||||
return ENOSYS;
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3374,14 +3360,9 @@ zfs_do_mount(int argc, char **argv)
|
|||
static int
|
||||
zfs_do_share(int argc, char **argv)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
return (share_mount(OP_SHARE, argc, argv));
|
||||
#else
|
||||
return ENOSYS;
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
typedef struct unshare_unmount_node {
|
||||
zfs_handle_t *un_zhp;
|
||||
char *un_mountp;
|
||||
|
@ -3834,7 +3815,6 @@ unshare_unmount(int op, int argc, char **argv)
|
|||
|
||||
return (ret);
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
/*
|
||||
* zfs unmount -a
|
||||
|
@ -3845,11 +3825,7 @@ unshare_unmount(int op, int argc, char **argv)
|
|||
static int
|
||||
zfs_do_unmount(int argc, char **argv)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
return (unshare_unmount(OP_MOUNT, argc, argv));
|
||||
#else
|
||||
return ENOSYS;
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3861,11 +3837,7 @@ zfs_do_unmount(int argc, char **argv)
|
|||
static int
|
||||
zfs_do_unshare(int argc, char **argv)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
return (unshare_unmount(OP_SHARE, argc, argv));
|
||||
#else
|
||||
return ENOSYS;
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
|
@ -3881,7 +3853,6 @@ zfs_do_python(int argc, char **argv)
|
|||
* Called when invoked as /etc/fs/zfs/mount. Do the mount if the mountpoint is
|
||||
* 'legacy'. Otherwise, complain that use should be using 'zfs mount'.
|
||||
*/
|
||||
#ifdef HAVE_ZPL
|
||||
static int
|
||||
manual_mount(int argc, char **argv)
|
||||
{
|
||||
|
@ -4012,7 +3983,6 @@ manual_unmount(int argc, char **argv)
|
|||
|
||||
return (unshare_unmount_path(OP_MOUNT, argv[0], flags, B_TRUE));
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
static int
|
||||
volcheck(zpool_handle_t *zhp, void *data)
|
||||
|
@ -4057,9 +4027,7 @@ main(int argc, char **argv)
|
|||
{
|
||||
int ret;
|
||||
int i = 0;
|
||||
#ifdef HAVE_ZPL
|
||||
char *progname;
|
||||
#endif
|
||||
char *cmdname;
|
||||
|
||||
(void) setlocale(LC_ALL, "");
|
||||
|
@ -4084,7 +4052,6 @@ main(int argc, char **argv)
|
|||
return (1);
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
/*
|
||||
* This command also doubles as the /etc/fs mount and unmount program.
|
||||
* Determine if we should take this behavior based on argv[0].
|
||||
|
@ -4095,9 +4062,6 @@ main(int argc, char **argv)
|
|||
} else if (strcmp(progname, "umount") == 0) {
|
||||
ret = manual_unmount(argc, argv);
|
||||
} else {
|
||||
#else
|
||||
{
|
||||
#endif /* HAVE_ZPL */
|
||||
/*
|
||||
* Make sure the user has specified some command.
|
||||
*/
|
||||
|
|
|
@ -751,20 +751,17 @@ main(int argc, char **argv)
|
|||
if (dataset[0] != '\0' && domount) {
|
||||
if ((zhp = zfs_open(g_zfs, dataset, ZFS_TYPE_DATASET)) == NULL)
|
||||
return (1);
|
||||
#ifdef HAVE_ZPL
|
||||
|
||||
if (zfs_unmount(zhp, NULL, 0) != 0)
|
||||
return (1);
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
record.zi_error = error;
|
||||
|
||||
ret = register_handler(pool, flags, &record, quiet);
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
if (dataset[0] != '\0' && domount)
|
||||
ret = (zfs_mount(zhp, NULL, 0) != 0);
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
libzfs_fini(g_zfs);
|
||||
|
||||
|
|
|
@ -696,9 +696,7 @@ zpool_do_create(int argc, char **argv)
|
|||
(strcmp(mountpoint, ZFS_MOUNTPOINT_LEGACY) != 0 &&
|
||||
strcmp(mountpoint, ZFS_MOUNTPOINT_NONE) != 0)) {
|
||||
char buf[MAXPATHLEN];
|
||||
#ifdef HAVE_ZPL
|
||||
DIR *dirp;
|
||||
#endif
|
||||
|
||||
if (mountpoint && mountpoint[0] != '/') {
|
||||
(void) fprintf(stderr, gettext("invalid mountpoint "
|
||||
|
@ -723,7 +721,6 @@ zpool_do_create(int argc, char **argv)
|
|||
mountpoint);
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
if ((dirp = opendir(buf)) == NULL && errno != ENOENT) {
|
||||
(void) fprintf(stderr, gettext("mountpoint '%s' : "
|
||||
"%s\n"), buf, strerror(errno));
|
||||
|
@ -746,7 +743,6 @@ zpool_do_create(int argc, char **argv)
|
|||
goto errout;
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
if (dryrun) {
|
||||
|
@ -777,12 +773,8 @@ zpool_do_create(int argc, char **argv)
|
|||
zfs_prop_to_name(
|
||||
ZFS_PROP_MOUNTPOINT),
|
||||
mountpoint) == 0);
|
||||
#ifdef HAVE_ZPL
|
||||
if (zfs_mount(pool, NULL, 0) == 0)
|
||||
ret = zfs_shareall(pool);
|
||||
#else
|
||||
ret = 0;
|
||||
#endif /* HAVE_ZPL */
|
||||
zfs_close(pool);
|
||||
}
|
||||
} else if (libzfs_errno(g_zfs) == EZFS_INVALIDNAME) {
|
||||
|
@ -1539,13 +1531,11 @@ do_import(nvlist_t *config, const char *newname, const char *mntopts,
|
|||
if ((zhp = zpool_open_canfail(g_zfs, name)) == NULL)
|
||||
return (1);
|
||||
|
||||
#if HAVE_ZPL
|
||||
if (zpool_get_state(zhp) != POOL_STATE_UNAVAIL &&
|
||||
zpool_enable_datasets(zhp, mntopts, 0) != 0) {
|
||||
zpool_close(zhp);
|
||||
return (1);
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
zpool_close(zhp);
|
||||
return (error);
|
||||
|
|
|
@ -93,7 +93,6 @@ struct prop_changelist {
|
|||
int
|
||||
changelist_prefix(prop_changelist_t *clp)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
prop_changenode_t *cn;
|
||||
int ret = 0;
|
||||
|
||||
|
@ -169,9 +168,6 @@ changelist_prefix(prop_changelist_t *clp)
|
|||
(void) changelist_postfix(clp);
|
||||
|
||||
return (ret);
|
||||
#else
|
||||
return 0;
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -186,7 +182,6 @@ changelist_prefix(prop_changelist_t *clp)
|
|||
int
|
||||
changelist_postfix(prop_changelist_t *clp)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
prop_changenode_t *cn;
|
||||
char shareopts[ZFS_MAXPROPLEN];
|
||||
int errors = 0;
|
||||
|
@ -311,9 +306,6 @@ changelist_postfix(prop_changelist_t *clp)
|
|||
}
|
||||
|
||||
return (errors ? -1 : 0);
|
||||
#else
|
||||
return 0;
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -376,7 +368,6 @@ changelist_rename(prop_changelist_t *clp, const char *src, const char *dst)
|
|||
int
|
||||
changelist_unshare(prop_changelist_t *clp, zfs_share_proto_t *proto)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
prop_changenode_t *cn;
|
||||
int ret = 0;
|
||||
|
||||
|
@ -391,9 +382,6 @@ changelist_unshare(prop_changelist_t *clp, zfs_share_proto_t *proto)
|
|||
}
|
||||
|
||||
return (ret);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -967,7 +967,6 @@ zfs_valid_proplist(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl,
|
|||
|
||||
/*FALLTHRU*/
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
case ZFS_PROP_SHARESMB:
|
||||
case ZFS_PROP_SHARENFS:
|
||||
/*
|
||||
|
@ -1078,7 +1077,6 @@ zfs_valid_proplist(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl,
|
|||
}
|
||||
|
||||
break;
|
||||
#endif /* HAVE_ZPL */
|
||||
case ZFS_PROP_UTF8ONLY:
|
||||
chosen_utf = (int)intval;
|
||||
break;
|
||||
|
@ -2536,7 +2534,6 @@ create_parents(libzfs_handle_t *hdl, char *target, int prefixlen)
|
|||
goto ancestorerr;
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
if (zfs_mount(h, NULL, 0) != 0) {
|
||||
opname = dgettext(TEXT_DOMAIN, "mount");
|
||||
goto ancestorerr;
|
||||
|
@ -2546,7 +2543,6 @@ create_parents(libzfs_handle_t *hdl, char *target, int prefixlen)
|
|||
opname = dgettext(TEXT_DOMAIN, "share");
|
||||
goto ancestorerr;
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
zfs_close(h);
|
||||
}
|
||||
|
@ -2763,11 +2759,9 @@ zfs_destroy(zfs_handle_t *zhp, boolean_t defer)
|
|||
* abort the request. This would only happen for a
|
||||
* non-privileged user.
|
||||
*/
|
||||
#ifdef HAVE_ZPL
|
||||
if (zfs_unshare_iscsi(zhp) != 0) {
|
||||
return (-1);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (zvol_remove_link(zhp->zfs_hdl, zhp->zfs_name) != 0)
|
||||
return (-1);
|
||||
|
|
|
@ -85,7 +85,6 @@
|
|||
#include <sys/systeminfo.h>
|
||||
#define MAXISALEN 257 /* based on sysinfo(2) man page */
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
static int zfs_share_proto(zfs_handle_t *, zfs_share_proto_t *);
|
||||
zfs_share_type_t zfs_is_shared_proto(zfs_handle_t *, char **,
|
||||
zfs_share_proto_t);
|
||||
|
@ -1226,6 +1225,7 @@ out:
|
|||
return (ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
zvol_cb(const char *dataset, void *data)
|
||||
{
|
||||
|
@ -1398,42 +1398,3 @@ out:
|
|||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
#else /* HAVE_ZPL */
|
||||
|
||||
void
|
||||
remove_mountpoint(zfs_handle_t *zhp) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean_t
|
||||
is_mounted(libzfs_handle_t *zfs_hdl, const char *special, char **where)
|
||||
{
|
||||
return B_FALSE;
|
||||
}
|
||||
|
||||
boolean_t
|
||||
zfs_is_mounted(zfs_handle_t *zhp, char **where)
|
||||
{
|
||||
return is_mounted(zhp->zfs_hdl, zfs_get_name(zhp), where);
|
||||
}
|
||||
|
||||
boolean_t
|
||||
zfs_is_shared(zfs_handle_t *zhp)
|
||||
{
|
||||
return B_FALSE;
|
||||
}
|
||||
|
||||
int
|
||||
zpool_enable_datasets(zpool_handle_t *zhp, const char *mntopts, int flags)
|
||||
{
|
||||
return B_FALSE;
|
||||
}
|
||||
|
||||
int
|
||||
zpool_disable_datasets(zpool_handle_t *zhp, boolean_t force)
|
||||
{
|
||||
return B_FALSE;
|
||||
}
|
||||
|
||||
#endif /* HAVE_ZPL */
|
||||
|
|
|
@ -1975,7 +1975,6 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
|
|||
* if we did a replication receive (indicated by stream_avl
|
||||
* being non-NULL).
|
||||
*/
|
||||
#ifdef HAVE_ZPL
|
||||
cp = strchr(zc.zc_value, '@');
|
||||
if (cp && (ioctl_err == 0 || !newfs)) {
|
||||
zfs_handle_t *h;
|
||||
|
@ -2002,7 +2001,6 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
|
|||
}
|
||||
*cp = '@';
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
if (clp) {
|
||||
err |= changelist_postfix(clp);
|
||||
|
|
|
@ -615,9 +615,7 @@ libzfs_fini(libzfs_handle_t *hdl)
|
|||
#endif
|
||||
if (hdl->libzfs_sharetab)
|
||||
(void) fclose(hdl->libzfs_sharetab);
|
||||
#ifdef HAVE_ZPL
|
||||
zfs_uninit_libshare(hdl);
|
||||
#endif
|
||||
if (hdl->libzfs_log_str)
|
||||
(void) free(hdl->libzfs_log_str);
|
||||
zpool_free_handles(hdl);
|
||||
|
|
|
@ -536,8 +536,6 @@ typedef struct vdev_stat {
|
|||
#define ZVOL_DRIVER "zvol"
|
||||
#define ZFS_DRIVER "zfs"
|
||||
#define ZFS_DEV "/dev/zfs"
|
||||
#define ZFS_MAJOR 230 /* XXX: Arbitrary */
|
||||
#define ZFS_MINORS 16 /* XXX: Arbitrary */
|
||||
|
||||
/*
|
||||
* zvol paths. Irritatingly, the devfsadm interfaces want all these
|
||||
|
|
|
@ -98,7 +98,6 @@ typedef struct zfs_fuid_info {
|
|||
} zfs_fuid_info_t;
|
||||
|
||||
#ifdef _KERNEL
|
||||
#ifdef HAVE_ZPL
|
||||
struct znode;
|
||||
extern uid_t zfs_fuid_map_id(zfsvfs_t *, uint64_t, cred_t *, zfs_fuid_type_t);
|
||||
extern void zfs_fuid_destroy(zfsvfs_t *);
|
||||
|
@ -116,7 +115,6 @@ extern int zfs_fuid_find_by_domain(zfsvfs_t *, const char *domain,
|
|||
char **retdomain, boolean_t addok);
|
||||
extern const char *zfs_fuid_find_by_idx(zfsvfs_t *zfsvfs, uint32_t idx);
|
||||
extern void zfs_fuid_txhold(zfsvfs_t *zfsvfs, dmu_tx_t *tx);
|
||||
#endif /* HAVE_ZPL */
|
||||
#endif
|
||||
|
||||
char *zfs_fuid_idx_domain(avl_tree_t *, uint32_t);
|
||||
|
|
|
@ -23,8 +23,6 @@
|
|||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
|
||||
#include <sys/refcount.h>
|
||||
#include <sys/rrwlock.h>
|
||||
|
||||
|
@ -264,4 +262,3 @@ rrw_held(rrwlock_t *rrl, krw_t rw)
|
|||
|
||||
return (held);
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
|
|
@ -23,8 +23,6 @@
|
|||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
|
@ -2850,5 +2848,3 @@ zfs_zaccess_rename(znode_t *sdzp, znode_t *szp, znode_t *tdzp,
|
|||
|
||||
return (error);
|
||||
}
|
||||
|
||||
#endif /* HAVE_ZPL */
|
||||
|
|
|
@ -64,8 +64,6 @@
|
|||
* so that it cannot be freed until all snapshots have been unmounted.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
|
||||
#include <fs/fs_subr.h>
|
||||
#include <sys/zfs_ctldir.h>
|
||||
#include <sys/zfs_ioctl.h>
|
||||
|
@ -1335,4 +1333,3 @@ zfsctl_umount_snapshots(vfs_t *vfsp, int fflags, cred_t *cr)
|
|||
|
||||
return (error);
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
|
|
@ -23,8 +23,6 @@
|
|||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
|
@ -964,4 +962,3 @@ zfs_sticky_remove_access(znode_t *zdp, znode_t *zp, cred_t *cr)
|
|||
else
|
||||
return (secpolicy_vnode_remove(cr));
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
|
|
@ -194,7 +194,6 @@ zfs_fuid_idx_domain(avl_tree_t *idx_tree, uint32_t idx)
|
|||
}
|
||||
|
||||
#ifdef _KERNEL
|
||||
#ifdef HAVE_ZPL
|
||||
/*
|
||||
* Load the fuid table(s) into memory.
|
||||
*/
|
||||
|
@ -744,5 +743,4 @@ zfs_fuid_txhold(zfsvfs_t *zfsvfs, dmu_tx_t *tx)
|
|||
FUID_SIZE_ESTIMATE(zfsvfs));
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
#endif
|
||||
|
|
|
@ -404,7 +404,6 @@ zfs_secpolicy_send(zfs_cmd_t *zc, cred_t *cr)
|
|||
ZFS_DELEG_PERM_SEND, cr));
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
static int
|
||||
zfs_secpolicy_deleg_share(zfs_cmd_t *zc, cred_t *cr)
|
||||
{
|
||||
|
@ -428,12 +427,10 @@ 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 */
|
||||
|
||||
int
|
||||
zfs_secpolicy_share(zfs_cmd_t *zc, cred_t *cr)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
if (!INGLOBALZONE(curproc))
|
||||
return (EPERM);
|
||||
|
||||
|
@ -442,15 +439,11 @@ zfs_secpolicy_share(zfs_cmd_t *zc, cred_t *cr)
|
|||
} else {
|
||||
return (zfs_secpolicy_deleg_share(zc, cr));
|
||||
}
|
||||
#else
|
||||
return (ENOTSUP);
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
int
|
||||
zfs_secpolicy_smb_acl(zfs_cmd_t *zc, cred_t *cr)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
if (!INGLOBALZONE(curproc))
|
||||
return (EPERM);
|
||||
|
||||
|
@ -459,9 +452,6 @@ zfs_secpolicy_smb_acl(zfs_cmd_t *zc, cred_t *cr)
|
|||
} else {
|
||||
return (zfs_secpolicy_deleg_share(zc, cr));
|
||||
}
|
||||
#else
|
||||
return (ENOTSUP);
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -656,7 +646,6 @@ zfs_secpolicy_create(zfs_cmd_t *zc, cred_t *cr)
|
|||
return (error);
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
static int
|
||||
zfs_secpolicy_umount(zfs_cmd_t *zc, cred_t *cr)
|
||||
{
|
||||
|
@ -668,7 +657,6 @@ zfs_secpolicy_umount(zfs_cmd_t *zc, cred_t *cr)
|
|||
}
|
||||
return (error);
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
/*
|
||||
* Policy for pool operations - create/destroy pools, add vdevs, etc. Requires
|
||||
|
@ -849,7 +837,6 @@ put_nvlist(zfs_cmd_t *zc, nvlist_t *nvl)
|
|||
return (error);
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
static int
|
||||
getzfsvfs(const char *dsname, zfsvfs_t **zvp)
|
||||
{
|
||||
|
@ -912,7 +899,6 @@ zfsvfs_rele(zfsvfs_t *zfsvfs, void *tag)
|
|||
zfsvfs_free(zfsvfs);
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
static int
|
||||
zfs_ioc_pool_create(zfs_cmd_t *zc)
|
||||
|
@ -1728,7 +1714,6 @@ zfs_set_prop_nvlist(const char *name, nvlist_t *nvl)
|
|||
|
||||
if (prop == ZPROP_INVAL) {
|
||||
if (zfs_prop_userquota(propname)) {
|
||||
#ifdef HAVE_ZPL
|
||||
uint64_t *valary;
|
||||
unsigned int vallen;
|
||||
const char *domain;
|
||||
|
@ -1757,10 +1742,6 @@ zfs_set_prop_nvlist(const char *name, nvlist_t *nvl)
|
|||
continue;
|
||||
else
|
||||
goto out;
|
||||
#else
|
||||
error = ENOTSUP;
|
||||
goto out;
|
||||
#endif
|
||||
} else if (zfs_prop_user(propname)) {
|
||||
VERIFY(nvpair_value_string(elem, &strval) == 0);
|
||||
error = dsl_prop_set(name, propname, 1,
|
||||
|
@ -1814,7 +1795,6 @@ zfs_set_prop_nvlist(const char *name, nvlist_t *nvl)
|
|||
|
||||
case ZFS_PROP_VERSION:
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
zfsvfs_t *zfsvfs;
|
||||
|
||||
if ((error = nvpair_value_uint64(elem, &intval)) != 0)
|
||||
|
@ -1833,10 +1813,6 @@ zfs_set_prop_nvlist(const char *name, nvlist_t *nvl)
|
|||
if (error)
|
||||
goto out;
|
||||
break;
|
||||
#else
|
||||
error = ENOTSUP;
|
||||
goto out;
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
default:
|
||||
|
@ -2048,7 +2024,6 @@ zfs_ioc_pool_get_props(zfs_cmd_t *zc)
|
|||
static int
|
||||
zfs_ioc_iscsi_perm_check(zfs_cmd_t *zc)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
nvlist_t *nvp;
|
||||
int error;
|
||||
uint32_t uid;
|
||||
|
@ -2091,9 +2066,6 @@ zfs_ioc_iscsi_perm_check(zfs_cmd_t *zc)
|
|||
zfs_prop_to_name(ZFS_PROP_SHAREISCSI), usercred);
|
||||
crfree(usercred);
|
||||
return (error);
|
||||
#else
|
||||
return (ENOTSUP);
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2191,7 +2163,6 @@ zfs_ioc_remove_minor(zfs_cmd_t *zc)
|
|||
return (zvol_remove_minor(zc->zc_name));
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
/*
|
||||
* Search the vfs list for a specified resource. Returns a pointer to it
|
||||
* or NULL if no suitable entry is found. The caller of this routine
|
||||
|
@ -2216,7 +2187,6 @@ zfs_get_vfs(const char *resource)
|
|||
vfs_list_unlock();
|
||||
return (vfs_found);
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
|
@ -2566,7 +2536,6 @@ out:
|
|||
int
|
||||
zfs_unmount_snap(char *name, void *arg)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
vfs_t *vfsp = NULL;
|
||||
|
||||
if (arg) {
|
||||
|
@ -2598,7 +2567,6 @@ zfs_unmount_snap(char *name, void *arg)
|
|||
if ((err = dounmount(vfsp, flag, kcred)) != 0)
|
||||
return (err);
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -2654,7 +2622,6 @@ zfs_ioc_destroy(zfs_cmd_t *zc)
|
|||
static int
|
||||
zfs_ioc_rollback(zfs_cmd_t *zc)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
objset_t *os;
|
||||
int error;
|
||||
zfsvfs_t *zfsvfs = NULL;
|
||||
|
@ -2688,9 +2655,6 @@ zfs_ioc_rollback(zfs_cmd_t *zc)
|
|||
/* Note, the dmu_objset_rollback() releases the objset for us. */
|
||||
|
||||
return (error);
|
||||
#else
|
||||
return (ENOTSUP);
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2764,9 +2728,7 @@ static int
|
|||
zfs_ioc_recv(zfs_cmd_t *zc)
|
||||
{
|
||||
file_t *fp;
|
||||
#ifdef HAVE_ZPL
|
||||
objset_t *os;
|
||||
#endif /* HAVE_ZPL */
|
||||
dmu_recv_cookie_t drc;
|
||||
boolean_t force = (boolean_t)zc->zc_guid;
|
||||
int error, fd;
|
||||
|
@ -2799,7 +2761,6 @@ zfs_ioc_recv(zfs_cmd_t *zc)
|
|||
return (EBADF);
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
if (props && dmu_objset_open(tofs, DMU_OST_ANY,
|
||||
DS_MODE_USER | DS_MODE_READONLY, &os) == 0) {
|
||||
/*
|
||||
|
@ -2810,7 +2771,6 @@ zfs_ioc_recv(zfs_cmd_t *zc)
|
|||
|
||||
dmu_objset_close(os);
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
if (zc->zc_string[0]) {
|
||||
error = dmu_objset_open(zc->zc_string, DMU_OST_ANY,
|
||||
|
@ -2842,7 +2802,6 @@ zfs_ioc_recv(zfs_cmd_t *zc)
|
|||
error = dmu_recv_stream(&drc, fp->f_vnode, &off);
|
||||
|
||||
if (error == 0) {
|
||||
#ifdef HAVE_ZPL
|
||||
zfsvfs_t *zfsvfs = NULL;
|
||||
|
||||
if (getzfsvfs(tofs, &zfsvfs) == 0) {
|
||||
|
@ -2869,9 +2828,6 @@ zfs_ioc_recv(zfs_cmd_t *zc)
|
|||
} else {
|
||||
error = dmu_recv_end(&drc);
|
||||
}
|
||||
#else
|
||||
error = dmu_recv_end(&drc);
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
zc->zc_cookie = off - fp->f_offset;
|
||||
|
@ -3102,7 +3058,6 @@ zfs_ioc_promote(zfs_cmd_t *zc)
|
|||
static int
|
||||
zfs_ioc_userspace_one(zfs_cmd_t *zc)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
zfsvfs_t *zfsvfs;
|
||||
int error;
|
||||
|
||||
|
@ -3118,9 +3073,6 @@ zfs_ioc_userspace_one(zfs_cmd_t *zc)
|
|||
zfsvfs_rele(zfsvfs, FTAG);
|
||||
|
||||
return (error);
|
||||
#else
|
||||
return (ENOTSUP);
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3137,7 +3089,6 @@ zfs_ioc_userspace_one(zfs_cmd_t *zc)
|
|||
static int
|
||||
zfs_ioc_userspace_many(zfs_cmd_t *zc)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
zfsvfs_t *zfsvfs;
|
||||
int error;
|
||||
|
||||
|
@ -3160,9 +3111,6 @@ zfs_ioc_userspace_many(zfs_cmd_t *zc)
|
|||
zfsvfs_rele(zfsvfs, FTAG);
|
||||
|
||||
return (error);
|
||||
#else
|
||||
return (ENOTSUP);
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3175,7 +3123,6 @@ zfs_ioc_userspace_many(zfs_cmd_t *zc)
|
|||
static int
|
||||
zfs_ioc_userspace_upgrade(zfs_cmd_t *zc)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
objset_t *os;
|
||||
int error;
|
||||
zfsvfs_t *zfsvfs;
|
||||
|
@ -3208,9 +3155,6 @@ zfs_ioc_userspace_upgrade(zfs_cmd_t *zc)
|
|||
}
|
||||
|
||||
return (error);
|
||||
#else
|
||||
return (ENOTSUP);
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3220,7 +3164,6 @@ 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
|
||||
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);
|
||||
|
@ -3252,12 +3195,10 @@ zfs_init_sharefs()
|
|||
}
|
||||
return (0);
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
static int
|
||||
zfs_ioc_share(zfs_cmd_t *zc)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
int error;
|
||||
int opcode;
|
||||
|
||||
|
@ -3347,9 +3288,7 @@ zfs_ioc_share(zfs_cmd_t *zc)
|
|||
zc->zc_share.z_sharemax);
|
||||
|
||||
return (error);
|
||||
#else
|
||||
return (ENOTSUP);
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
}
|
||||
|
||||
ace_t full_access[] = {
|
||||
|
@ -3359,7 +3298,6 @@ ace_t full_access[] = {
|
|||
/*
|
||||
* Remove all ACL files in shares dir
|
||||
*/
|
||||
#ifdef HAVE_ZPL
|
||||
static int
|
||||
zfs_smb_acl_purge(znode_t *dzp)
|
||||
{
|
||||
|
@ -3378,12 +3316,10 @@ zfs_smb_acl_purge(znode_t *dzp)
|
|||
zap_cursor_fini(&zc);
|
||||
return (error);
|
||||
}
|
||||
#endif /* HAVE ZPL */
|
||||
|
||||
static int
|
||||
zfs_ioc_smb_acl(zfs_cmd_t *zc)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
vnode_t *vp;
|
||||
znode_t *dzp;
|
||||
vnode_t *resourcevp = NULL;
|
||||
|
@ -3505,9 +3441,6 @@ zfs_ioc_smb_acl(zfs_cmd_t *zc)
|
|||
ZFS_EXIT(zfsvfs);
|
||||
|
||||
return (error);
|
||||
#else
|
||||
return (ENOTSUP);
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3907,14 +3840,12 @@ _init(void)
|
|||
return (error);
|
||||
}
|
||||
|
||||
error = ldi_ident_from_mod(&modlinkage, &zfs_li);
|
||||
ASSERT(error == 0);
|
||||
#ifdef HAVE_ZPL
|
||||
tsd_create(&zfs_fsyncer_key, NULL);
|
||||
tsd_create(&rrw_tsd_key, NULL);
|
||||
|
||||
error = ldi_ident_from_mod(&modlinkage, &zfs_li);
|
||||
ASSERT(error == 0);
|
||||
mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL);
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
printk(KERN_INFO "ZFS: Loaded ZFS Filesystem v%s\n", ZFS_META_VERSION);
|
||||
|
||||
|
@ -3935,7 +3866,6 @@ _fini(void)
|
|||
zvol_fini();
|
||||
zfs_fini();
|
||||
spa_fini();
|
||||
#ifdef HAVE_ZPL
|
||||
if (zfs_nfsshare_inited)
|
||||
(void) ddi_modclose(nfs_mod);
|
||||
if (zfs_smbshare_inited)
|
||||
|
@ -3943,12 +3873,10 @@ _fini(void)
|
|||
if (zfs_nfsshare_inited || zfs_smbshare_inited)
|
||||
(void) ddi_modclose(sharefs_mod);
|
||||
|
||||
mutex_destroy(&zfs_share_lock);
|
||||
tsd_destroy(&zfs_fsyncer_key);
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
ldi_ident_release(zfs_li);
|
||||
zfs_li = NULL;
|
||||
mutex_destroy(&zfs_share_lock);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
|
|
@ -23,8 +23,6 @@
|
|||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -706,5 +704,3 @@ zfs_log_acl(zilog_t *zilog, dmu_tx_t *tx, znode_t *zp,
|
|||
seq = zil_itx_assign(zilog, itx, tx);
|
||||
zp->z_last_itx = seq;
|
||||
}
|
||||
|
||||
#endif /* HAVE_ZPL */
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
|
@ -876,4 +876,3 @@ zil_replay_func_t *zfs_replay_vector[TX_MAX_TYPE] = {
|
|||
zfs_replay_create, /* TX_MKDIR_ATTR */
|
||||
zfs_replay_create_acl, /* TX_MKDIR_ACL_ATTR */
|
||||
};
|
||||
#endif /* HAVE_ZPL */
|
||||
|
|
|
@ -92,8 +92,6 @@
|
|||
* range to just the range to be written using zfs_reduce_range.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
|
||||
#include <sys/zfs_rlock.h>
|
||||
|
||||
/*
|
||||
|
@ -602,4 +600,3 @@ zfs_range_compare(const void *arg1, const void *arg2)
|
|||
return (-1);
|
||||
return (0);
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
|
|
@ -61,7 +61,6 @@
|
|||
#include <sys/dmu_objset.h>
|
||||
#include <sys/spa_boot.h>
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
int zfsfstype;
|
||||
vfsops_t *zfs_vfsops = NULL;
|
||||
static major_t zfs_major;
|
||||
|
@ -1958,12 +1957,10 @@ zfs_vfsinit(int fstype, char *name)
|
|||
|
||||
return (0);
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
void
|
||||
zfs_init(void)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
/*
|
||||
* Initialize .zfs directory structures
|
||||
*/
|
||||
|
@ -1975,29 +1972,21 @@ zfs_init(void)
|
|||
zfs_znode_init();
|
||||
|
||||
dmu_objset_register_type(DMU_OST_ZFS, zfs_space_delta_cb);
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
void
|
||||
zfs_fini(void)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
zfsctl_fini();
|
||||
zfs_znode_fini();
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
int
|
||||
zfs_busy(void)
|
||||
{
|
||||
#ifdef HAVE_ZPL
|
||||
return (zfs_active_fs_count != 0);
|
||||
#else
|
||||
return 0;
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
int
|
||||
zfs_set_version(zfsvfs_t *zfsvfs, uint64_t newvers)
|
||||
{
|
||||
|
@ -2040,7 +2029,6 @@ zfs_set_version(zfsvfs_t *zfsvfs, uint64_t newvers)
|
|||
|
||||
return (0);
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
/*
|
||||
* Read a property stored within the master node.
|
||||
|
@ -2084,7 +2072,6 @@ zfs_get_zplprop(objset_t *os, zfs_prop_t prop, uint64_t *value)
|
|||
return (error);
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
static vfsdef_t vfw = {
|
||||
VFSDEF_VERSION,
|
||||
MNTTYPE_ZFS,
|
||||
|
@ -2097,4 +2084,3 @@ static vfsdef_t vfw = {
|
|||
struct modlfs zfs_modlfs = {
|
||||
&mod_fsops, "ZFS filesystem version " SPA_VERSION_STRING, &vfw
|
||||
};
|
||||
#endif /* HAVE_ZPL */
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
|
||||
/* Portions Copyright 2007 Jeremy Teo */
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
|
@ -4699,4 +4697,3 @@ const fs_operation_def_t zfs_evnodeops_template[] = {
|
|||
VOPNAME_PATHCONF, { .vop_pathconf = zfs_pathconf },
|
||||
NULL, NULL
|
||||
};
|
||||
#endif /* HAVE_ZPL */
|
||||
|
|
|
@ -87,7 +87,6 @@
|
|||
* (such as VFS logic) that will not compile easily in userland.
|
||||
*/
|
||||
#ifdef _KERNEL
|
||||
#ifdef HAVE_ZPL
|
||||
/*
|
||||
* Needed to close a small window in zfs_znode_move() that allows the zfsvfs to
|
||||
* be freed before it can be safely accessed.
|
||||
|
@ -1474,28 +1473,21 @@ log:
|
|||
dmu_tx_commit(tx);
|
||||
return (0);
|
||||
}
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
void
|
||||
zfs_create_fs(objset_t *os, cred_t *cr, nvlist_t *zplprops, dmu_tx_t *tx)
|
||||
{
|
||||
zfsvfs_t zfsvfs;
|
||||
uint64_t moid, obj, version;
|
||||
uint64_t sense = ZFS_CASE_SENSITIVE;
|
||||
uint64_t norm = 0;
|
||||
nvpair_t *elem;
|
||||
int error;
|
||||
#ifdef HAVE_ZPL
|
||||
zfsvfs_t zfsvfs;
|
||||
znode_t *rootzp = NULL;
|
||||
vnode_t *vp;
|
||||
vattr_t vattr;
|
||||
znode_t *zp;
|
||||
zfs_acl_ids_t acl_ids;
|
||||
#else
|
||||
timestruc_t now;
|
||||
dmu_buf_t *db;
|
||||
znode_phys_t *pzp;
|
||||
#endif /* HAVE_ZPL */
|
||||
|
||||
/*
|
||||
* First attempt to create master node.
|
||||
|
@ -1550,7 +1542,6 @@ zfs_create_fs(objset_t *os, cred_t *cr, nvlist_t *zplprops, dmu_tx_t *tx)
|
|||
error = zap_add(os, moid, ZFS_UNLINKED_SET, 8, 1, &obj, tx);
|
||||
ASSERT(error == 0);
|
||||
|
||||
#ifdef HAVE_ZPL
|
||||
/*
|
||||
* Create root znode. Create minimal znode/vnode/zfsvfs
|
||||
* to allow zfs_mknode to work.
|
||||
|
@ -1605,46 +1596,14 @@ zfs_create_fs(objset_t *os, cred_t *cr, nvlist_t *zplprops, dmu_tx_t *tx)
|
|||
dmu_buf_rele(rootzp->z_dbuf, NULL);
|
||||
rootzp->z_dbuf = NULL;
|
||||
kmem_cache_free(znode_cache, rootzp);
|
||||
|
||||
/*
|
||||
* Create shares directory
|
||||
*/
|
||||
|
||||
error = zfs_create_share_dir(&zfsvfs, tx);
|
||||
#else
|
||||
/*
|
||||
* Create root znode with code free of VFS dependencies
|
||||
*/
|
||||
obj = zap_create_norm(os, norm, DMU_OT_DIRECTORY_CONTENTS,
|
||||
DMU_OT_ZNODE, sizeof (znode_phys_t), tx);
|
||||
|
||||
VERIFY(0 == dmu_bonus_hold(os, obj, FTAG, &db));
|
||||
dmu_buf_will_dirty(db, tx);
|
||||
|
||||
/*
|
||||
* Initialize the znode physical data to zero.
|
||||
*/
|
||||
ASSERT(db->db_size >= sizeof (znode_phys_t));
|
||||
bzero(db->db_data, db->db_size);
|
||||
pzp = db->db_data;
|
||||
|
||||
if (USE_FUIDS(version, os))
|
||||
pzp->zp_flags = ZFS_ARCHIVE | ZFS_AV_MODIFIED;
|
||||
|
||||
pzp->zp_size = 2; /* "." and ".." */
|
||||
pzp->zp_links = 2;
|
||||
pzp->zp_parent = obj;
|
||||
pzp->zp_gen = dmu_tx_get_txg(tx);
|
||||
pzp->zp_mode = S_IFDIR | 0755;
|
||||
pzp->zp_flags = ZFS_ACL_TRIVIAL;
|
||||
|
||||
gethrestime(&now);
|
||||
|
||||
ZFS_TIME_ENCODE(&now, pzp->zp_crtime);
|
||||
ZFS_TIME_ENCODE(&now, pzp->zp_ctime);
|
||||
ZFS_TIME_ENCODE(&now, pzp->zp_atime);
|
||||
ZFS_TIME_ENCODE(&now, pzp->zp_mtime);
|
||||
|
||||
error = zap_add(os, moid, ZFS_ROOT_OBJ, 8, 1, &obj, tx);
|
||||
ASSERT(error == 0);
|
||||
|
||||
dmu_buf_rele(db, FTAG);
|
||||
#endif /* HAVE_ZPL */
|
||||
}
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
|
Loading…
Reference in New Issue