summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/fs/zfs/zfs_vfsops.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/fs/zfs/zfs_vfsops.c')
-rw-r--r--usr/src/uts/common/fs/zfs/zfs_vfsops.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/usr/src/uts/common/fs/zfs/zfs_vfsops.c b/usr/src/uts/common/fs/zfs/zfs_vfsops.c
index 42486ea23c..108a0b45a1 100644
--- a/usr/src/uts/common/fs/zfs/zfs_vfsops.c
+++ b/usr/src/uts/common/fs/zfs/zfs_vfsops.c
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
*/
/* Portions Copyright 2010 Robert Milkowski */
@@ -600,7 +600,7 @@ zfs_space_delta_cb(dmu_object_type_t bonustype, void *data,
* Is it a valid type of object to track?
*/
if (bonustype != DMU_OT_ZNODE && bonustype != DMU_OT_SA)
- return (ENOENT);
+ return (SET_ERROR(ENOENT));
/*
* If we have a NULL data pointer
@@ -609,7 +609,7 @@ zfs_space_delta_cb(dmu_object_type_t bonustype, void *data,
* use the same ids
*/
if (data == NULL)
- return (EEXIST);
+ return (SET_ERROR(EEXIST));
if (bonustype == DMU_OT_ZNODE) {
znode_phys_t *znp = data;
@@ -699,7 +699,7 @@ zfs_userspace_many(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type,
uint64_t obj;
if (!dmu_objset_userspace_present(zfsvfs->z_os))
- return (ENOTSUP);
+ return (SET_ERROR(ENOTSUP));
obj = zfs_userquota_prop_to_obj(zfsvfs, type);
if (obj == 0) {
@@ -743,7 +743,7 @@ id_to_fuidstr(zfsvfs_t *zfsvfs, const char *domain, uid_t rid,
if (domain && domain[0]) {
domainid = zfs_fuid_find_by_domain(zfsvfs, domain, NULL, addok);
if (domainid == -1)
- return (ENOENT);
+ return (SET_ERROR(ENOENT));
}
fuid = FUID_ENCODE(domainid, rid);
(void) sprintf(buf, "%llx", (longlong_t)fuid);
@@ -761,7 +761,7 @@ zfs_userspace_one(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type,
*valp = 0;
if (!dmu_objset_userspace_present(zfsvfs->z_os))
- return (ENOTSUP);
+ return (SET_ERROR(ENOTSUP));
obj = zfs_userquota_prop_to_obj(zfsvfs, type);
if (obj == 0)
@@ -788,10 +788,10 @@ zfs_set_userquota(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type,
boolean_t fuid_dirtied;
if (type != ZFS_PROP_USERQUOTA && type != ZFS_PROP_GROUPQUOTA)
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
if (zfsvfs->z_version < ZPL_VERSION_USERSPACE)
- return (ENOTSUP);
+ return (SET_ERROR(ENOTSUP));
objp = (type == ZFS_PROP_USERQUOTA) ? &zfsvfs->z_userquota_obj :
&zfsvfs->z_groupquota_obj;
@@ -919,7 +919,7 @@ zfsvfs_create(const char *osname, zfsvfs_t **zfvp)
"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)));
- error = ENOTSUP;
+ error = SET_ERROR(ENOTSUP);
goto out;
}
if ((error = zfs_get_zplprop(os, ZFS_PROP_NORMALIZE, &zval)) != 0)
@@ -1172,7 +1172,7 @@ zfs_domount(vfs_t *vfsp, char *osname)
vfsp->vfs_data = NULL;
if (zfs_create_unique_device(&mount_dev) == -1) {
- error = ENODEV;
+ error = SET_ERROR(ENODEV);
goto out;
}
ASSERT(vfs_devismounted(mount_dev) == 0);
@@ -1302,7 +1302,7 @@ str_to_uint64(char *str, uint64_t *objnum)
while (*str) {
if (*str < '0' || *str > '9')
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
num = num*10 + *str++ - '0';
}
@@ -1324,7 +1324,7 @@ zfs_parse_bootfs(char *bpath, char *outpath)
int error;
if (*bpath == 0 || *bpath == '/')
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
(void) strcpy(outpath, bpath);
@@ -1369,10 +1369,10 @@ zfs_check_global_label(const char *dsname, const char *hexsl)
if (dsl_prop_get_integer(dsname,
zfs_prop_to_name(ZFS_PROP_READONLY), &rdonly, NULL))
- return (EACCES);
+ return (SET_ERROR(EACCES));
return (rdonly ? 0 : EACCES);
}
- return (EACCES);
+ return (SET_ERROR(EACCES));
}
/*
@@ -1404,7 +1404,7 @@ zfs_mount_label_policy(vfs_t *vfsp, char *osname)
error = dsl_prop_get(osname, zfs_prop_to_name(ZFS_PROP_MLSLABEL),
1, sizeof (ds_hexsl), &ds_hexsl, NULL);
if (error)
- return (EACCES);
+ return (SET_ERROR(EACCES));
/*
* If labeling is NOT enabled, then disallow the mount of datasets
@@ -1414,7 +1414,7 @@ zfs_mount_label_policy(vfs_t *vfsp, char *osname)
if (!is_system_labeled()) {
if (strcasecmp(ds_hexsl, ZFS_MLSLABEL_DEFAULT) == 0)
return (0);
- return (EACCES);
+ return (SET_ERROR(EACCES));
}
/*
@@ -1431,7 +1431,7 @@ zfs_mount_label_policy(vfs_t *vfsp, char *osname)
if (dsl_prop_get_integer(osname,
zfs_prop_to_name(ZFS_PROP_ZONED), &zoned, NULL))
- return (EACCES);
+ return (SET_ERROR(EACCES));
if (!zoned)
return (zfs_check_global_label(osname, ds_hexsl));
else
@@ -1501,7 +1501,7 @@ zfs_mountroot(vfs_t *vfsp, enum whymountroot why)
*/
if (why == ROOT_INIT) {
if (zfsrootdone++)
- return (EBUSY);
+ return (SET_ERROR(EBUSY));
/*
* the process of doing a spa_load will require the
* clock to be set before we could (for example) do
@@ -1513,7 +1513,7 @@ zfs_mountroot(vfs_t *vfsp, enum whymountroot why)
if ((zfs_bootfs = spa_get_bootprop("zfs-bootfs")) == NULL) {
cmn_err(CE_NOTE, "spa_get_bootfs: can not get "
"bootfs name");
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
}
zfs_devid = spa_get_bootprop("diskdevid");
error = spa_import_rootpool(rootfs.bo_name, zfs_devid);
@@ -1582,7 +1582,7 @@ out:
* if "why" is equal to anything else other than ROOT_INIT,
* ROOT_REMOUNT, or ROOT_UNMOUNT, we do not support it.
*/
- return (ENOTSUP);
+ return (SET_ERROR(ENOTSUP));
}
/*ARGSUSED*/
@@ -1597,14 +1597,14 @@ zfs_mount(vfs_t *vfsp, vnode_t *mvp, struct mounta *uap, cred_t *cr)
int canwrite;
if (mvp->v_type != VDIR)
- return (ENOTDIR);
+ return (SET_ERROR(ENOTDIR));
mutex_enter(&mvp->v_lock);
if ((uap->flags & MS_REMOUNT) == 0 &&
(uap->flags & MS_OVERLAY) == 0 &&
(mvp->v_count != 1 || (mvp->v_flag & VROOT))) {
mutex_exit(&mvp->v_lock);
- return (EBUSY);
+ return (SET_ERROR(EBUSY));
}
mutex_exit(&mvp->v_lock);
@@ -1615,7 +1615,7 @@ zfs_mount(vfs_t *vfsp, vnode_t *mvp, struct mounta *uap, cred_t *cr)
* can be interrogated.
*/
if ((uap->flags & MS_DATA) && uap->datalen > 0)
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
/*
* Get the objset name (the "special" mount argument).
@@ -1663,7 +1663,7 @@ zfs_mount(vfs_t *vfsp, vnode_t *mvp, struct mounta *uap, cred_t *cr)
*/
if (!INGLOBALZONE(curproc) &&
(!zone_dataset_visible(osname, &canwrite) || !canwrite)) {
- error = EPERM;
+ error = SET_ERROR(EPERM);
goto out;
}
@@ -1819,7 +1819,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolean_t unmounting)
if (!unmounting && (zfsvfs->z_unmounted || zfsvfs->z_os == NULL)) {
rw_exit(&zfsvfs->z_teardown_inactive_lock);
rrw_exit(&zfsvfs->z_teardown_lock, FTAG);
- return (EIO);
+ return (SET_ERROR(EIO));
}
/*
@@ -1918,11 +1918,11 @@ zfs_umount(vfs_t *vfsp, int fflag, cred_t *cr)
*/
if (zfsvfs->z_ctldir == NULL) {
if (vfsp->vfs_count > 1)
- return (EBUSY);
+ return (SET_ERROR(EBUSY));
} else {
if (vfsp->vfs_count > 2 ||
zfsvfs->z_ctldir->v_count > 1)
- return (EBUSY);
+ return (SET_ERROR(EBUSY));
}
}
@@ -1988,7 +1988,7 @@ zfs_vget(vfs_t *vfsp, vnode_t **vpp, fid_t *fidp)
err = zfsctl_lookup_objset(vfsp, objsetid, &zfsvfs);
if (err)
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
ZFS_ENTER(zfsvfs);
}
@@ -2002,7 +2002,7 @@ zfs_vget(vfs_t *vfsp, vnode_t **vpp, fid_t *fidp)
fid_gen |= ((uint64_t)zfid->zf_gen[i]) << (8 * i);
} else {
ZFS_EXIT(zfsvfs);
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
}
/* A zero fid_gen means we are in the .zfs control directories */
@@ -2036,7 +2036,7 @@ zfs_vget(vfs_t *vfsp, vnode_t **vpp, fid_t *fidp)
dprintf("znode gen (%u) != fid gen (%u)\n", zp_gen, fid_gen);
VN_RELE(ZTOV(zp));
ZFS_EXIT(zfsvfs);
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
}
*vpp = ZTOV(zp);
@@ -2237,14 +2237,14 @@ zfs_set_version(zfsvfs_t *zfsvfs, uint64_t newvers)
dmu_tx_t *tx;
if (newvers < ZPL_VERSION_INITIAL || newvers > ZPL_VERSION)
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
if (newvers < zfsvfs->z_version)
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
if (zfs_spa_version_map(newvers) >
spa_version(dmu_objset_spa(zfsvfs->z_os)))
- return (ENOTSUP);
+ return (SET_ERROR(ENOTSUP));
tx = dmu_tx_create(os);
dmu_tx_hold_zap(tx, MASTER_NODE_OBJ, B_FALSE, ZPL_VERSION_STR);