X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fzfs_vfsops.c;h=ef433125a1ec6042610589f59cfe7227b9d1400d;hb=a405c8a665bf7d96880c97bcb783cf84d04e3e76;hp=30bbcccb4d259936f7e824b0291e84591abd1530;hpb=149e873ab174ded1f632f2b2eb2267593517c7ca;p=zfs.git diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c index 30bbccc..ef43312 100644 --- a/module/zfs/zfs_vfsops.c +++ b/module/zfs/zfs_vfsops.c @@ -75,11 +75,7 @@ static kmutex_t zfs_dev_mtx; 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[] = { @@ -181,6 +177,7 @@ zfs_sync(vfs_t *vfsp, short flag, cred_t *cr) return (0); } +EXPORT_SYMBOL(zfs_sync); static int zfs_create_unique_device(dev_t *dev) @@ -392,7 +389,7 @@ acl_inherit_changed_cb(void *arg, uint64_t newval) zfsvfs->z_acl_inherit = newval; } -static int +int zfs_register_callbacks(vfs_t *vfsp) { struct dsl_dataset *ds = NULL; @@ -561,6 +558,7 @@ unregister: return (error); } +EXPORT_SYMBOL(zfs_register_callbacks); #endif /* HAVE_ZPL */ static int @@ -689,6 +687,7 @@ zfs_userspace_many(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type, zap_cursor_fini(&zc); return (error); } +EXPORT_SYMBOL(zfs_userspace_many); /* * buf must be big enough (eg, 32 bytes) @@ -736,6 +735,7 @@ zfs_userspace_one(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type, err = 0; return (err); } +EXPORT_SYMBOL(zfs_userspace_one); int zfs_set_userquota(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type, @@ -797,6 +797,7 @@ 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) @@ -821,6 +822,7 @@ 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) @@ -837,6 +839,7 @@ 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) @@ -1102,7 +1105,7 @@ zfs_set_fuid_feature(zfsvfs_t *zfsvfs) 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; @@ -1196,6 +1199,7 @@ out: return (error); } +EXPORT_SYMBOL(zfs_domount); void zfs_unregister_callbacks(zfsvfs_t *zfsvfs) @@ -1239,62 +1243,9 @@ 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 @@ -1322,6 +1273,7 @@ zfs_check_global_label(const char *dsname, const char *hexsl) } return (EACCES); } +#endif /* HAVE_MLSLABEL */ /* * zfs_mount_label_policy: @@ -1643,7 +1595,7 @@ out: return (error); } -static int +int zfs_statvfs(vfs_t *vfsp, struct statvfs64 *statp) { zfsvfs_t *zfsvfs = vfsp->vfs_data; @@ -1706,8 +1658,9 @@ zfs_statvfs(vfs_t *vfsp, struct statvfs64 *statp) 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; @@ -1723,6 +1676,7 @@ zfs_root(vfs_t *vfsp, vnode_t **vpp) ZFS_EXIT(zfsvfs); return (error); } +EXPORT_SYMBOL(zfs_root); /* * Teardown the zfsvfs::z_os. @@ -1821,7 +1775,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolean_t unmounting) } /*ARGSUSED*/ -static int +int zfs_umount(vfs_t *vfsp, int fflag, cred_t *cr) { zfsvfs_t *zfsvfs = vfsp->vfs_data; @@ -1904,8 +1858,9 @@ zfs_umount(vfs_t *vfsp, int fflag, cred_t *cr) 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; @@ -1990,6 +1945,7 @@ zfs_vget(vfs_t *vfsp, vnode_t **vpp, fid_t *fidp) ZFS_EXIT(zfsvfs); return (0); } +EXPORT_SYMBOL(zfs_vget); /* * Block out VOPs and close zfsvfs_t::z_os @@ -2008,6 +1964,7 @@ zfs_suspend_fs(zfsvfs_t *zfsvfs) return (0); } +EXPORT_SYMBOL(zfs_suspend_fs); /* * Reopen zfsvfs_t::z_os and release VOPs. @@ -2071,6 +2028,7 @@ bail: } return (err); } +EXPORT_SYMBOL(zfs_resume_fs); static void zfs_freevfs(vfs_t *vfsp) @@ -2229,6 +2187,7 @@ zfs_set_version(zfsvfs_t *zfsvfs, uint64_t newvers) return (0); } +EXPORT_SYMBOL(zfs_set_version); #endif /* HAVE_ZPL */ /*