zfs_vfsops.c revision e802abbda8c322f24d47835734f4a793ef15ddc8
fa9e4066f08beec538e775443c5be79dd423fcabahrens * CDDL HEADER START
fa9e4066f08beec538e775443c5be79dd423fcabahrens * The contents of this file are subject to the terms of the
6b4acc8bd9d480535a4d057e291dc7c049f664d9ahrens * Common Development and Distribution License (the "License").
6b4acc8bd9d480535a4d057e291dc7c049f664d9ahrens * You may not use this file except in compliance with the License.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fa9e4066f08beec538e775443c5be79dd423fcabahrens * See the License for the specific language governing permissions
fa9e4066f08beec538e775443c5be79dd423fcabahrens * and limitations under the License.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * When distributing Covered Code, include this CDDL HEADER in each
fa9e4066f08beec538e775443c5be79dd423fcabahrens * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * If applicable, add the following below this CDDL HEADER, with the
fa9e4066f08beec538e775443c5be79dd423fcabahrens * fields enclosed by brackets "[]" replaced with your own identifying
fa9e4066f08beec538e775443c5be79dd423fcabahrens * information: Portions Copyright [yyyy] [name of copyright owner]
fa9e4066f08beec538e775443c5be79dd423fcabahrens * CDDL HEADER END
3f9d6ad73e45c6823b409f93b0c8d4f62861d2d5Lin Ling * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
2e4c998613148111f2fc5371085331ffb39122ffGeorge Wilson * Use is subject to license terms.
fa9e4066f08beec538e775443c5be79dd423fcabahrensstatic int zfs_mount(vfs_t *vfsp, vnode_t *mvp, struct mounta *uap, cred_t *cr);
0125049cd6136d1d2ca9e982382a915b6d7916ceahrensstatic int zfs_umount(vfs_t *vfsp, int fflag, cred_t *cr);
0125049cd6136d1d2ca9e982382a915b6d7916ceahrensstatic int zfs_mountroot(vfs_t *vfsp, enum whymountroot);
3f9d6ad73e45c6823b409f93b0c8d4f62861d2d5Lin Lingstatic int zfs_statvfs(vfs_t *vfsp, struct statvfs64 *statp);
3f9d6ad73e45c6823b409f93b0c8d4f62861d2d5Lin Lingstatic int zfs_vget(vfs_t *vfsp, vnode_t **vpp, fid_t *fidp);
3f9d6ad73e45c6823b409f93b0c8d4f62861d2d5Lin Lingstatic const fs_operation_def_t zfs_vfsops_template[] = {
3f9d6ad73e45c6823b409f93b0c8d4f62861d2d5Lin Ling VFSNAME_MOUNTROOT, { .vfs_mountroot = zfs_mountroot },
cd1c8b85eb30b568e9816221430c479ace7a559dMatthew Ahrens VFSNAME_FREEVFS, { .vfs_freevfs = zfs_freevfs },
fa9e4066f08beec538e775443c5be79dd423fcabahrensstatic const fs_operation_def_t zfs_vfsops_eio_template[] = {
if (panicstr)
zfs_minor = 0;
zfs_minor++;
zfs_minor = 0;
if (newval) {
int error = 0;
NULL)) {
return (error);
if (error)
goto unregister;
if (do_readonly)
if (do_setuid)
if (do_exec)
if (do_devices)
if (do_xattr)
if (do_atime)
zfsvfs);
return (error);
int err;
if (delta == 0)
if (used == 0)
const char *domain;
if (domain)
static uint64_t
switch (type) {
case ZFS_PROP_USERUSED:
return (DMU_USERUSED_OBJECT);
case ZFS_PROP_GROUPUSED:
return (DMU_GROUPUSED_OBJECT);
case ZFS_PROP_USERQUOTA:
case ZFS_PROP_GROUPQUOTA:
int error;
return (ENOTSUP);
if (obj == 0) {
*bufsizep = 0;
*bufsizep)
buf++;
error = 0;
return (error);
int domainid = 0;
return (ENOENT);
int err;
*valp = 0;
return (ENOTSUP);
if (obj == 0)
if (err)
return (err);
err = 0;
return (err);
int err;
return (EINVAL);
return (ENOTSUP);
if (err)
return (err);
if (*objp == 0) {
if (fuid_dirtied)
if (err) {
return (err);
if (*objp == 0) {
if (quota == 0) {
err = 0;
if (fuid_dirtied)
return (err);
int err;
return (B_FALSE);
if (err != 0)
return (B_FALSE);
if (err != 0)
return (B_FALSE);
int i, error;
return (error);
if (zval)
if (error)
return (error);
if (error) {
goto out;
goto out;
goto out;
goto out;
goto out;
if (error)
goto out;
if (error)
goto out;
goto out;
goto out;
goto out;
goto out;
for (i = 0; i != ZFS_OBJ_MTX_SZ; i++)
out:
return (error);
int error;
if (error)
return (error);
if (zil_disable) {
if (mounting) {
if (readonly != 0)
for (i = 0; i != ZFS_OBJ_MTX_SZ; i++)
int error = 0;
if (error)
return (error);
goto out;
NULL))
goto out;
goto out;
out:
if (error) {
return (error);
zfsvfs) == 0);
zfsvfs) == 0);
zfsvfs) == 0);
zfsvfs) == 0);
zfsvfs) == 0);
zfsvfs) == 0);
zfsvfs) == 0);
zfsvfs) == 0);
zfsvfs) == 0);
while (*str) {
return (EINVAL);
* "rootpool-name/root-filesystem-object-number'. Convert this
* string to a dataset name: "rootpool-name/root-filesystem-name".
char *slashp;
int error;
return (EINVAL);
return (error);
int error = 0;
static int zfsrootdone = 0;
char *zfs_bootfs;
char *zfs_devid;
if (zfsrootdone++)
return (EBUSY);
return (EINVAL);
if (zfs_devid)
if (error) {
error);
return (error);
error);
return (error);
return (error);
goto out;
goto out;
out:
return (error);
return (ENOTSUP);
char *osname;
int error = 0;
int canwrite;
return (ENOTDIR);
return (EBUSY);
return (EINVAL);
return (error);
if (error) {
if (error == 0) {
goto out;
goto out;
goto out;
goto out;
goto out;
out:
return (error);
int error;
if (error == 0)
return (error);
if (!unmounting) {
return (EIO);
if (unmounting) {
int ret;
if (ret) {
if (ret)
return (ret);
return (ret);
return (EBUSY);
return (EBUSY);
int i, err;
if (err)
return (EINVAL);
return (EINVAL);
if (fid_gen == 0 &&
return (err);
if (zp_gen == 0)
return (EINVAL);
int error;
return (error);
if (name)
int err;
if (err) {
if (err) {
return (err);
int error;
if (error != 0) {
if (error) {
return (error);
zfs_init(void)
zfsctl_init();
zfs_fini(void)
zfsctl_fini();
zfs_busy(void)
return (zfs_active_fs_count != 0);
int error;
return (EINVAL);
return (EINVAL);
if (error) {
return (error);
if (error) {
return (error);
const char *pname;
switch (prop) {
case ZFS_PROP_VERSION:
case ZFS_PROP_NORMALIZE:
case ZFS_PROP_UTF8ONLY:
*value = 0;
case ZFS_PROP_CASE:
return (error);
error = 0;
return (error);