Rename zfs_* functions

Several functions were renamed when ZFS was originally ported to
Linux.  Revert the code to the original names to minimize the
delta with upstream OpenZFS.

  zfs_sb_teardown -> zfsvfs_teardown
  zfs_sb_create -> zfsvfs_create
  zfs_sb_setup -> zfsvfs_setup
  zfs_sb_free -> zfsvfs_free
  get_zfs_sb -> getzfsvfs
  zfs_sb_hold -> zfsvfs_hold
  zfs_sb_rele -> zfsvfs_rele

  zfs_sb_prune_aliases  -> zfs_prune_aliases (Linux-only)
  zfs_sb_prune -> zfs_prune (Linux only)

Align the zfs_vnops.h and zfs_vfsops.h with upstream as much
as possible.  Several prototypes were removed and those that
remain were reordered.

Move the EXPORT_SYMBOL lines to the end of the source files
for consistency with the other source files.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Brian Behlendorf 2017-03-08 17:56:19 -05:00
parent 0037b49e83
commit f298b24ddf
7 changed files with 93 additions and 105 deletions

View File

@ -2602,7 +2602,7 @@ ztest_zil_remount(ztest_ds_t *zd, uint64_t id)
mutex_enter(&zd->zd_dirobj_lock); mutex_enter(&zd->zd_dirobj_lock);
(void) rw_wrlock(&zd->zd_zilog_lock); (void) rw_wrlock(&zd->zd_zilog_lock);
/* zfs_sb_teardown() */ /* zfsvfs_teardown() */
zil_close(zd->zd_zilog); zil_close(zd->zd_zilog);
/* zfsvfs_setup() */ /* zfsvfs_setup() */

View File

@ -193,29 +193,21 @@ extern boolean_t zfs_fuid_overquota(zfsvfs_t *zfsvfs, boolean_t isgroup,
extern boolean_t zfs_fuid_overobjquota(zfsvfs_t *zfsvfs, boolean_t isgroup, extern boolean_t zfs_fuid_overobjquota(zfsvfs_t *zfsvfs, boolean_t isgroup,
uint64_t fuid); uint64_t fuid);
extern int zfs_set_version(zfsvfs_t *zfsvfs, uint64_t newvers); extern int zfs_set_version(zfsvfs_t *zfsvfs, uint64_t newvers);
extern int zfs_get_zplprop(objset_t *os, zfs_prop_t prop, extern int zfsvfs_create(const char *name, zfs_mntopts_t *zmo, zfsvfs_t **zfvp);
uint64_t *value); extern void zfsvfs_free(zfsvfs_t *zfsvfs);
extern int zfs_check_global_label(const char *dsname, const char *hexsl);
extern boolean_t zfs_is_readonly(zfsvfs_t *zfsvfs);
extern zfs_mntopts_t *zfs_mntopts_alloc(void); extern zfs_mntopts_t *zfs_mntopts_alloc(void);
extern void zfs_mntopts_free(zfs_mntopts_t *zmo); extern void zfs_mntopts_free(zfs_mntopts_t *zmo);
extern int zfs_sb_create(const char *name, zfs_mntopts_t *zmo,
zfsvfs_t **zfvp);
extern int zfs_sb_setup(zfsvfs_t *zfsvfs, boolean_t mounting);
extern void zfs_sb_free(zfsvfs_t *zfsvfs);
extern int zfs_sb_prune(struct super_block *sb, unsigned long nr_to_scan,
int *objects);
extern int zfs_sb_teardown(zfsvfs_t *zfsvfs, boolean_t unmounting);
extern int zfs_check_global_label(const char *dsname, const char *hexsl);
extern boolean_t zfs_is_readonly(zfsvfs_t *zfsvfs);
extern int zfs_register_callbacks(zfsvfs_t *zfsvfs);
extern void zfs_unregister_callbacks(zfsvfs_t *zfsvfs);
extern int zfs_domount(struct super_block *sb, zfs_mntopts_t *zmo, int silent); extern int zfs_domount(struct super_block *sb, zfs_mntopts_t *zmo, int silent);
extern void zfs_preumount(struct super_block *sb); extern void zfs_preumount(struct super_block *sb);
extern int zfs_umount(struct super_block *sb); extern int zfs_umount(struct super_block *sb);
extern int zfs_remount(struct super_block *sb, int *flags, zfs_mntopts_t *zmo); extern int zfs_remount(struct super_block *sb, int *flags, zfs_mntopts_t *zmo);
extern int zfs_root(zfsvfs_t *zfsvfs, struct inode **ipp);
extern int zfs_statvfs(struct dentry *dentry, struct kstatfs *statp); extern int zfs_statvfs(struct dentry *dentry, struct kstatfs *statp);
extern int zfs_vget(struct super_block *sb, struct inode **ipp, fid_t *fidp); extern int zfs_vget(struct super_block *sb, struct inode **ipp, fid_t *fidp);
extern int zfs_prune(struct super_block *sb, unsigned long nr_to_scan,
int *objects);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -63,7 +63,6 @@ extern int zfs_rename(struct inode *sdip, char *snm, struct inode *tdip,
char *tnm, cred_t *cr, int flags); char *tnm, cred_t *cr, int flags);
extern int zfs_symlink(struct inode *dip, char *name, vattr_t *vap, extern int zfs_symlink(struct inode *dip, char *name, vattr_t *vap,
char *link, struct inode **ipp, cred_t *cr, int flags); char *link, struct inode **ipp, cred_t *cr, int flags);
extern int zfs_follow_link(struct dentry *dentry, struct nameidata *nd);
extern int zfs_readlink(struct inode *ip, uio_t *uio, cred_t *cr); extern int zfs_readlink(struct inode *ip, uio_t *uio, cred_t *cr);
extern int zfs_link(struct inode *tdip, struct inode *sip, extern int zfs_link(struct inode *tdip, struct inode *sip,
char *name, cred_t *cr, int flags); char *name, cred_t *cr, int flags);

View File

@ -1394,7 +1394,7 @@ put_nvlist(zfs_cmd_t *zc, nvlist_t *nvl)
} }
static int static int
get_zfs_sb(const char *dsname, zfsvfs_t **zfvp) getzfsvfs(const char *dsname, zfsvfs_t **zfvp)
{ {
objset_t *os; objset_t *os;
int error; int error;
@ -1426,12 +1426,12 @@ get_zfs_sb(const char *dsname, zfsvfs_t **zfvp)
* which prevents all inode ops from running. * which prevents all inode ops from running.
*/ */
static int static int
zfs_sb_hold(const char *name, void *tag, zfsvfs_t **zfvp, boolean_t writer) zfsvfs_hold(const char *name, void *tag, zfsvfs_t **zfvp, boolean_t writer)
{ {
int error = 0; int error = 0;
if (get_zfs_sb(name, zfvp) != 0) if (getzfsvfs(name, zfvp) != 0)
error = zfs_sb_create(name, NULL, zfvp); error = zfsvfs_create(name, NULL, zfvp);
if (error == 0) { if (error == 0) {
rrm_enter(&(*zfvp)->z_teardown_lock, (writer) ? RW_WRITER : rrm_enter(&(*zfvp)->z_teardown_lock, (writer) ? RW_WRITER :
RW_READER, tag); RW_READER, tag);
@ -1449,7 +1449,7 @@ zfs_sb_hold(const char *name, void *tag, zfsvfs_t **zfvp, boolean_t writer)
} }
static void static void
zfs_sb_rele(zfsvfs_t *zfsvfs, void *tag) zfsvfs_rele(zfsvfs_t *zfsvfs, void *tag)
{ {
rrm_exit(&zfsvfs->z_teardown_lock, tag); rrm_exit(&zfsvfs->z_teardown_lock, tag);
@ -1457,7 +1457,7 @@ zfs_sb_rele(zfsvfs_t *zfsvfs, void *tag)
deactivate_super(zfsvfs->z_sb); deactivate_super(zfsvfs->z_sb);
} else { } else {
dmu_objset_disown(zfsvfs->z_os, zfsvfs); dmu_objset_disown(zfsvfs->z_os, zfsvfs);
zfs_sb_free(zfsvfs); zfsvfs_free(zfsvfs);
} }
} }
@ -2349,10 +2349,10 @@ zfs_prop_set_userquota(const char *dsname, nvpair_t *pair)
rid = valary[1]; rid = valary[1];
quota = valary[2]; quota = valary[2];
err = zfs_sb_hold(dsname, FTAG, &zfsvfs, B_FALSE); err = zfsvfs_hold(dsname, FTAG, &zfsvfs, B_FALSE);
if (err == 0) { if (err == 0) {
err = zfs_set_userquota(zfsvfs, type, domain, rid, quota); err = zfs_set_userquota(zfsvfs, type, domain, rid, quota);
zfs_sb_rele(zfsvfs, FTAG); zfsvfs_rele(zfsvfs, FTAG);
} }
return (err); return (err);
@ -2431,11 +2431,11 @@ zfs_prop_set_special(const char *dsname, zprop_source_t source,
{ {
zfsvfs_t *zfsvfs; zfsvfs_t *zfsvfs;
if ((err = zfs_sb_hold(dsname, FTAG, &zfsvfs, B_TRUE)) != 0) if ((err = zfsvfs_hold(dsname, FTAG, &zfsvfs, B_TRUE)) != 0)
break; break;
err = zfs_set_version(zfsvfs, intval); err = zfs_set_version(zfsvfs, intval);
zfs_sb_rele(zfsvfs, FTAG); zfsvfs_rele(zfsvfs, FTAG);
if (err == 0 && intval >= ZPL_VERSION_USERSPACE) { if (err == 0 && intval >= ZPL_VERSION_USERSPACE) {
zfs_cmd_t *zc; zfs_cmd_t *zc;
@ -3644,7 +3644,7 @@ zfs_ioc_rollback(const char *fsname, nvlist_t *args, nvlist_t *outnvl)
zvol_state_t *zv; zvol_state_t *zv;
int error; int error;
if (get_zfs_sb(fsname, &zfsvfs) == 0) { if (getzfsvfs(fsname, &zfsvfs) == 0) {
dsl_dataset_t *ds; dsl_dataset_t *ds;
ds = dmu_objset_ds(zfsvfs->z_os); ds = dmu_objset_ds(zfsvfs->z_os);
@ -4249,7 +4249,7 @@ zfs_ioc_recv_impl(char *tofs, char *tosnap, char *origin,
zfsvfs_t *zfsvfs = NULL; zfsvfs_t *zfsvfs = NULL;
zvol_state_t *zv = NULL; zvol_state_t *zv = NULL;
if (get_zfs_sb(tofs, &zfsvfs) == 0) { if (getzfsvfs(tofs, &zfsvfs) == 0) {
/* online recv */ /* online recv */
dsl_dataset_t *ds; dsl_dataset_t *ds;
int end_err; int end_err;
@ -4875,13 +4875,13 @@ zfs_ioc_userspace_one(zfs_cmd_t *zc)
if (zc->zc_objset_type >= ZFS_NUM_USERQUOTA_PROPS) if (zc->zc_objset_type >= ZFS_NUM_USERQUOTA_PROPS)
return (SET_ERROR(EINVAL)); return (SET_ERROR(EINVAL));
error = zfs_sb_hold(zc->zc_name, FTAG, &zfsvfs, B_FALSE); error = zfsvfs_hold(zc->zc_name, FTAG, &zfsvfs, B_FALSE);
if (error != 0) if (error != 0)
return (error); return (error);
error = zfs_userspace_one(zfsvfs, error = zfs_userspace_one(zfsvfs,
zc->zc_objset_type, zc->zc_value, zc->zc_guid, &zc->zc_cookie); zc->zc_objset_type, zc->zc_value, zc->zc_guid, &zc->zc_cookie);
zfs_sb_rele(zfsvfs, FTAG); zfsvfs_rele(zfsvfs, FTAG);
return (error); return (error);
} }
@ -4908,7 +4908,7 @@ zfs_ioc_userspace_many(zfs_cmd_t *zc)
if (bufsize <= 0) if (bufsize <= 0)
return (SET_ERROR(ENOMEM)); return (SET_ERROR(ENOMEM));
error = zfs_sb_hold(zc->zc_name, FTAG, &zfsvfs, B_FALSE); error = zfsvfs_hold(zc->zc_name, FTAG, &zfsvfs, B_FALSE);
if (error != 0) if (error != 0)
return (error); return (error);
@ -4923,7 +4923,7 @@ zfs_ioc_userspace_many(zfs_cmd_t *zc)
zc->zc_nvlist_dst_size); zc->zc_nvlist_dst_size);
} }
vmem_free(buf, bufsize); vmem_free(buf, bufsize);
zfs_sb_rele(zfsvfs, FTAG); zfsvfs_rele(zfsvfs, FTAG);
return (error); return (error);
} }
@ -4942,7 +4942,7 @@ zfs_ioc_userspace_upgrade(zfs_cmd_t *zc)
int error = 0; int error = 0;
zfsvfs_t *zfsvfs; zfsvfs_t *zfsvfs;
if (get_zfs_sb(zc->zc_name, &zfsvfs) == 0) { if (getzfsvfs(zc->zc_name, &zfsvfs) == 0) {
if (!dmu_objset_userused_enabled(zfsvfs->z_os)) { if (!dmu_objset_userused_enabled(zfsvfs->z_os)) {
/* /*
* If userused is not enabled, it may be because the * If userused is not enabled, it may be because the

View File

@ -121,14 +121,12 @@ zfs_sync(struct super_block *sb, int wait, cred_t *cr)
return (0); return (0);
} }
EXPORT_SYMBOL(zfs_sync);
boolean_t boolean_t
zfs_is_readonly(zfsvfs_t *zfsvfs) zfs_is_readonly(zfsvfs_t *zfsvfs)
{ {
return (!!(zfsvfs->z_sb->s_flags & MS_RDONLY)); return (!!(zfsvfs->z_sb->s_flags & MS_RDONLY));
} }
EXPORT_SYMBOL(zfs_is_readonly);
static void static void
atime_changed_cb(void *arg, uint64_t newval) atime_changed_cb(void *arg, uint64_t newval)
@ -345,7 +343,6 @@ unregister:
dsl_prop_unregister_all(ds, zfsvfs); dsl_prop_unregister_all(ds, zfsvfs);
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_register_callbacks);
static int static int
zfs_space_delta_cb(dmu_object_type_t bonustype, void *data, zfs_space_delta_cb(dmu_object_type_t bonustype, void *data,
@ -508,7 +505,6 @@ zfs_userspace_many(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type,
zap_cursor_fini(&zc); zap_cursor_fini(&zc);
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_userspace_many);
/* /*
* buf must be big enough (eg, 32 bytes) * buf must be big enough (eg, 32 bytes)
@ -567,7 +563,6 @@ zfs_userspace_one(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type,
err = 0; err = 0;
return (err); return (err);
} }
EXPORT_SYMBOL(zfs_userspace_one);
int int
zfs_set_userquota(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type, zfs_set_userquota(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type,
@ -640,7 +635,6 @@ zfs_set_userquota(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type,
dmu_tx_commit(tx); dmu_tx_commit(tx);
return (err); return (err);
} }
EXPORT_SYMBOL(zfs_set_userquota);
boolean_t boolean_t
zfs_fuid_overobjquota(zfsvfs_t *zfsvfs, boolean_t isgroup, uint64_t fuid) zfs_fuid_overobjquota(zfsvfs_t *zfsvfs, boolean_t isgroup, uint64_t fuid)
@ -696,7 +690,6 @@ zfs_fuid_overquota(zfsvfs_t *zfsvfs, boolean_t isgroup, uint64_t fuid)
return (B_FALSE); return (B_FALSE);
return (used >= quota); return (used >= quota);
} }
EXPORT_SYMBOL(zfs_fuid_overquota);
boolean_t boolean_t
zfs_owner_overquota(zfsvfs_t *zfsvfs, znode_t *zp, boolean_t isgroup) zfs_owner_overquota(zfsvfs_t *zfsvfs, znode_t *zp, boolean_t isgroup)
@ -714,7 +707,6 @@ zfs_owner_overquota(zfsvfs_t *zfsvfs, znode_t *zp, boolean_t isgroup)
return (zfs_fuid_overquota(zfsvfs, isgroup, fuid)); return (zfs_fuid_overquota(zfsvfs, isgroup, fuid));
} }
EXPORT_SYMBOL(zfs_owner_overquota);
zfs_mntopts_t * zfs_mntopts_t *
zfs_mntopts_alloc(void) zfs_mntopts_alloc(void)
@ -735,7 +727,7 @@ zfs_mntopts_free(zfs_mntopts_t *zmo)
} }
int int
zfs_sb_create(const char *osname, zfs_mntopts_t *zmo, zfsvfs_t **zfvp) zfsvfs_create(const char *osname, zfs_mntopts_t *zmo, zfsvfs_t **zfvp)
{ {
objset_t *os; objset_t *os;
zfsvfs_t *zfsvfs; zfsvfs_t *zfsvfs;
@ -746,7 +738,7 @@ zfs_sb_create(const char *osname, zfs_mntopts_t *zmo, zfsvfs_t **zfvp)
zfsvfs = kmem_zalloc(sizeof (zfsvfs_t), KM_SLEEP); zfsvfs = kmem_zalloc(sizeof (zfsvfs_t), KM_SLEEP);
/* /*
* Optional temporary mount options, free'd in zfs_sb_free(). * Optional temporary mount options, free'd in zfsvfs_free().
*/ */
zfsvfs->z_mntopts = (zmo ? zmo : zfs_mntopts_alloc()); zfsvfs->z_mntopts = (zmo ? zmo : zfs_mntopts_alloc());
@ -903,10 +895,9 @@ out_zmo:
kmem_free(zfsvfs, sizeof (zfsvfs_t)); kmem_free(zfsvfs, sizeof (zfsvfs_t));
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_sb_create);
int int
zfs_sb_setup(zfsvfs_t *zfsvfs, boolean_t mounting) zfsvfs_setup(zfsvfs_t *zfsvfs, boolean_t mounting)
{ {
int error; int error;
@ -986,10 +977,9 @@ zfs_sb_setup(zfsvfs_t *zfsvfs, boolean_t mounting)
return (0); return (0);
} }
EXPORT_SYMBOL(zfs_sb_setup);
void void
zfs_sb_free(zfsvfs_t *zfsvfs) zfsvfs_free(zfsvfs_t *zfsvfs)
{ {
int i, size = zfsvfs->z_hold_size; int i, size = zfsvfs->z_hold_size;
@ -1010,7 +1000,6 @@ zfs_sb_free(zfsvfs_t *zfsvfs)
zfs_mntopts_free(zfsvfs->z_mntopts); zfs_mntopts_free(zfsvfs->z_mntopts);
kmem_free(zfsvfs, sizeof (zfsvfs_t)); kmem_free(zfsvfs, sizeof (zfsvfs_t));
} }
EXPORT_SYMBOL(zfs_sb_free);
static void static void
zfs_set_fuid_feature(zfsvfs_t *zfsvfs) zfs_set_fuid_feature(zfsvfs_t *zfsvfs)
@ -1027,7 +1016,6 @@ zfs_unregister_callbacks(zfsvfs_t *zfsvfs)
if (!dmu_objset_is_snapshot(os)) if (!dmu_objset_is_snapshot(os))
dsl_prop_unregister_all(dmu_objset_ds(os), zfsvfs); dsl_prop_unregister_all(dmu_objset_ds(os), zfsvfs);
} }
EXPORT_SYMBOL(zfs_unregister_callbacks);
#ifdef HAVE_MLSLABEL #ifdef HAVE_MLSLABEL
/* /*
@ -1056,7 +1044,6 @@ zfs_check_global_label(const char *dsname, const char *hexsl)
} }
return (SET_ERROR(EACCES)); return (SET_ERROR(EACCES));
} }
EXPORT_SYMBOL(zfs_check_global_label);
#endif /* HAVE_MLSLABEL */ #endif /* HAVE_MLSLABEL */
int int
@ -1120,7 +1107,6 @@ zfs_statvfs(struct dentry *dentry, struct kstatfs *statp)
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (0); return (0);
} }
EXPORT_SYMBOL(zfs_statvfs);
int int
zfs_root(zfsvfs_t *zfsvfs, struct inode **ipp) zfs_root(zfsvfs_t *zfsvfs, struct inode **ipp)
@ -1137,7 +1123,6 @@ zfs_root(zfsvfs_t *zfsvfs, struct inode **ipp)
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_root);
#ifdef HAVE_D_PRUNE_ALIASES #ifdef HAVE_D_PRUNE_ALIASES
/* /*
@ -1150,7 +1135,7 @@ EXPORT_SYMBOL(zfs_root);
* end of the list so we're always scanning the oldest znodes first. * end of the list so we're always scanning the oldest znodes first.
*/ */
static int static int
zfs_sb_prune_aliases(zfsvfs_t *zfsvfs, unsigned long nr_to_scan) zfs_prune_aliases(zfsvfs_t *zfsvfs, unsigned long nr_to_scan)
{ {
znode_t **zp_array, *zp; znode_t **zp_array, *zp;
int max_array = MIN(nr_to_scan, PAGE_SIZE * 8 / sizeof (znode_t *)); int max_array = MIN(nr_to_scan, PAGE_SIZE * 8 / sizeof (znode_t *));
@ -1205,7 +1190,7 @@ zfs_sb_prune_aliases(zfsvfs_t *zfsvfs, unsigned long nr_to_scan)
* blocks but can't because they are all pinned by entries in these caches. * blocks but can't because they are all pinned by entries in these caches.
*/ */
int int
zfs_sb_prune(struct super_block *sb, unsigned long nr_to_scan, int *objects) zfs_prune(struct super_block *sb, unsigned long nr_to_scan, int *objects)
{ {
zfsvfs_t *zfsvfs = sb->s_fs_info; zfsvfs_t *zfsvfs = sb->s_fs_info;
int error = 0; int error = 0;
@ -1237,7 +1222,7 @@ zfs_sb_prune(struct super_block *sb, unsigned long nr_to_scan, int *objects)
*objects = (*shrinker->shrink)(shrinker, &sc); *objects = (*shrinker->shrink)(shrinker, &sc);
#elif defined(HAVE_D_PRUNE_ALIASES) #elif defined(HAVE_D_PRUNE_ALIASES)
#define D_PRUNE_ALIASES_IS_DEFAULT #define D_PRUNE_ALIASES_IS_DEFAULT
*objects = zfs_sb_prune_aliases(zfsvfs, nr_to_scan); *objects = zfs_prune_aliases(zfsvfs, nr_to_scan);
#else #else
#error "No available dentry and inode cache pruning mechanism." #error "No available dentry and inode cache pruning mechanism."
#endif #endif
@ -1245,12 +1230,12 @@ zfs_sb_prune(struct super_block *sb, unsigned long nr_to_scan, int *objects)
#if defined(HAVE_D_PRUNE_ALIASES) && !defined(D_PRUNE_ALIASES_IS_DEFAULT) #if defined(HAVE_D_PRUNE_ALIASES) && !defined(D_PRUNE_ALIASES_IS_DEFAULT)
#undef D_PRUNE_ALIASES_IS_DEFAULT #undef D_PRUNE_ALIASES_IS_DEFAULT
/* /*
* Fall back to zfs_sb_prune_aliases if the kernel's per-superblock * Fall back to zfs_prune_aliases if the kernel's per-superblock
* shrinker couldn't free anything, possibly due to the inodes being * shrinker couldn't free anything, possibly due to the inodes being
* allocated in a different memcg. * allocated in a different memcg.
*/ */
if (*objects == 0) if (*objects == 0)
*objects = zfs_sb_prune_aliases(zfsvfs, nr_to_scan); *objects = zfs_prune_aliases(zfsvfs, nr_to_scan);
#endif #endif
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
@ -1261,7 +1246,6 @@ zfs_sb_prune(struct super_block *sb, unsigned long nr_to_scan, int *objects)
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_sb_prune);
/* /*
* Teardown the zfsvfs_t. * Teardown the zfsvfs_t.
@ -1269,7 +1253,7 @@ EXPORT_SYMBOL(zfs_sb_prune);
* Note, if 'unmounting' is FALSE, we return with the 'z_teardown_lock' * Note, if 'unmounting' is FALSE, we return with the 'z_teardown_lock'
* and 'z_teardown_inactive_lock' held. * and 'z_teardown_inactive_lock' held.
*/ */
int static int
zfsvfs_teardown(zfsvfs_t *zfsvfs, boolean_t unmounting) zfsvfs_teardown(zfsvfs_t *zfsvfs, boolean_t unmounting)
{ {
znode_t *zp; znode_t *zp;
@ -1389,7 +1373,6 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolean_t unmounting)
return (0); return (0);
} }
EXPORT_SYMBOL(zfsvfs_teardown);
#if !defined(HAVE_2ARGS_BDI_SETUP_AND_REGISTER) && \ #if !defined(HAVE_2ARGS_BDI_SETUP_AND_REGISTER) && \
!defined(HAVE_3ARGS_BDI_SETUP_AND_REGISTER) !defined(HAVE_3ARGS_BDI_SETUP_AND_REGISTER)
@ -1405,7 +1388,7 @@ zfs_domount(struct super_block *sb, zfs_mntopts_t *zmo, int silent)
uint64_t recordsize; uint64_t recordsize;
int error; int error;
error = zfs_sb_create(osname, zmo, &zfsvfs); error = zfsvfs_create(osname, zmo, &zfsvfs);
if (error) if (error)
return (error); return (error);
@ -1459,7 +1442,7 @@ zfs_domount(struct super_block *sb, zfs_mntopts_t *zmo, int silent)
dmu_objset_set_user(zfsvfs->z_os, zfsvfs); dmu_objset_set_user(zfsvfs->z_os, zfsvfs);
mutex_exit(&zfsvfs->z_os->os_user_ptr_lock); mutex_exit(&zfsvfs->z_os->os_user_ptr_lock);
} else { } else {
if ((error = zfs_sb_setup(zfsvfs, B_TRUE))) if ((error = zfsvfs_setup(zfsvfs, B_TRUE)))
goto out; goto out;
} }
@ -1485,7 +1468,7 @@ zfs_domount(struct super_block *sb, zfs_mntopts_t *zmo, int silent)
out: out:
if (error) { if (error) {
dmu_objset_disown(zfsvfs->z_os, zfsvfs); dmu_objset_disown(zfsvfs->z_os, zfsvfs);
zfs_sb_free(zfsvfs); zfsvfs_free(zfsvfs);
/* /*
* make sure we don't have dangling sb->s_fs_info which * make sure we don't have dangling sb->s_fs_info which
* zfs_preumount will use. * zfs_preumount will use.
@ -1495,7 +1478,6 @@ out:
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_domount);
/* /*
* Called when an unmount is requested and certain sanity checks have * Called when an unmount is requested and certain sanity checks have
@ -1533,7 +1515,6 @@ zfs_preumount(struct super_block *sb)
dmu_objset_pool(zfsvfs->z_os)), 0); dmu_objset_pool(zfsvfs->z_os)), 0);
} }
} }
EXPORT_SYMBOL(zfs_preumount);
/* /*
* Called once all other unmount released tear down has occurred. * Called once all other unmount released tear down has occurred.
@ -1569,10 +1550,9 @@ zfs_umount(struct super_block *sb)
dmu_objset_disown(os, zfsvfs); dmu_objset_disown(os, zfsvfs);
} }
zfs_sb_free(zfsvfs); zfsvfs_free(zfsvfs);
return (0); return (0);
} }
EXPORT_SYMBOL(zfs_umount);
int int
zfs_remount(struct super_block *sb, int *flags, zfs_mntopts_t *zmo) zfs_remount(struct super_block *sb, int *flags, zfs_mntopts_t *zmo)
@ -1585,7 +1565,6 @@ zfs_remount(struct super_block *sb, int *flags, zfs_mntopts_t *zmo)
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_remount);
int int
zfs_vget(struct super_block *sb, struct inode **ipp, fid_t *fidp) zfs_vget(struct super_block *sb, struct inode **ipp, fid_t *fidp)
@ -1694,7 +1673,6 @@ zfs_vget(struct super_block *sb, struct inode **ipp, fid_t *fidp)
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (0); return (0);
} }
EXPORT_SYMBOL(zfs_vget);
/* /*
* Block out VFS ops and close zfsvfs_t * Block out VFS ops and close zfsvfs_t
@ -1714,7 +1692,6 @@ zfs_suspend_fs(zfsvfs_t *zfsvfs)
return (0); return (0);
} }
EXPORT_SYMBOL(zfs_suspend_fs);
/* /*
* Reopen zfsvfs_t and release VFS ops. * Reopen zfsvfs_t and release VFS ops.
@ -1761,7 +1738,7 @@ zfs_resume_fs(zfsvfs_t *zfsvfs, dsl_dataset_t *ds)
sa_register_update_callback(zfsvfs->z_os, sa_register_update_callback(zfsvfs->z_os,
zfs_sa_upgrade); zfs_sa_upgrade);
VERIFY(zfs_sb_setup(zfsvfs, B_FALSE) == 0); VERIFY(zfsvfs_setup(zfsvfs, B_FALSE) == 0);
zfs_set_fuid_feature(zfsvfs); zfs_set_fuid_feature(zfsvfs);
zfsvfs->z_rollback_time = jiffies; zfsvfs->z_rollback_time = jiffies;
@ -1801,7 +1778,6 @@ bail:
} }
return (err); return (err);
} }
EXPORT_SYMBOL(zfs_resume_fs);
int int
zfs_set_version(zfsvfs_t *zfsvfs, uint64_t newvers) zfs_set_version(zfsvfs_t *zfsvfs, uint64_t newvers)
@ -1868,7 +1844,6 @@ zfs_set_version(zfsvfs_t *zfsvfs, uint64_t newvers)
return (0); return (0);
} }
EXPORT_SYMBOL(zfs_set_version);
/* /*
* Read a property stored within the master node. * Read a property stored within the master node.
@ -1914,7 +1889,6 @@ zfs_get_zplprop(objset_t *os, zfs_prop_t prop, uint64_t *value)
} }
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_get_zplprop);
/* /*
* Return true if the coresponding vfs's unmounted flag is set. * Return true if the coresponding vfs's unmounted flag is set.
@ -1959,3 +1933,25 @@ zfs_fini(void)
zfs_znode_fini(); zfs_znode_fini();
zfsctl_fini(); zfsctl_fini();
} }
#if defined(_KERNEL) && defined(HAVE_SPL)
EXPORT_SYMBOL(zfs_suspend_fs);
EXPORT_SYMBOL(zfs_resume_fs);
EXPORT_SYMBOL(zfs_userspace_one);
EXPORT_SYMBOL(zfs_userspace_many);
EXPORT_SYMBOL(zfs_set_userquota);
EXPORT_SYMBOL(zfs_owner_overquota);
EXPORT_SYMBOL(zfs_fuid_overquota);
EXPORT_SYMBOL(zfs_fuid_overobjquota);
EXPORT_SYMBOL(zfs_set_version);
EXPORT_SYMBOL(zfsvfs_create);
EXPORT_SYMBOL(zfsvfs_free);
EXPORT_SYMBOL(zfs_is_readonly);
EXPORT_SYMBOL(zfs_domount);
EXPORT_SYMBOL(zfs_preumount);
EXPORT_SYMBOL(zfs_umount);
EXPORT_SYMBOL(zfs_remount);
EXPORT_SYMBOL(zfs_statvfs);
EXPORT_SYMBOL(zfs_vget);
EXPORT_SYMBOL(zfs_prune);
#endif

View File

@ -226,7 +226,6 @@ zfs_open(struct inode *ip, int mode, int flag, cred_t *cr)
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (0); return (0);
} }
EXPORT_SYMBOL(zfs_open);
/* ARGSUSED */ /* ARGSUSED */
int int
@ -249,7 +248,6 @@ zfs_close(struct inode *ip, int flag, cred_t *cr)
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (0); return (0);
} }
EXPORT_SYMBOL(zfs_close);
#if defined(SEEK_HOLE) && defined(SEEK_DATA) #if defined(SEEK_HOLE) && defined(SEEK_DATA)
/* /*
@ -313,7 +311,6 @@ zfs_holey(struct inode *ip, int cmd, loff_t *off)
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_holey);
#endif /* SEEK_HOLE && SEEK_DATA */ #endif /* SEEK_HOLE && SEEK_DATA */
#if defined(_KERNEL) #if defined(_KERNEL)
@ -556,7 +553,6 @@ out:
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_read);
/* /*
* Write the bytes to a file. * Write the bytes to a file.
@ -938,7 +934,6 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (0); return (0);
} }
EXPORT_SYMBOL(zfs_write);
/* /*
* Drop a reference on the passed inode asynchronously. This ensures * Drop a reference on the passed inode asynchronously. This ensures
@ -1132,7 +1127,6 @@ zfs_access(struct inode *ip, int mode, int flag, cred_t *cr)
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_access);
/* /*
* Lookup an entry in a directory, or an extended attribute directory. * Lookup an entry in a directory, or an extended attribute directory.
@ -1271,7 +1265,6 @@ zfs_lookup(struct inode *dip, char *nm, struct inode **ipp, int flags,
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_lookup);
/* /*
* Attempt to create a new entry in a directory. If the entry * Attempt to create a new entry in a directory. If the entry
@ -1524,7 +1517,6 @@ out:
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_create);
/* ARGSUSED */ /* ARGSUSED */
int int
@ -1888,7 +1880,6 @@ out:
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_remove);
/* /*
* Create a new directory and insert it into dip using the name * Create a new directory and insert it into dip using the name
@ -2071,7 +2062,6 @@ top:
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (0); return (0);
} }
EXPORT_SYMBOL(zfs_mkdir);
/* /*
* Remove a directory subdir entry. If the current working * Remove a directory subdir entry. If the current working
@ -2205,7 +2195,6 @@ out:
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_rmdir);
/* /*
* Read as many directory entries as will fit into the provided * Read as many directory entries as will fit into the provided
@ -2367,7 +2356,6 @@ out:
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_readdir);
ulong_t zfs_fsync_sync_cnt = 4; ulong_t zfs_fsync_sync_cnt = 4;
@ -2389,7 +2377,6 @@ zfs_fsync(struct inode *ip, int syncflag, cred_t *cr)
return (0); return (0);
} }
EXPORT_SYMBOL(zfs_fsync);
/* /*
@ -2593,7 +2580,6 @@ zfs_getattr(struct inode *ip, vattr_t *vap, int flags, cred_t *cr)
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (0); return (0);
} }
EXPORT_SYMBOL(zfs_getattr);
/* /*
* Get the basic file attributes and place them in the provided kstat * Get the basic file attributes and place them in the provided kstat
@ -2650,7 +2636,6 @@ zfs_getattr_fast(struct inode *ip, struct kstat *sp)
return (0); return (0);
} }
EXPORT_SYMBOL(zfs_getattr_fast);
/* /*
* Set the file attributes to the values contained in the * Set the file attributes to the values contained in the
@ -3281,7 +3266,6 @@ out3:
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (err); return (err);
} }
EXPORT_SYMBOL(zfs_setattr);
typedef struct zfs_zlock { typedef struct zfs_zlock {
krwlock_t *zl_rwlock; /* lock we acquired */ krwlock_t *zl_rwlock; /* lock we acquired */
@ -3725,7 +3709,6 @@ out:
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_rename);
/* /*
* Insert the indicated symbolic reference entry into the directory. * Insert the indicated symbolic reference entry into the directory.
@ -3888,7 +3871,6 @@ top:
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_symlink);
/* /*
* Return, in the buffer contained in the provided uio structure, * Return, in the buffer contained in the provided uio structure,
@ -3926,7 +3908,6 @@ zfs_readlink(struct inode *ip, uio_t *uio, cred_t *cr)
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_readlink);
/* /*
* Insert a new entry into directory tdip referencing sip. * Insert a new entry into directory tdip referencing sip.
@ -4110,7 +4091,6 @@ top:
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_link);
static void static void
zfs_putpage_commit_cb(void *arg) zfs_putpage_commit_cb(void *arg)
@ -4378,7 +4358,6 @@ out:
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_dirty_inode);
/*ARGSUSED*/ /*ARGSUSED*/
void void
@ -4424,7 +4403,6 @@ zfs_inactive(struct inode *ip)
if (need_unlock) if (need_unlock)
rw_exit(&zfsvfs->z_teardown_inactive_lock); rw_exit(&zfsvfs->z_teardown_inactive_lock);
} }
EXPORT_SYMBOL(zfs_inactive);
/* /*
* Bounds-check the seek operation. * Bounds-check the seek operation.
@ -4445,7 +4423,6 @@ zfs_seek(struct inode *ip, offset_t ooff, offset_t *noffp)
return (0); return (0);
return ((*noffp < 0 || *noffp > MAXOFFSET_T) ? EINVAL : 0); return ((*noffp < 0 || *noffp > MAXOFFSET_T) ? EINVAL : 0);
} }
EXPORT_SYMBOL(zfs_seek);
/* /*
* Fill pages with data from the disk. * Fill pages with data from the disk.
@ -4525,7 +4502,6 @@ zfs_getpage(struct inode *ip, struct page *pl[], int nr_pages)
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (err); return (err);
} }
EXPORT_SYMBOL(zfs_getpage);
/* /*
* Check ZFS specific permissions to memory map a section of a file. * Check ZFS specific permissions to memory map a section of a file.
@ -4570,7 +4546,6 @@ zfs_map(struct inode *ip, offset_t off, caddr_t *addrp, size_t len,
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (0); return (0);
} }
EXPORT_SYMBOL(zfs_map);
/* /*
* convoff - converts the given data (start, whence) to the * convoff - converts the given data (start, whence) to the
@ -4694,7 +4669,6 @@ zfs_space(struct inode *ip, int cmd, flock64_t *bfp, int flag,
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_space);
/*ARGSUSED*/ /*ARGSUSED*/
int int
@ -4737,7 +4711,6 @@ zfs_fid(struct inode *ip, fid_t *fidp)
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (0); return (0);
} }
EXPORT_SYMBOL(zfs_fid);
/*ARGSUSED*/ /*ARGSUSED*/
int int
@ -4755,7 +4728,6 @@ zfs_getsecattr(struct inode *ip, vsecattr_t *vsecp, int flag, cred_t *cr)
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_getsecattr);
/*ARGSUSED*/ /*ARGSUSED*/
int int
@ -4778,7 +4750,6 @@ zfs_setsecattr(struct inode *ip, vsecattr_t *vsecp, int flag, cred_t *cr)
ZFS_EXIT(zfsvfs); ZFS_EXIT(zfsvfs);
return (error); return (error);
} }
EXPORT_SYMBOL(zfs_setsecattr);
#ifdef HAVE_UIO_ZEROCOPY #ifdef HAVE_UIO_ZEROCOPY
/* /*
@ -4937,6 +4908,36 @@ zfs_retzcbuf(struct inode *ip, xuio_t *xuio, cred_t *cr)
#endif /* HAVE_UIO_ZEROCOPY */ #endif /* HAVE_UIO_ZEROCOPY */
#if defined(_KERNEL) && defined(HAVE_SPL) #if defined(_KERNEL) && defined(HAVE_SPL)
EXPORT_SYMBOL(zfs_open);
EXPORT_SYMBOL(zfs_close);
EXPORT_SYMBOL(zfs_read);
EXPORT_SYMBOL(zfs_write);
EXPORT_SYMBOL(zfs_access);
EXPORT_SYMBOL(zfs_lookup);
EXPORT_SYMBOL(zfs_create);
EXPORT_SYMBOL(zfs_tmpfile);
EXPORT_SYMBOL(zfs_remove);
EXPORT_SYMBOL(zfs_mkdir);
EXPORT_SYMBOL(zfs_rmdir);
EXPORT_SYMBOL(zfs_readdir);
EXPORT_SYMBOL(zfs_fsync);
EXPORT_SYMBOL(zfs_getattr);
EXPORT_SYMBOL(zfs_getattr_fast);
EXPORT_SYMBOL(zfs_setattr);
EXPORT_SYMBOL(zfs_rename);
EXPORT_SYMBOL(zfs_symlink);
EXPORT_SYMBOL(zfs_readlink);
EXPORT_SYMBOL(zfs_link);
EXPORT_SYMBOL(zfs_inactive);
EXPORT_SYMBOL(zfs_space);
EXPORT_SYMBOL(zfs_fid);
EXPORT_SYMBOL(zfs_getsecattr);
EXPORT_SYMBOL(zfs_setsecattr);
EXPORT_SYMBOL(zfs_getpage);
EXPORT_SYMBOL(zfs_putpage);
EXPORT_SYMBOL(zfs_dirty_inode);
EXPORT_SYMBOL(zfs_map);
/* CSTYLED */ /* CSTYLED */
module_param(zfs_delete_blocks, ulong, 0644); module_param(zfs_delete_blocks, ulong, 0644);
MODULE_PARM_DESC(zfs_delete_blocks, "Delete files larger than N blocks async"); MODULE_PARM_DESC(zfs_delete_blocks, "Delete files larger than N blocks async");

View File

@ -495,7 +495,7 @@ zpl_prune_sb(int64_t nr_to_scan, void *arg)
struct super_block *sb = (struct super_block *)arg; struct super_block *sb = (struct super_block *)arg;
int objects = 0; int objects = 0;
(void) -zfs_sb_prune(sb, nr_to_scan, &objects); (void) -zfs_prune(sb, nr_to_scan, &objects);
} }
#ifdef HAVE_NR_CACHED_OBJECTS #ifdef HAVE_NR_CACHED_OBJECTS