ufs_vfsops.c revision da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER START
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The contents of this file are subject to the terms of the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Common Development and Distribution License (the "License").
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You may not use this file except in compliance with the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * See the License for the specific language governing permissions
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * and limitations under the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * When distributing Covered Code, include this CDDL HEADER in each
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * If applicable, add the following below this CDDL HEADER, with the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * fields enclosed by brackets "[]" replaced with your own identifying
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * information: Portions Copyright [yyyy] [name of copyright owner]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER END
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * Use is subject to license terms.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/* All Rights Reserved */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * University Copyright- Copyright (c) 1982, 1986, 1988
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * The Regents of the University of California
b3700b074e637f8c6991b70754c88a2cfffb246bGordon Ross * All Rights Reserved
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * University Acknowledgment- Portions of this document are derived from
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * software developed by the University of California, Berkeley, and its
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * contributors.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#pragma ident "%Z%%M% %I% %E% SMI"
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States#include <sys/user.h>
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States#include <sys/buf.h>
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States#include <sys/pathname.h>
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States#include <sys/vfs_opreg.h>
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States#include <sys/file.h>
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States * This is the loadable module wrapper.
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States */
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States#include <sys/modctl.h>
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwstatic int ufsinit(int, char *);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwstatic int mountfs();
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwextern int highbit();
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Cylinder group summary information handling tunable.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * This defines when these deltas get logged.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * If the number of cylinders in the file system is over the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * tunable then we log csum updates. Otherwise the updates are only
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * done for performance on unmount. After a panic they can be
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States * quickly constructed during mounting. See ufs_construct_si()
b3700b074e637f8c6991b70754c88a2cfffb246bGordon Ross * called from ufs_getsummaryinfo().
static int ufs_clean_root = 0;
(void *)UFSMNT_NOINTR },
(void *)UFSMNT_SYNCDIR },
(void *)UFSMNT_FORCEDIRECTIO },
(void *)UFSMNT_NOFORCEDIRECTIO },
(void *)UFSMNT_NOSETSEC },
(void *)UFSMNT_LARGEFILES },
(void *)UFSMNT_LOGGING },
(void *)UFSMNT_NOATIME },
extern void ufs_lockfs_tsd_destructor(void *);
_init(void)
_fini(void)
return (EBUSY);
struct cred *, int, void *, int);
int error;
return (error);
return (ENOTDIR);
return (EBUSY);
int copy_result = 0;
return (EINVAL);
if (copy_result)
return (EFAULT);
datalen = 0;
return (error);
return (error);
return (ENOTBLK);
return (ENXIO);
return (error);
return (EBUSY);
return (EBUSY);
if (error) {
if (error == 0)
return (error);
int error;
static int ufsrootdone = 0;
int ovflags;
int doclkset;
if (ufsrootdone++)
return (EBUSY);
return (ENODEV);
if (error == 0) {
ufs_update(0);
if (error)
return (error);
if (error == 0) {
doclkset = 0;
if (error) {
if (rootvp) {
return (error);
int error = 0;
int flags = 0;
return (ENOTSUP);
return (EINVAL);
goto remounterr;
goto remounterr;
goto remounterr;
if (error)
goto remounterr;
goto remounterr;
goto remounterr;
goto remounterr;
goto remounterr;
if (error)
goto remounterr;
tpt = 0;
goto remounterr;
if (tpt)
return (error);
int error = 0;
int needclose = 0;
int needtrans = 0;
int flags = 0;
int elapsed;
int status;
extern int maxphys;
if (error)
goto out;
goto out;
if (error == 0)
return (error);
goto out;
goto out;
goto out;
goto out;
#ifndef _LP64
> INT_MAX) {
goto out;
goto out;
if (error) {
goto out;
goto out;
tp = 0;
goto out;
if (isroot) {
goto out;
if (isroot) {
goto out;
goto out;
sizeof (struct lockfs));
if (error)
goto out;
goto out;
goto out;
goto out;
out:
if (error == 0)
if (rvp) {
elapsed = 0;
if (needtrans) {
if (ufsvfsp) {
if (bp) {
if (tp) {
if (needclose) {
return (error);
return (EPERM);
return (EAGAIN);
goto out;
goto out;
goto out;
goto out;
if (flag) {
if (error == 0) {
error);
if (!error)
* ufs_lockfs_begin/ufs_check_lockfs. These threads will need
out:
vfsp);
return (error);
if (!vfsp)
return (EIO);
int blk, i;
return (EIO);
return (EINVAL);
return (EINVAL);
return (EINVAL);
int error;
if (!ufsvfsp)
return (EIO);
if (!error) {
int blks;
int error = 0;
goto errout;
goto errout;
if (error)
goto errout;
goto errout;
return (error);
int error;
if (error != 0) {
return (error);
if (error != 0) {
return (error);
ufs_iinit();
#ifdef __sparc
return (ENODEV);
if (error) {
return (error);
return (EBUSY);
if (error) {
error);