Changeset View
Changeset View
Standalone View
Standalone View
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Show First 20 Lines • Show All 462 Lines • ▼ Show 20 Lines | if (vfs_optionisset(vfsp, MNTOPT_NOATIME, NULL)) { | ||||
atime = B_FALSE; | atime = B_FALSE; | ||||
do_atime = B_TRUE; | do_atime = B_TRUE; | ||||
} else if (vfs_optionisset(vfsp, MNTOPT_ATIME, NULL)) { | } else if (vfs_optionisset(vfsp, MNTOPT_ATIME, NULL)) { | ||||
atime = B_TRUE; | atime = B_TRUE; | ||||
do_atime = B_TRUE; | do_atime = B_TRUE; | ||||
} | } | ||||
/* | /* | ||||
* We need to enter pool configuration here, so that we can use | |||||
* dsl_prop_get_int_ds() to handle the special nbmand property below. | |||||
* dsl_prop_get_integer() can not be used, because it has to acquire | |||||
* spa_namespace_lock and we can not do that because we already hold | |||||
* z_teardown_lock. The problem is that spa_config_sync() is called | |||||
* with spa_namespace_lock held and the function calls ZFS vnode | |||||
* operations to write the cache file and thus z_teardown_lock is | |||||
* acquired after spa_namespace_lock. | |||||
*/ | |||||
ds = dmu_objset_ds(os); | |||||
dsl_pool_config_enter(dmu_objset_pool(os), FTAG); | |||||
/* | |||||
* nbmand is a special property. It can only be changed at | * nbmand is a special property. It can only be changed at | ||||
* mount time. | * mount time. | ||||
* | * | ||||
* This is weird, but it is documented to only be changeable | * This is weird, but it is documented to only be changeable | ||||
* at mount time. | * at mount time. | ||||
*/ | */ | ||||
if (vfs_optionisset(vfsp, MNTOPT_NONBMAND, NULL)) { | if (vfs_optionisset(vfsp, MNTOPT_NONBMAND, NULL)) { | ||||
nbmand = B_FALSE; | nbmand = B_FALSE; | ||||
} else if (vfs_optionisset(vfsp, MNTOPT_NBMAND, NULL)) { | } else if (vfs_optionisset(vfsp, MNTOPT_NBMAND, NULL)) { | ||||
nbmand = B_TRUE; | nbmand = B_TRUE; | ||||
} else { | } else if (error = dsl_prop_get_int_ds(ds, "nbmand", &nbmand) != 0) { | ||||
char osname[MAXNAMELEN]; | dsl_pool_config_exit(dmu_objset_pool(os), FTAG); | ||||
dmu_objset_name(os, osname); | |||||
if (error = dsl_prop_get_integer(osname, "nbmand", &nbmand, | |||||
NULL)) { | |||||
return (error); | return (error); | ||||
} | } | ||||
} | |||||
/* | /* | ||||
* Register property callbacks. | * Register property callbacks. | ||||
* | * | ||||
* It would probably be fine to just check for i/o error from | * It would probably be fine to just check for i/o error from | ||||
* the first prop_register(), but I guess I like to go | * the first prop_register(), but I guess I like to go | ||||
* overboard... | * overboard... | ||||
*/ | */ | ||||
ds = dmu_objset_ds(os); | |||||
dsl_pool_config_enter(dmu_objset_pool(os), FTAG); | |||||
error = dsl_prop_register(ds, | error = dsl_prop_register(ds, | ||||
zfs_prop_to_name(ZFS_PROP_ATIME), atime_changed_cb, zfsvfs); | zfs_prop_to_name(ZFS_PROP_ATIME), atime_changed_cb, zfsvfs); | ||||
error = error ? error : dsl_prop_register(ds, | error = error ? error : dsl_prop_register(ds, | ||||
zfs_prop_to_name(ZFS_PROP_XATTR), xattr_changed_cb, zfsvfs); | zfs_prop_to_name(ZFS_PROP_XATTR), xattr_changed_cb, zfsvfs); | ||||
error = error ? error : dsl_prop_register(ds, | error = error ? error : dsl_prop_register(ds, | ||||
zfs_prop_to_name(ZFS_PROP_RECORDSIZE), blksz_changed_cb, zfsvfs); | zfs_prop_to_name(ZFS_PROP_RECORDSIZE), blksz_changed_cb, zfsvfs); | ||||
error = error ? error : dsl_prop_register(ds, | error = error ? error : dsl_prop_register(ds, | ||||
zfs_prop_to_name(ZFS_PROP_READONLY), readonly_changed_cb, zfsvfs); | zfs_prop_to_name(ZFS_PROP_READONLY), readonly_changed_cb, zfsvfs); | ||||
▲ Show 20 Lines • Show All 2,083 Lines • Show Last 20 Lines |