From 79491b69f44415ee84a1ea9cf388e7b122f03914 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 22 Dec 2008 12:23:27 -0800 Subject: [PATCH 01/16] Start linux-have-zpl layer --- .topdeps | 4 +--- .topmsg | 19 ++++------------ cmd/zfs/zfs_main.c | 34 ++++++++++++++++++++++++++++ cmd/zpool/zpool_main.c | 8 +++++++ lib/libzfs/libzfs_changelist.c | 12 ++++++++++ lib/libzfs/libzfs_dataset.c | 6 +++++ lib/libzfs/libzfs_mount.c | 41 +++++++++++++++++++++++++++++++++- lib/libzfs/libzfs_sendrecv.c | 2 ++ lib/libzfs/libzfs_util.c | 2 ++ module/zfs/zfs_vfsops.c | 2 ++ 10 files changed, 111 insertions(+), 19 deletions(-) diff --git a/.topdeps b/.topdeps index 607c231780..7f16cbcdd5 100644 --- a/.topdeps +++ b/.topdeps @@ -1,3 +1 @@ -gcc-branch -fix-branch -feature-branch +zfs-branch diff --git a/.topmsg b/.topmsg index e9722e1075..522206da43 100644 --- a/.topmsg +++ b/.topmsg @@ -1,19 +1,8 @@ From: Brian Behlendorf -Subject: [PATCH] zfs branch +Subject: [PATCH] linux-have-zpl -Merged result of all changes which are relevant to both Solaris -and Linux builds of the ZFS code. These are changes where there -is a reasonable chance they will be accepted upstream. - -Additionally, since this is effectively the root of the linux -ZFS tree the core linux build system is added here. This -includes autogen.sh, configure.ac, m4 macros, some scripts/*, -and makefiles for all the core ZFS components. Linux-only -features which require tweaks to the build system should appear -on the relevant topic branches. All autotools products which -result from autogen.sh are commited to the linux-configure-branch. - -This branch also contains the META, ChangeLog, AUTHORS, -README, and GIT files. +Changes required to build ZFS without the ZPL layer. Or +better yet long term the changes required to integrate ZFS +in to linux's VFS layer. Signed-off-by: Brian Behlendorf diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index e3391cf7c6..7eb7bd0fda 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -505,6 +505,7 @@ 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; @@ -515,6 +516,7 @@ zfs_do_clone(int argc, char **argv) zfs_close(clone); } } +#endif /* HAVE_ZPL */ zfs_close(zhp); nvlist_free(props); @@ -712,6 +714,7 @@ 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 " @@ -723,6 +726,7 @@ zfs_do_create(int argc, char **argv) ret = 1; } } +#endif /* HAVE_ZPL */ error: if (zhp) @@ -832,6 +836,7 @@ destroy_callback(zfs_handle_t *zhp, void *data) return (0); } +#ifdef HAVE_ZPL /* * Bail out on the first error. */ @@ -840,6 +845,7 @@ destroy_callback(zfs_handle_t *zhp, void *data) zfs_close(zhp); return (-1); } +#endif /* HAVE_ZPL */ zfs_close(zhp); return (0); @@ -3006,6 +3012,7 @@ dataset_cmp(const void *a, const void *b) return (strcmp(zfs_get_name(a), zfs_get_name(b))); } +#if HAVE_ZPL /* * Generic callback for sharing or mounting filesystems. Because the code is so * similar, we have a common function with an extra parameter to determine which @@ -3240,6 +3247,7 @@ share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol, return (0); } +#endif /* HAVE_ZPL */ /* * Reports progress in the form "(current/total)". Not thread-safe. @@ -3295,6 +3303,7 @@ append_options(char *mntopts, char *newopts) (void) strcpy(&mntopts[len], newopts); } +#ifdef HAVE_ZPL static int share_mount(int op, int argc, char **argv) { @@ -3443,6 +3452,7 @@ share_mount(int op, int argc, char **argv) return (ret); } +#endif /* HAVE_ZPL */ /* * zfs mount -a [nfs | iscsi] @@ -3453,7 +3463,11 @@ 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 */ } /* @@ -3465,9 +3479,14 @@ 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; @@ -3920,6 +3939,7 @@ unshare_unmount(int op, int argc, char **argv) return (ret); } +#endif /* HAVE_ZPL */ /* * zfs unmount -a @@ -3930,7 +3950,11 @@ 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 */ } /* @@ -3942,13 +3966,18 @@ 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 */ } /* * 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) { @@ -4079,6 +4108,7 @@ 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) @@ -4148,6 +4178,7 @@ 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]. @@ -4158,6 +4189,9 @@ 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. */ diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index 316fa291d8..ab315d4211 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -722,6 +722,7 @@ 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)); @@ -744,6 +745,7 @@ zpool_do_create(int argc, char **argv) goto errout; } } +#endif /* HAVE_ZPL */ } if (dryrun) { @@ -774,8 +776,12 @@ 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) { @@ -1315,10 +1321,12 @@ do_import(nvlist_t *config, const char *newname, const char *mntopts, verify((zhp = zpool_open_canfail(g_zfs, name)) != NULL); +#if HAVE_ZPL if (zpool_enable_datasets(zhp, mntopts, 0) != 0) { zpool_close(zhp); return (1); } +#endif /* HAVE_ZPL */ zpool_close(zhp); return (error); diff --git a/lib/libzfs/libzfs_changelist.c b/lib/libzfs/libzfs_changelist.c index 8823b2e694..bc4654292c 100644 --- a/lib/libzfs/libzfs_changelist.c +++ b/lib/libzfs/libzfs_changelist.c @@ -93,6 +93,7 @@ struct prop_changelist { int changelist_prefix(prop_changelist_t *clp) { +#ifdef HAVE_ZPL prop_changenode_t *cn; int ret = 0; @@ -168,6 +169,9 @@ changelist_prefix(prop_changelist_t *clp) (void) changelist_postfix(clp); return (ret); +#else + return 0; +#endif /* HAVE_ZPL */ } /* @@ -182,6 +186,7 @@ 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; @@ -296,6 +301,9 @@ changelist_postfix(prop_changelist_t *clp) } return (errors ? -1 : 0); +#else + return 0; +#endif /* HAVE_ZPL */ } /* @@ -358,6 +366,7 @@ 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; @@ -372,6 +381,9 @@ changelist_unshare(prop_changelist_t *clp, zfs_share_proto_t *proto) } return (ret); +#else + return 0; +#endif } /* diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index 5be832b4a6..25da17c771 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -735,6 +735,7 @@ 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: /* @@ -845,6 +846,7 @@ 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; @@ -2873,6 +2875,7 @@ 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; @@ -2882,6 +2885,7 @@ create_parents(libzfs_handle_t *hdl, char *target, int prefixlen) opname = dgettext(TEXT_DOMAIN, "share"); goto ancestorerr; } +#endif /* HAVE_ZPL */ zfs_close(h); } @@ -3098,9 +3102,11 @@ zfs_destroy(zfs_handle_t *zhp) * 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); diff --git a/lib/libzfs/libzfs_mount.c b/lib/libzfs/libzfs_mount.c index a6d7698860..662b610ba6 100644 --- a/lib/libzfs/libzfs_mount.c +++ b/lib/libzfs/libzfs_mount.c @@ -86,6 +86,7 @@ #include #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); @@ -1234,7 +1235,6 @@ out: return (ret); } - static int zvol_cb(const char *dataset, void *data) { @@ -1407,3 +1407,42 @@ 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_TRUE; +} + +int +zpool_disable_datasets(zpool_handle_t *zhp, boolean_t force) +{ + return B_TRUE; +} + +#endif /* HAVE_ZPL */ diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index 64ba5a4992..01732ce891 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -1930,6 +1930,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap, * created). Also mount any children of the target filesystem * if we did an incremental receive. */ +#ifdef HAVE_ZPL cp = strchr(zc.zc_value, '@'); if (cp && (ioctl_err == 0 || !newfs)) { zfs_handle_t *h; @@ -1956,6 +1957,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap, } *cp = '@'; } +#endif /* HAVE_ZPL */ if (clp) { err |= changelist_postfix(clp); diff --git a/lib/libzfs/libzfs_util.c b/lib/libzfs/libzfs_util.c index 22e3d0aa16..73dc538730 100644 --- a/lib/libzfs/libzfs_util.c +++ b/lib/libzfs/libzfs_util.c @@ -587,7 +587,9 @@ libzfs_fini(libzfs_handle_t *hdl) (void) fclose(hdl->libzfs_mnttab); 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); diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c index 06b4dee462..5abf8751b5 100644 --- a/module/zfs/zfs_vfsops.c +++ b/module/zfs/zfs_vfsops.c @@ -1638,6 +1638,7 @@ 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, @@ -1650,3 +1651,4 @@ static vfsdef_t vfw = { struct modlfs zfs_modlfs = { &mod_fsops, "ZFS filesystem version " SPA_VERSION_STRING, &vfw }; +#endif /* HAVE_ZPL */ From 05b4b092dc5c111672b4cbd7c4cd728f058e9f8c Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 22 Dec 2008 13:31:23 -0800 Subject: [PATCH 02/16] Only required for ZPL builds --- module/zfs/rrwlock.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/zfs/rrwlock.c b/module/zfs/rrwlock.c index 710685dbc7..7bce5dd8d7 100644 --- a/module/zfs/rrwlock.c +++ b/module/zfs/rrwlock.c @@ -23,6 +23,8 @@ * Use is subject to license terms. */ +#ifdef HAVE_ZPL + #pragma ident "%Z%%M% %I% %E% SMI" #include @@ -247,3 +249,5 @@ rrw_held(rrwlock_t *rrl, krw_t rw) return (held); } + +#endif /* HAVE_ZPL */ From f41626ced690778df009c50d2da5e3456a479f1c Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 22 Dec 2008 13:46:30 -0800 Subject: [PATCH 03/16] Make ZPL conditional --- module/zfs/rrwlock.c | 4 ---- module/zfs/zfs_acl.c | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/zfs/rrwlock.c b/module/zfs/rrwlock.c index 7bce5dd8d7..710685dbc7 100644 --- a/module/zfs/rrwlock.c +++ b/module/zfs/rrwlock.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#ifdef HAVE_ZPL - #pragma ident "%Z%%M% %I% %E% SMI" #include @@ -249,5 +247,3 @@ rrw_held(rrwlock_t *rrl, krw_t rw) return (held); } - -#endif /* HAVE_ZPL */ diff --git a/module/zfs/zfs_acl.c b/module/zfs/zfs_acl.c index 341dc4dfe7..1299e73793 100644 --- a/module/zfs/zfs_acl.c +++ b/module/zfs/zfs_acl.c @@ -23,6 +23,8 @@ * Use is subject to license terms. */ +#ifdef HAVE_ZPL + #include #include #include @@ -2678,3 +2680,5 @@ zfs_zaccess_rename(znode_t *sdzp, znode_t *szp, znode_t *tdzp, return (error); } + +#endif /* HAVE_ZPL */ From 575903cb9a6ddd320c6187a7ce2b515ff9e67057 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 22 Dec 2008 16:01:04 -0800 Subject: [PATCH 04/16] Comment out zfs_mount/umount --- cmd/zinject/zinject.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/zinject/zinject.c b/cmd/zinject/zinject.c index 02dc18b9c8..e1c6135151 100644 --- a/cmd/zinject/zinject.c +++ b/cmd/zinject/zinject.c @@ -750,17 +750,20 @@ 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); From 12a404837097f346ac09c977f021390fdc55ea71 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 7 Jan 2009 15:26:04 -0800 Subject: [PATCH 05/16] Enable zfs_create_fs to operate without the VFS --- module/zfs/zfs_znode.c | 51 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c index 4a1820940c..114eee682f 100644 --- a/module/zfs/zfs_znode.c +++ b/module/zfs/zfs_znode.c @@ -87,6 +87,7 @@ * (such as VFS logic) that will not compile easily in userland. */ #ifdef _KERNEL +#ifdef HAVE_ZPL static kmem_cache_t *znode_cache = NULL; /*ARGSUSED*/ @@ -1473,20 +1474,28 @@ 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, doid, 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; +#else + uint64_t obj; + timestruc_t now; + dmu_buf_t *db; + znode_phys_t *pzp; +#endif /* HAVE_ZPL */ /* * First attempt to create master node. @@ -1541,6 +1550,7 @@ 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, &doid, tx); ASSERT(error == 0); +#ifdef HAVE_ZPL /* * Create root znode. Create minimal znode/vnode/zfsvfs * to allow zfs_mknode to work. @@ -1593,6 +1603,45 @@ 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); +#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 */ From 86a5af4d25747cfc7ee9eea880ee7cc159cc7393 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 9 Jan 2009 11:13:22 -0800 Subject: [PATCH 06/16] Update HAVE_ZPL bits for zfs_ioctl --- module/zcommon/include/sys/fs/zfs.h | 2 ++ module/zfs/zfs_ioctl.c | 39 +++++++++++++++++++++++++++-- module/zfs/zfs_vfsops.c | 8 ++++++ 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/module/zcommon/include/sys/fs/zfs.h b/module/zcommon/include/sys/fs/zfs.h index 95f04d842e..c518382871 100644 --- a/module/zcommon/include/sys/fs/zfs.h +++ b/module/zcommon/include/sys/fs/zfs.h @@ -491,6 +491,8 @@ 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 diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index b77ee4da38..477100b02e 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -394,6 +394,7 @@ zfs_secpolicy_send(zfs_cmd_t *zc, cred_t *cr) int zfs_secpolicy_share(zfs_cmd_t *zc, cred_t *cr) { +#ifdef HAVE_ZPL if (!INGLOBALZONE(curproc)) return (EPERM); @@ -420,6 +421,9 @@ zfs_secpolicy_share(zfs_cmd_t *zc, cred_t *cr) return (dsl_deleg_access(zc->zc_name, ZFS_DELEG_PERM_SHARE, cr)); } +#else + return (ENOTSUP); +#endif /* HAVE_ZPL */ } static int @@ -1688,6 +1692,7 @@ 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; @@ -1730,6 +1735,9 @@ 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 */ } /* @@ -1835,6 +1843,7 @@ zfs_ioc_remove_minor(zfs_cmd_t *zc) static vfs_t * zfs_get_vfs(const char *resource) { +#ifdef HAVE_ZPL struct vfs *vfsp; struct vfs *vfs_found = NULL; @@ -1850,6 +1859,9 @@ zfs_get_vfs(const char *resource) } while (vfsp != rootvfs); vfs_list_unlock(); return (vfs_found); +#else + return NULL; +#endif /* HAVE_ZPL */ } /* ARGSUSED */ @@ -2225,6 +2237,7 @@ zfs_ioc_snapshot(zfs_cmd_t *zc) int zfs_unmount_snap(char *name, void *arg) { +#ifdef HAVE_ZPL vfs_t *vfsp = NULL; if (arg) { @@ -2256,6 +2269,7 @@ zfs_unmount_snap(char *name, void *arg) if ((err = dounmount(vfsp, flag, kcred)) != 0) return (err); } +#endif /* HAVE_ZPL */ return (0); } @@ -2308,6 +2322,7 @@ 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; @@ -2353,6 +2368,9 @@ 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 */ } /* @@ -2423,7 +2441,9 @@ 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; zfsvfs_t *zfsvfs = NULL; boolean_t force = (boolean_t)zc->zc_guid; @@ -2457,6 +2477,7 @@ zfs_ioc_recv(zfs_cmd_t *zc) return (EBADF); } +#ifdef HAVE_ZPL if (dmu_objset_open(tofs, DMU_OST_ANY, DS_MODE_USER | DS_MODE_READONLY, &os) == 0) { /* @@ -2486,6 +2507,7 @@ 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, @@ -2551,7 +2573,9 @@ zfs_ioc_recv(zfs_cmd_t *zc) out: if (zfsvfs) { mutex_exit(&zfsvfs->z_online_recv_lock); +#ifdef HAVE_ZPL VFS_RELE(zfsvfs->z_vfs); +#endif /* HAVE_ZPL */ } nvlist_free(props); nvlist_free(origprops); @@ -2760,6 +2784,7 @@ zfs_ioc_promote(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); @@ -2791,10 +2816,12 @@ zfs_init_sharefs() } return (0); } +#endif /* HAVE_ZPL */ static int zfs_ioc_share(zfs_cmd_t *zc) { +#ifdef HAVE_ZPL int error; int opcode; @@ -2884,9 +2911,12 @@ zfs_ioc_share(zfs_cmd_t *zc) zc->zc_share.z_sharemax); return (error); - +#else + return (ENOTSUP); +#endif /* HAVE_ZPL */ } + /* * pool create, destroy, and export don't log the history as part of * zfsdev_ioctl, but rather zfs_ioc_pool_create, and zfs_ioc_pool_export @@ -3138,7 +3168,9 @@ _init(void) error = ldi_ident_from_mod(&modlinkage, &zfs_li); ASSERT(error == 0); +#ifdef HAVE_ZPL mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); +#endif /* HAVE_ZPL */ return (0); } @@ -3157,6 +3189,7 @@ _fini(void) zvol_fini(); zfs_fini(); spa_fini(); +#ifdef HAVE_ZPL if (zfs_nfsshare_inited) (void) ddi_modclose(nfs_mod); if (zfs_smbshare_inited) @@ -3164,10 +3197,12 @@ _fini(void) if (zfs_nfsshare_inited || zfs_smbshare_inited) (void) ddi_modclose(sharefs_mod); + mutex_destroy(&zfs_share_lock); +#endif /* HAVE_ZPL */ + tsd_destroy(&zfs_fsyncer_key); ldi_ident_release(zfs_li); zfs_li = NULL; - mutex_destroy(&zfs_share_lock); return (error); } diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c index 5abf8751b5..4aab6fb12c 100644 --- a/module/zfs/zfs_vfsops.c +++ b/module/zfs/zfs_vfsops.c @@ -1521,6 +1521,7 @@ zfs_vfsinit(int fstype, char *name) void zfs_init(void) { +#ifdef HAVE_ZPL /* * Initialize .zfs directory structures */ @@ -1530,19 +1531,26 @@ zfs_init(void) * Initialize znode cache, vnode ops, etc... */ zfs_znode_init(); +#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 */ } int From f1549b9636e669320ebcef073c53cce9fdd9093d Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 9 Jan 2009 12:53:37 -0800 Subject: [PATCH 07/16] Take tsd_* functions out for now, we need it for the ZPL later --- module/zfs/zfs_ioctl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index 298b111a92..71f089369b 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -3159,12 +3159,12 @@ _init(void) return (error); } - tsd_create(&zfs_fsyncer_key, NULL); - tsd_create(&rrw_tsd_key, NULL); - 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); + mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); #endif /* HAVE_ZPL */ @@ -3194,9 +3194,9 @@ _fini(void) (void) ddi_modclose(sharefs_mod); mutex_destroy(&zfs_share_lock); + tsd_destroy(&zfs_fsyncer_key); #endif /* HAVE_ZPL */ - tsd_destroy(&zfs_fsyncer_key); ldi_ident_release(zfs_li); zfs_li = NULL; From 203d2b01b8d798c7871e8a94793a3d2f0b273cc7 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 9 Jan 2009 14:02:40 -0800 Subject: [PATCH 08/16] Make most of the vfsops conditional on ZPL support --- module/zfs/zfs_vfsops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c index 4aab6fb12c..6f2e79c4df 100644 --- a/module/zfs/zfs_vfsops.c +++ b/module/zfs/zfs_vfsops.c @@ -61,6 +61,7 @@ #include #include +#ifdef HAVE_ZPL int zfsfstype; vfsops_t *zfs_vfsops = NULL; static major_t zfs_major; @@ -1517,6 +1518,7 @@ zfs_vfsinit(int fstype, char *name) return (0); } +#endif /* HAVE_ZPL */ void zfs_init(void) From fba5a806a8f5efe536f710a35aacb0324416b58a Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 9 Jan 2009 14:43:22 -0800 Subject: [PATCH 09/16] ifdef HAVE_ZPL out source files with only ZPL bits --- module/zfs/zfs_ctldir.c | 3 +++ module/zfs/zfs_dir.c | 3 +++ module/zfs/zfs_log.c | 4 ++++ module/zfs/zfs_replay.c | 3 +++ module/zfs/zfs_rlock.c | 3 +++ module/zfs/zfs_vnops.c | 3 +++ 6 files changed, 19 insertions(+) diff --git a/module/zfs/zfs_ctldir.c b/module/zfs/zfs_ctldir.c index 208fc36295..c12eaf3896 100644 --- a/module/zfs/zfs_ctldir.c +++ b/module/zfs/zfs_ctldir.c @@ -66,6 +66,8 @@ * so that it cannot be freed until all snapshots have been unmounted. */ +#ifdef HAVE_ZPL + #include #include #include @@ -1157,3 +1159,4 @@ zfsctl_umount_snapshots(vfs_t *vfsp, int fflags, cred_t *cr) return (error); } +#endif /* HAVE_ZPL */ diff --git a/module/zfs/zfs_dir.c b/module/zfs/zfs_dir.c index 1ec4932646..804ac96277 100644 --- a/module/zfs/zfs_dir.c +++ b/module/zfs/zfs_dir.c @@ -23,6 +23,8 @@ * Use is subject to license terms. */ +#ifdef HAVE_ZPL + #include #include #include @@ -975,3 +977,4 @@ zfs_sticky_remove_access(znode_t *zdp, znode_t *zp, cred_t *cr) else return (secpolicy_vnode_remove(cr)); } +#endif /* HAVE_ZPL */ diff --git a/module/zfs/zfs_log.c b/module/zfs/zfs_log.c index 11cd4c264b..f79a8e8fdb 100644 --- a/module/zfs/zfs_log.c +++ b/module/zfs/zfs_log.c @@ -23,6 +23,8 @@ * Use is subject to license terms. */ +#ifdef HAVE_ZPL + #include #include #include @@ -692,3 +694,5 @@ 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 */ diff --git a/module/zfs/zfs_replay.c b/module/zfs/zfs_replay.c index 85b79703a7..181847121e 100644 --- a/module/zfs/zfs_replay.c +++ b/module/zfs/zfs_replay.c @@ -23,6 +23,8 @@ * Use is subject to license terms. */ +#ifdef HAVE_ZPL + #pragma ident "%Z%%M% %I% %E% SMI" #include @@ -876,3 +878,4 @@ 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 */ diff --git a/module/zfs/zfs_rlock.c b/module/zfs/zfs_rlock.c index f0a75b5fa0..63ebc19bdd 100644 --- a/module/zfs/zfs_rlock.c +++ b/module/zfs/zfs_rlock.c @@ -94,6 +94,8 @@ * range to just the range to be written using zfs_reduce_range. */ +#ifdef HAVE_ZPL + #include /* @@ -600,3 +602,4 @@ zfs_range_compare(const void *arg1, const void *arg2) return (-1); return (0); } +#endif /* HAVE_ZPL */ diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 8e0037e37d..a64e1cf451 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -25,6 +25,8 @@ /* Portions Copyright 2007 Jeremy Teo */ +#ifdef HAVE_ZPL + #include #include #include @@ -4559,3 +4561,4 @@ const fs_operation_def_t zfs_evnodeops_template[] = { VOPNAME_PATHCONF, { .vop_pathconf = zfs_pathconf }, NULL, NULL }; +#endif /* HAVE_ZPL */ From 39184ef9b43a8c323ff6660fea157ac43c4a5908 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 9 Jan 2009 15:08:36 -0800 Subject: [PATCH 10/16] Only needed by ZPL --- module/zfs/rrwlock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/zfs/rrwlock.c b/module/zfs/rrwlock.c index db3b70fc68..f99a555cfb 100644 --- a/module/zfs/rrwlock.c +++ b/module/zfs/rrwlock.c @@ -23,6 +23,8 @@ * Use is subject to license terms. */ +#ifdef HAVE_ZPL + #pragma ident "%Z%%M% %I% %E% SMI" #include @@ -247,3 +249,4 @@ rrw_held(rrwlock_t *rrl, krw_t rw) return (held); } +#endif /* HAVE_ZPL */ From 1475f7234b7d4127dd0c22b0546ef4b47d04d557 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 9 Jan 2009 15:55:19 -0800 Subject: [PATCH 11/16] Make the ZPL only bits conditional --- module/zfs/include/sys/zfs_fuid.h | 2 ++ module/zfs/zfs_fuid.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/module/zfs/include/sys/zfs_fuid.h b/module/zfs/include/sys/zfs_fuid.h index 810ffc81a8..d8eb2cca78 100644 --- a/module/zfs/include/sys/zfs_fuid.h +++ b/module/zfs/include/sys/zfs_fuid.h @@ -100,6 +100,7 @@ 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 *); @@ -112,6 +113,7 @@ extern void zfs_fuid_map_ids(struct znode *zp, cred_t *cr, uid_t *uid, extern zfs_fuid_info_t *zfs_fuid_info_alloc(void); extern void zfs_fuid_info_free(); extern boolean_t zfs_groupmember(zfsvfs_t *, uint64_t, cred_t *); +#endif /* HAVE_ZPL */ #endif char *zfs_fuid_idx_domain(avl_tree_t *, uint32_t); diff --git a/module/zfs/zfs_fuid.c b/module/zfs/zfs_fuid.c index 7cb505258d..819d8ffaf4 100644 --- a/module/zfs/zfs_fuid.c +++ b/module/zfs/zfs_fuid.c @@ -185,6 +185,7 @@ zfs_fuid_idx_domain(avl_tree_t *idx_tree, uint32_t idx) } #ifdef _KERNEL +#ifdef HAVE_ZPL /* * Load the fuid table(s) into memory. */ @@ -701,4 +702,5 @@ zfs_groupmember(zfsvfs_t *zfsvfs, uint64_t id, cred_t *cr) gid = zfs_fuid_map_id(zfsvfs, id, cr, ZFS_GROUP); return (groupmember(gid, cr)); } +#endif /* HAVE_ZPL */ #endif From bdde0d9d400f857771625daaa08cad77f205ed38 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 14 Jan 2009 10:37:35 -0800 Subject: [PATCH 12/16] Return success here not failure --- lib/libzfs/libzfs_mount.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libzfs/libzfs_mount.c b/lib/libzfs/libzfs_mount.c index 662b610ba6..6c7ce039d5 100644 --- a/lib/libzfs/libzfs_mount.c +++ b/lib/libzfs/libzfs_mount.c @@ -1436,13 +1436,13 @@ zfs_is_shared(zfs_handle_t *zhp) int zpool_enable_datasets(zpool_handle_t *zhp, const char *mntopts, int flags) { - return B_TRUE; + return B_FALSE; } int zpool_disable_datasets(zpool_handle_t *zhp, boolean_t force) { - return B_TRUE; + return B_FALSE; } #endif /* HAVE_ZPL */ From 375227bdeacefabfa88383df44b79dff3183d842 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 14 Jan 2009 13:43:01 -0800 Subject: [PATCH 13/16] Update topmsg --- .topmsg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.topmsg b/.topmsg index 522206da43..f31623955b 100644 --- a/.topmsg +++ b/.topmsg @@ -1,5 +1,5 @@ From: Brian Behlendorf -Subject: [PATCH] linux-have-zpl +Subject: [PATCH] linux have zpl Changes required to build ZFS without the ZPL layer. Or better yet long term the changes required to integrate ZFS From 1c0279a08f4f5a8cfa2947a085c919939df90891 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 11 Mar 2009 22:43:09 -0700 Subject: [PATCH 14/16] Resolve newly revealed unused vars and symbols caused by topic branch. --- cmd/zfs/zfs_main.c | 4 ++++ cmd/zpool/zpool_main.c | 2 ++ module/zfs/zfs_ioctl.c | 8 ++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index 9d4bfc3cff..d3228e2269 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -817,7 +817,9 @@ 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 @@ -4152,7 +4154,9 @@ main(int argc, char **argv) { int ret; int i; +#ifdef HAVE_ZPL char *progname; +#endif char *cmdname; (void) setlocale(LC_ALL, ""); diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index 4ebdeaa445..b23098443f 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -697,7 +697,9 @@ 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 " diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index 3080cfc2a0..f57436e4e0 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -616,6 +616,7 @@ 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) { @@ -627,6 +628,7 @@ 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 @@ -1869,6 +1871,7 @@ 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 @@ -1877,7 +1880,6 @@ zfs_ioc_remove_minor(zfs_cmd_t *zc) static vfs_t * zfs_get_vfs(const char *resource) { -#ifdef HAVE_ZPL struct vfs *vfsp; struct vfs *vfs_found = NULL; @@ -1893,10 +1895,8 @@ zfs_get_vfs(const char *resource) } while (vfsp != rootvfs); vfs_list_unlock(); return (vfs_found); -#else - return NULL; -#endif /* HAVE_ZPL */ } +#endif /* HAVE_ZPL */ /* ARGSUSED */ static void From 8aac8753f4d2feb0d26e4b89104684421b44396b Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 11 Mar 2009 22:55:45 -0700 Subject: [PATCH 15/16] Move 4 unused functions under HAVE_ZPL until implemented. --- cmd/zfs/zfs_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index d3228e2269..f8d1a347f3 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -2962,6 +2962,7 @@ get_one_dataset(zfs_handle_t *zhp, void *data) return (0); } +#ifdef HAVE_ZPL static void get_all_datasets(uint_t types, zfs_handle_t ***dslist, size_t *count, boolean_t verbose) @@ -3012,7 +3013,6 @@ dataset_cmp(const void *a, const void *b) return (strcmp(zfs_get_name(a), zfs_get_name(b))); } -#if HAVE_ZPL /* * Generic callback for sharing or mounting filesystems. Because the code is so * similar, we have a common function with an extra parameter to determine which @@ -3248,7 +3248,6 @@ share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol, return (0); } -#endif /* HAVE_ZPL */ /* * Reports progress in the form "(current/total)". Not thread-safe. @@ -3304,7 +3303,6 @@ append_options(char *mntopts, char *newopts) (void) strcpy(&mntopts[len], newopts); } -#ifdef HAVE_ZPL static int share_mount(int op, int argc, char **argv) { From 53edd221ff07e2be82650e707f2f6a5cfa2fd1b4 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 16 Mar 2009 11:14:19 -0700 Subject: [PATCH 16/16] Pull unused get_one_dataset() under HAVE_ZPL ifdef. --- cmd/zfs/zfs_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index 464e16797f..87f83ab394 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -2899,6 +2899,7 @@ 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) { @@ -2962,7 +2963,6 @@ get_one_dataset(zfs_handle_t *zhp, void *data) return (0); } -#ifdef HAVE_ZPL static void get_all_datasets(uint_t types, zfs_handle_t ***dslist, size_t *count, boolean_t verbose)