extern int sys_shutdown;
static int zfs_mount(vfs_t *vfsp, vnode_t *mvp, struct mounta *uap, cred_t *cr);
-static int zfs_umount(vfs_t *vfsp, int fflag, cred_t *cr);
static int zfs_mountroot(vfs_t *vfsp, enum whymountroot);
-static int zfs_root(vfs_t *vfsp, vnode_t **vpp);
-static int zfs_statvfs(vfs_t *vfsp, struct statvfs64 *statp);
-static int zfs_vget(vfs_t *vfsp, vnode_t **vpp, fid_t *fidp);
static void zfs_freevfs(vfs_t *vfsp);
static const fs_operation_def_t zfs_vfsops_template[] = {
return (0);
}
+EXPORT_SYMBOL(zfs_sync);
static int
zfs_create_unique_device(dev_t *dev)
zfsvfs->z_acl_inherit = newval;
}
-static int
+int
zfs_register_callbacks(vfs_t *vfsp)
{
struct dsl_dataset *ds = NULL;
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);
}
}
return (error);
}
+EXPORT_SYMBOL(zfs_register_callbacks);
#endif /* HAVE_ZPL */
static int
return (zfsvfs->z_userquota_obj);
case ZFS_PROP_GROUPQUOTA:
return (zfsvfs->z_groupquota_obj);
+ default:
+ return (ENOTSUP);
}
return (0);
}
zap_cursor_fini(&zc);
return (error);
}
+EXPORT_SYMBOL(zfs_userspace_many);
/*
* buf must be big enough (eg, 32 bytes)
err = 0;
return (err);
}
+EXPORT_SYMBOL(zfs_userspace_one);
int
zfs_set_userquota(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type,
dmu_tx_commit(tx);
return (err);
}
+EXPORT_SYMBOL(zfs_set_userquota);
boolean_t
zfs_fuid_overquota(zfsvfs_t *zfsvfs, boolean_t isgroup, uint64_t fuid)
return (B_FALSE);
return (used >= quota);
}
+EXPORT_SYMBOL(zfs_fuid_overquota);
boolean_t
zfs_owner_overquota(zfsvfs_t *zfsvfs, znode_t *zp, boolean_t isgroup)
return (zfs_fuid_overquota(zfsvfs, isgroup, fuid));
}
+EXPORT_SYMBOL(zfs_owner_overquota);
int
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)));
zfsvfs->z_use_sa = USE_SA(zfsvfs->z_version, zfsvfs->z_os);
}
-static int
+int
zfs_domount(vfs_t *vfsp, char *osname)
{
dev_t mount_dev;
}
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;
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;
return (error);
}
+EXPORT_SYMBOL(zfs_domount);
void
zfs_unregister_callbacks(zfsvfs_t *zfsvfs)
vscan_changed_cb, zfsvfs) == 0);
}
}
+EXPORT_SYMBOL(zfs_unregister_callbacks);
-/*
- * Convert a decimal digit string to a uint64_t integer.
- */
-static int
-str_to_uint64(char *str, uint64_t *objnum)
-{
- uint64_t num = 0;
-
- while (*str) {
- if (*str < '0' || *str > '9')
- return (EINVAL);
-
- num = num*10 + *str++ - '0';
- }
-
- *objnum = num;
- return (0);
-}
-
-/*
- * The boot path passed from the boot loader is in the form of
- * "rootpool-name/root-filesystem-object-number'. Convert this
- * string to a dataset name: "rootpool-name/root-filesystem-name".
- */
-static int
-zfs_parse_bootfs(char *bpath, char *outpath)
-{
- char *slashp;
- uint64_t objnum;
- int error;
-
- if (*bpath == 0 || *bpath == '/')
- return (EINVAL);
-
- (void) strcpy(outpath, bpath);
-
- slashp = strchr(bpath, '/');
-
- /* if no '/', just return the pool name */
- if (slashp == NULL) {
- return (0);
- }
-
- /* if not a number, just return the root dataset name */
- if (str_to_uint64(slashp+1, &objnum)) {
- return (0);
- }
-
- *slashp = '\0';
- error = dsl_dsobj_to_dsname(bpath, objnum, outpath);
- *slashp = '/';
-
- return (error);
-}
-
+#ifdef HAVE_MLSLABEL
/*
* zfs_check_global_label:
* Check that the hex label string is appropriate for the dataset
}
return (EACCES);
}
+#endif /* HAVE_MLSLABEL */
/*
* zfs_mount_label_policy:
/*
* 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;
return (error);
}
-static int
+int
zfs_statvfs(vfs_t *vfsp, struct statvfs64 *statp)
{
zfsvfs_t *zfsvfs = vfsp->vfs_data;
ZFS_EXIT(zfsvfs);
return (0);
}
+EXPORT_SYMBOL(zfs_statvfs);
-static int
+int
zfs_root(vfs_t *vfsp, vnode_t **vpp)
{
zfsvfs_t *zfsvfs = vfsp->vfs_data;
ZFS_EXIT(zfsvfs);
return (error);
}
+EXPORT_SYMBOL(zfs_root);
/*
* Teardown the zfsvfs::z_os.
}
/*ARGSUSED*/
-static int
+int
zfs_umount(vfs_t *vfsp, int fflag, cred_t *cr)
{
zfsvfs_t *zfsvfs = vfsp->vfs_data;
return (0);
}
+EXPORT_SYMBOL(zfs_umount);
-static int
+int
zfs_vget(vfs_t *vfsp, vnode_t **vpp, fid_t *fidp)
{
zfsvfs_t *zfsvfs = vfsp->vfs_data;
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);
}
ZFS_EXIT(zfsvfs);
return (0);
}
+EXPORT_SYMBOL(zfs_vget);
/*
* Block out VOPs and close zfsvfs_t::z_os
return (0);
}
+EXPORT_SYMBOL(zfs_suspend_fs);
/*
* Reopen zfsvfs_t::z_os and release VOPs.
}
return (err);
}
+EXPORT_SYMBOL(zfs_resume_fs);
static void
zfs_freevfs(vfs_t *vfsp)
return (0);
}
+EXPORT_SYMBOL(zfs_set_version);
#endif /* HAVE_ZPL */
/*