2010-03-02 20:20:02 +03:00
|
|
|
/* $NetBSD: mfs_extern.h,v 1.31 2010/03/02 17:20:02 pooka Exp $ */
|
1994-06-29 10:39:25 +04:00
|
|
|
|
1994-06-08 15:41:58 +04:00
|
|
|
/*-
|
|
|
|
* Copyright (c) 1991, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
2003-08-07 20:26:28 +04:00
|
|
|
* 3. Neither the name of the University nor the names of its contributors
|
1994-06-08 15:41:58 +04:00
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
1998-03-01 05:20:01 +03:00
|
|
|
* @(#)mfs_extern.h 8.4 (Berkeley) 3/30/95
|
1994-06-08 15:41:58 +04:00
|
|
|
*/
|
|
|
|
|
2002-12-01 03:12:06 +03:00
|
|
|
#ifndef _UFS_MFS_MFS_EXTERN_H_
|
|
|
|
#define _UFS_MFS_MFS_EXTERN_H_
|
|
|
|
|
2007-08-02 16:53:30 +04:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/mount.h>
|
2003-02-01 09:23:35 +03:00
|
|
|
#include <sys/mallocvar.h>
|
|
|
|
|
1994-06-08 15:41:58 +04:00
|
|
|
struct buf;
|
|
|
|
struct mount;
|
|
|
|
struct nameidata;
|
|
|
|
struct proc;
|
2004-04-21 05:05:31 +04:00
|
|
|
struct statvfs;
|
1994-06-08 15:41:58 +04:00
|
|
|
struct vnode;
|
|
|
|
|
|
|
|
__BEGIN_DECLS
|
1998-08-10 12:11:10 +04:00
|
|
|
#define mfs_ioctl genfs_enoioctl
|
|
|
|
|
1996-02-10 01:31:27 +03:00
|
|
|
/* mfs_vfsops.c */
|
2007-08-01 01:14:15 +04:00
|
|
|
VFS_PROTOS(mfs);
|
1996-02-10 01:31:27 +03:00
|
|
|
|
2007-08-01 01:14:15 +04:00
|
|
|
int mfs_initminiroot(void *);
|
1996-02-10 01:31:27 +03:00
|
|
|
|
|
|
|
/* mfs_vnops.c */
|
2005-08-31 02:01:12 +04:00
|
|
|
int mfs_open(void *);
|
|
|
|
int mfs_strategy(void *);
|
2007-03-04 08:59:00 +03:00
|
|
|
void mfs_doio(struct buf *, void *);
|
2005-08-31 02:01:12 +04:00
|
|
|
int mfs_bmap(void *);
|
|
|
|
int mfs_close(void *);
|
|
|
|
int mfs_inactive(void *);
|
|
|
|
int mfs_reclaim(void *);
|
|
|
|
int mfs_print(void *);
|
PR kern/38141 lookup/vfs_busy acquire rwlock recursively
Simplify the mount locking. Remove all the crud to deal with recursion on
the mount lock, and crud to deal with unmount as another weirdo lock.
Hopefully this will once and for all fix the deadlocks with this. With this
commit there are two locks on each mount:
- krwlock_t mnt_unmounting. This is used to prevent unmount across critical
sections like getnewvnode(). It's only ever read locked with rw_tryenter(),
and is only ever write locked in dounmount(). A write hold can't be taken
on this lock if the current LWP could hold a vnode lock.
- kmutex_t mnt_updating. This is taken by threads updating the mount, for
example when going r/o -> r/w, and is only present to serialize updates.
In order to take this lock, a read hold must first be taken on
mnt_unmounting, and the two need to be held across the operation.
One effect of this change: previously if an unmount failed, we would make a
half hearted attempt to back out of it gracefully, but that was unlikely to
work in a lot of cases. Now while an unmount that will be aborted is in
progress, new file operations within the mount will fail instead of being
delayed. That is unlikely to be a problem though, because if the admin
requests unmount of a file system then s(he) has made a decision to deny
access to the resource.
2008-05-06 22:43:44 +04:00
|
|
|
int mfs_fsync(void *);
|
1996-02-10 01:31:27 +03:00
|
|
|
|
2008-03-26 17:19:43 +03:00
|
|
|
#ifdef _KERNEL
|
|
|
|
|
|
|
|
#include <sys/mutex.h>
|
|
|
|
|
|
|
|
extern kmutex_t mfs_lock;
|
2010-03-02 20:20:02 +03:00
|
|
|
extern void *mfs_rootbase;
|
|
|
|
extern u_long mfs_rootsize;
|
2008-03-26 17:19:43 +03:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
1994-06-08 15:41:58 +04:00
|
|
|
__END_DECLS
|
2002-12-01 03:12:06 +03:00
|
|
|
|
|
|
|
#endif /* !_UFS_MFS_MFS_EXTERN_H_ */
|