Fix minor compiler warnings
[zfs.git] / module / zfs / zfs_vfsops.c
index cb8c1d0..30bbccc 100644 (file)
@@ -65,6 +65,7 @@
 #include <sys/sa.h>
 #include "zfs_comutil.h"
 
+#ifdef HAVE_ZPL
 int zfsfstype;
 vfsops_t *zfs_vfsops = NULL;
 static major_t zfs_major;
@@ -484,8 +485,8 @@ zfs_register_callbacks(vfs_t *vfsp)
                char osname[MAXNAMELEN];
 
                dmu_objset_name(os, osname);
-               if (error = dsl_prop_get_integer(osname, "nbmand", &nbmand,
-                   NULL)) {
+               if ((error = dsl_prop_get_integer(osname, "nbmand", &nbmand,
+                   NULL))) {
                        return (error);
                }
        }
@@ -560,6 +561,7 @@ unregister:
        return (error);
 
 }
+#endif /* HAVE_ZPL */
 
 static int
 zfs_space_delta_cb(dmu_object_type_t bonustype, void *data,
@@ -610,6 +612,7 @@ zfs_space_delta_cb(dmu_object_type_t bonustype, void *data,
        return (error);
 }
 
+#ifdef HAVE_ZPL
 static void
 fuidstr_to_sid(zfsvfs_t *zfsvfs, const char *fuidstr,
     char *domainbuf, int buflen, uid_t *ridp)
@@ -639,6 +642,8 @@ zfs_userquota_prop_to_obj(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type)
                return (zfsvfs->z_userquota_obj);
        case ZFS_PROP_GROUPQUOTA:
                return (zfsvfs->z_groupquota_obj);
+       default:
+               return (ENOTSUP);
        }
        return (0);
 }
@@ -870,7 +875,7 @@ zfsvfs_create(const char *osname, zfsvfs_t **zfvp)
                goto out;
        } else if (zfsvfs->z_version >
            zfs_zpl_version_map(spa_version(dmu_objset_spa(os)))) {
-               (void) printf("Can't mount a version %lld file system "
+               (void) printk("Can't mount a version %lld file system "
                    "on a version %lld pool\n. Pool must be upgraded to mount "
                    "this file system.", (u_longlong_t)zfsvfs->z_version,
                    (u_longlong_t)spa_version(dmu_objset_spa(os)));
@@ -1123,8 +1128,8 @@ zfs_domount(vfs_t *vfsp, char *osname)
        }
        ASSERT(vfs_devismounted(mount_dev) == 0);
 
-       if (error = dsl_prop_get_integer(osname, "recordsize", &recordsize,
-           NULL))
+       if ((error = dsl_prop_get_integer(osname, "recordsize",
+           &recordsize, NULL)))
                goto out;
 
        vfsp->vfs_dev = mount_dev;
@@ -1166,7 +1171,7 @@ zfs_domount(vfs_t *vfsp, char *osname)
 
                atime_changed_cb(zfsvfs, B_FALSE);
                readonly_changed_cb(zfsvfs, B_TRUE);
-               if (error = dsl_prop_get_integer(osname, "xattr", &pval, NULL))
+               if ((error = dsl_prop_get_integer(osname,"xattr",&pval,NULL)))
                        goto out;
                xattr_changed_cb(zfsvfs, pval);
                zfsvfs->z_issnap = B_TRUE;
@@ -1562,7 +1567,7 @@ zfs_mount(vfs_t *vfsp, vnode_t *mvp, struct mounta *uap, cred_t *cr)
        /*
         * Get the objset name (the "special" mount argument).
         */
-       if (error = pn_get(uap->spec, fromspace, &spn))
+       if ((error = pn_get(uap->spec, fromspace, &spn)))
                return (error);
 
        osname = spn.pn_path;
@@ -1965,7 +1970,7 @@ zfs_vget(vfs_t *vfsp, vnode_t **vpp, fid_t *fidp)
        gen_mask = -1ULL >> (64 - 8 * i);
 
        dprintf("getting %llu [%u mask %llx]\n", object, fid_gen, gen_mask);
-       if (err = zfs_zget(zfsvfs, object, &zp)) {
+       if ((err = zfs_zget(zfsvfs, object, &zp))) {
                ZFS_EXIT(zfsvfs);
                return (err);
        }
@@ -2127,10 +2132,12 @@ zfs_vfsinit(int fstype, char *name)
 
        return (0);
 }
+#endif /* HAVE_ZPL */
 
 void
 zfs_init(void)
 {
+#ifdef HAVE_ZPL
        /*
         * Initialize .zfs directory structures
         */
@@ -2140,6 +2147,7 @@ zfs_init(void)
         * Initialize znode cache, vnode ops, etc...
         */
        zfs_znode_init();
+#endif /* HAVE_ZPL */
 
        dmu_objset_register_type(DMU_OST_ZFS, zfs_space_delta_cb);
 }
@@ -2147,16 +2155,13 @@ zfs_init(void)
 void
 zfs_fini(void)
 {
+#ifdef HAVE_ZPL
        zfsctl_fini();
        zfs_znode_fini();
+#endif /* HAVE_ZPL */
 }
 
-int
-zfs_busy(void)
-{
-       return (zfs_active_fs_count != 0);
-}
-
+#ifdef HAVE_ZPL
 int
 zfs_set_version(zfsvfs_t *zfsvfs, uint64_t newvers)
 {
@@ -2224,6 +2229,7 @@ zfs_set_version(zfsvfs_t *zfsvfs, uint64_t newvers)
 
        return (0);
 }
+#endif /* HAVE_ZPL */
 
 /*
  * Read a property stored within the master node.
@@ -2267,6 +2273,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,
@@ -2279,3 +2286,4 @@ static vfsdef_t vfw = {
 struct modlfs zfs_modlfs = {
        &mod_fsops, "ZFS filesystem version " SPA_VERSION_STRING, &vfw
 };
+#endif /* HAVE_ZPL */