Rewrite function definitions in the UFS/FFS code base with identifier lists.
The K&R style in UFS and other places in the tree's days are numbered as this syntax is removed in C2x proposal N2432: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2432.pdf Though running to nearly 6000 lines of diffs this update should cause no functional change to the code. Requested by: Warner Losh MFC after: 2 weeks
This commit is contained in:
parent
0a92a9fca7
commit
064e6b4303
@ -148,12 +148,13 @@ static void ffs_ckhash_cg(struct buf *);
|
||||
* available block is located.
|
||||
*/
|
||||
int
|
||||
ffs_alloc(ip, lbn, bpref, size, flags, cred, bnp)
|
||||
struct inode *ip;
|
||||
ufs2_daddr_t lbn, bpref;
|
||||
int size, flags;
|
||||
struct ucred *cred;
|
||||
ufs2_daddr_t *bnp;
|
||||
ffs_alloc(struct inode *ip,
|
||||
ufs2_daddr_t lbn,
|
||||
ufs2_daddr_t bpref,
|
||||
int size,
|
||||
int flags,
|
||||
struct ucred *cred,
|
||||
ufs2_daddr_t *bnp)
|
||||
{
|
||||
struct fs *fs;
|
||||
struct ufsmount *ump;
|
||||
@ -248,14 +249,15 @@ ffs_alloc(ip, lbn, bpref, size, flags, cred, bnp)
|
||||
* invoked to get an appropriate block.
|
||||
*/
|
||||
int
|
||||
ffs_realloccg(ip, lbprev, bprev, bpref, osize, nsize, flags, cred, bpp)
|
||||
struct inode *ip;
|
||||
ufs2_daddr_t lbprev;
|
||||
ufs2_daddr_t bprev;
|
||||
ufs2_daddr_t bpref;
|
||||
int osize, nsize, flags;
|
||||
struct ucred *cred;
|
||||
struct buf **bpp;
|
||||
ffs_realloccg(struct inode *ip,
|
||||
ufs2_daddr_t lbprev,
|
||||
ufs2_daddr_t bprev,
|
||||
ufs2_daddr_t bpref,
|
||||
int osize,
|
||||
int nsize,
|
||||
int flags,
|
||||
struct ucred *cred,
|
||||
struct buf **bpp)
|
||||
{
|
||||
struct vnode *vp;
|
||||
struct fs *fs;
|
||||
@ -514,11 +516,11 @@ SYSCTL_INT(_debug, OID_AUTO, ffs_prtrealloc, CTLFLAG_RW, &prtrealloc, 0,
|
||||
#endif
|
||||
|
||||
int
|
||||
ffs_reallocblks(ap)
|
||||
ffs_reallocblks(
|
||||
struct vop_reallocblks_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct cluster_save *a_buflist;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct ufsmount *ump;
|
||||
int error;
|
||||
@ -559,11 +561,11 @@ ffs_reallocblks(ap)
|
||||
}
|
||||
|
||||
static int
|
||||
ffs_reallocblks_ufs1(ap)
|
||||
ffs_reallocblks_ufs1(
|
||||
struct vop_reallocblks_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct cluster_save *a_buflist;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct fs *fs;
|
||||
struct inode *ip;
|
||||
@ -825,11 +827,11 @@ ffs_reallocblks_ufs1(ap)
|
||||
}
|
||||
|
||||
static int
|
||||
ffs_reallocblks_ufs2(ap)
|
||||
ffs_reallocblks_ufs2(
|
||||
struct vop_reallocblks_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct cluster_save *a_buflist;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct fs *fs;
|
||||
struct inode *ip;
|
||||
@ -1104,11 +1106,10 @@ ffs_reallocblks_ufs2(ap)
|
||||
* available inode is located.
|
||||
*/
|
||||
int
|
||||
ffs_valloc(pvp, mode, cred, vpp)
|
||||
struct vnode *pvp;
|
||||
int mode;
|
||||
struct ucred *cred;
|
||||
struct vnode **vpp;
|
||||
ffs_valloc(struct vnode *pvp,
|
||||
int mode,
|
||||
struct ucred *cred,
|
||||
struct vnode **vpp)
|
||||
{
|
||||
struct inode *pip;
|
||||
struct fs *fs;
|
||||
@ -1234,8 +1235,7 @@ ffs_valloc(pvp, mode, cred, vpp)
|
||||
* in another cylinder group.
|
||||
*/
|
||||
static ino_t
|
||||
ffs_dirpref(pip)
|
||||
struct inode *pip;
|
||||
ffs_dirpref(struct inode *pip)
|
||||
{
|
||||
struct fs *fs;
|
||||
int cg, prefcg, dirsize, cgsize;
|
||||
@ -1381,11 +1381,10 @@ ffs_dirpref(pip)
|
||||
* allocate blocks contiguously within the section if possible.
|
||||
*/
|
||||
ufs2_daddr_t
|
||||
ffs_blkpref_ufs1(ip, lbn, indx, bap)
|
||||
struct inode *ip;
|
||||
ufs_lbn_t lbn;
|
||||
int indx;
|
||||
ufs1_daddr_t *bap;
|
||||
ffs_blkpref_ufs1(struct inode *ip,
|
||||
ufs_lbn_t lbn,
|
||||
int indx,
|
||||
ufs1_daddr_t *bap)
|
||||
{
|
||||
struct fs *fs;
|
||||
u_int cg, inocg;
|
||||
@ -1494,11 +1493,10 @@ ffs_blkpref_ufs1(ip, lbn, indx, bap)
|
||||
* Same as above, but for UFS2
|
||||
*/
|
||||
ufs2_daddr_t
|
||||
ffs_blkpref_ufs2(ip, lbn, indx, bap)
|
||||
struct inode *ip;
|
||||
ufs_lbn_t lbn;
|
||||
int indx;
|
||||
ufs2_daddr_t *bap;
|
||||
ffs_blkpref_ufs2(struct inode *ip,
|
||||
ufs_lbn_t lbn,
|
||||
int indx,
|
||||
ufs2_daddr_t *bap)
|
||||
{
|
||||
struct fs *fs;
|
||||
u_int cg, inocg;
|
||||
@ -1616,13 +1614,12 @@ ffs_blkpref_ufs2(ip, lbn, indx, bap)
|
||||
*/
|
||||
/*VARARGS5*/
|
||||
static ufs2_daddr_t
|
||||
ffs_hashalloc(ip, cg, pref, size, rsize, allocator)
|
||||
struct inode *ip;
|
||||
u_int cg;
|
||||
ufs2_daddr_t pref;
|
||||
int size; /* Search size for data blocks, mode for inodes */
|
||||
int rsize; /* Real allocated size. */
|
||||
allocfcn_t *allocator;
|
||||
ffs_hashalloc(struct inode *ip,
|
||||
u_int cg,
|
||||
ufs2_daddr_t pref,
|
||||
int size, /* Search size for data blocks, mode for inodes */
|
||||
int rsize, /* Real allocated size. */
|
||||
allocfcn_t *allocator)
|
||||
{
|
||||
struct fs *fs;
|
||||
ufs2_daddr_t result;
|
||||
@ -1675,11 +1672,11 @@ ffs_hashalloc(ip, cg, pref, size, rsize, allocator)
|
||||
* if they are, allocate them.
|
||||
*/
|
||||
static ufs2_daddr_t
|
||||
ffs_fragextend(ip, cg, bprev, osize, nsize)
|
||||
struct inode *ip;
|
||||
u_int cg;
|
||||
ufs2_daddr_t bprev;
|
||||
int osize, nsize;
|
||||
ffs_fragextend(struct inode *ip,
|
||||
u_int cg,
|
||||
ufs2_daddr_t bprev,
|
||||
int osize,
|
||||
int nsize)
|
||||
{
|
||||
struct fs *fs;
|
||||
struct cg *cgp;
|
||||
@ -1752,12 +1749,11 @@ ffs_fragextend(ip, cg, bprev, osize, nsize)
|
||||
* and if it is, allocate it.
|
||||
*/
|
||||
static ufs2_daddr_t
|
||||
ffs_alloccg(ip, cg, bpref, size, rsize)
|
||||
struct inode *ip;
|
||||
u_int cg;
|
||||
ufs2_daddr_t bpref;
|
||||
int size;
|
||||
int rsize;
|
||||
ffs_alloccg(struct inode *ip,
|
||||
u_int cg,
|
||||
ufs2_daddr_t bpref,
|
||||
int size,
|
||||
int rsize)
|
||||
{
|
||||
struct fs *fs;
|
||||
struct cg *cgp;
|
||||
@ -1849,11 +1845,10 @@ ffs_alloccg(ip, cg, bpref, size, rsize)
|
||||
* blocks may be fragmented by the routine that allocates them.
|
||||
*/
|
||||
static ufs2_daddr_t
|
||||
ffs_alloccgblk(ip, bp, bpref, size)
|
||||
struct inode *ip;
|
||||
struct buf *bp;
|
||||
ufs2_daddr_t bpref;
|
||||
int size;
|
||||
ffs_alloccgblk(struct inode *ip,
|
||||
struct buf *bp,
|
||||
ufs2_daddr_t bpref,
|
||||
int size)
|
||||
{
|
||||
struct fs *fs;
|
||||
struct cg *cgp;
|
||||
@ -1932,11 +1927,10 @@ ffs_alloccgblk(ip, bp, bpref, size)
|
||||
* take the first one that we find following bpref.
|
||||
*/
|
||||
static ufs2_daddr_t
|
||||
ffs_clusteralloc(ip, cg, bpref, len)
|
||||
struct inode *ip;
|
||||
u_int cg;
|
||||
ufs2_daddr_t bpref;
|
||||
int len;
|
||||
ffs_clusteralloc(struct inode *ip,
|
||||
u_int cg,
|
||||
ufs2_daddr_t bpref,
|
||||
int len)
|
||||
{
|
||||
struct fs *fs;
|
||||
struct cg *cgp;
|
||||
@ -2043,7 +2037,10 @@ ffs_clusteralloc(ip, cg, bpref, len)
|
||||
}
|
||||
|
||||
static inline struct buf *
|
||||
getinobuf(struct inode *ip, u_int cg, u_int32_t cginoblk, int gbflags)
|
||||
getinobuf(struct inode *ip,
|
||||
u_int cg,
|
||||
u_int32_t cginoblk,
|
||||
int gbflags)
|
||||
{
|
||||
struct fs *fs;
|
||||
|
||||
@ -2073,12 +2070,11 @@ SYSCTL_INT(_vfs_ffs, OID_AUTO, doasyncinodeinit, CTLFLAG_RWTUN,
|
||||
* inode in the specified cylinder group.
|
||||
*/
|
||||
static ufs2_daddr_t
|
||||
ffs_nodealloccg(ip, cg, ipref, mode, unused)
|
||||
struct inode *ip;
|
||||
u_int cg;
|
||||
ufs2_daddr_t ipref;
|
||||
int mode;
|
||||
int unused;
|
||||
ffs_nodealloccg(struct inode *ip,
|
||||
u_int cg,
|
||||
ufs2_daddr_t ipref,
|
||||
int mode,
|
||||
int unused)
|
||||
{
|
||||
struct fs *fs;
|
||||
struct cg *cgp;
|
||||
@ -2230,14 +2226,13 @@ ffs_nodealloccg(ip, cg, ipref, mode, unused)
|
||||
* block reassembly is checked.
|
||||
*/
|
||||
static void
|
||||
ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd)
|
||||
struct ufsmount *ump;
|
||||
struct fs *fs;
|
||||
struct vnode *devvp;
|
||||
ufs2_daddr_t bno;
|
||||
long size;
|
||||
ino_t inum;
|
||||
struct workhead *dephd;
|
||||
ffs_blkfree_cg(struct ufsmount *ump,
|
||||
struct fs *fs,
|
||||
struct vnode *devvp,
|
||||
ufs2_daddr_t bno,
|
||||
long size,
|
||||
ino_t inum,
|
||||
struct workhead *dephd)
|
||||
{
|
||||
struct mount *mp;
|
||||
struct cg *cgp;
|
||||
@ -2422,8 +2417,7 @@ static void ffs_blkfree_sendtrim(struct ffs_blkfree_trim_params *);
|
||||
* Called on trim completion to start a task to free the associated block(s).
|
||||
*/
|
||||
static void
|
||||
ffs_blkfree_trim_completed(bp)
|
||||
struct buf *bp;
|
||||
ffs_blkfree_trim_completed(struct buf *bp)
|
||||
{
|
||||
struct ffs_blkfree_trim_params *tp;
|
||||
|
||||
@ -2437,9 +2431,7 @@ ffs_blkfree_trim_completed(bp)
|
||||
* Trim completion task that free associated block(s).
|
||||
*/
|
||||
static void
|
||||
ffs_blkfree_trim_task(ctx, pending)
|
||||
void *ctx;
|
||||
int pending;
|
||||
ffs_blkfree_trim_task(void *ctx, int pending)
|
||||
{
|
||||
struct ffs_blkfree_trim_params *tp;
|
||||
struct trim_blkreq *blkelm;
|
||||
@ -2466,14 +2458,13 @@ ffs_blkfree_trim_task(ctx, pending)
|
||||
* Allocate if requested (NEW, REPLACE, SINGLE).
|
||||
*/
|
||||
static struct ffs_blkfree_trim_params *
|
||||
trim_lookup(ump, devvp, bno, size, inum, key, alloctype)
|
||||
struct ufsmount *ump;
|
||||
struct vnode *devvp;
|
||||
ufs2_daddr_t bno;
|
||||
long size;
|
||||
ino_t inum;
|
||||
u_long key;
|
||||
int alloctype;
|
||||
trim_lookup(struct ufsmount *ump,
|
||||
struct vnode *devvp,
|
||||
ufs2_daddr_t bno,
|
||||
long size,
|
||||
ino_t inum,
|
||||
u_long key,
|
||||
int alloctype)
|
||||
{
|
||||
struct trimlist_hashhead *tphashhead;
|
||||
struct ffs_blkfree_trim_params *tp, *ntp;
|
||||
@ -2527,8 +2518,7 @@ trim_lookup(ump, devvp, bno, size, inum, key, alloctype)
|
||||
* Dispatch a trim request.
|
||||
*/
|
||||
static void
|
||||
ffs_blkfree_sendtrim(tp)
|
||||
struct ffs_blkfree_trim_params *tp;
|
||||
ffs_blkfree_sendtrim(struct ffs_blkfree_trim_params *tp)
|
||||
{
|
||||
struct ufsmount *ump;
|
||||
struct mount *mp;
|
||||
@ -2563,10 +2553,9 @@ ffs_blkfree_sendtrim(tp)
|
||||
* Allocate a new key to use to identify a range of blocks.
|
||||
*/
|
||||
u_long
|
||||
ffs_blkrelease_start(ump, devvp, inum)
|
||||
struct ufsmount *ump;
|
||||
struct vnode *devvp;
|
||||
ino_t inum;
|
||||
ffs_blkrelease_start(struct ufsmount *ump,
|
||||
struct vnode *devvp,
|
||||
ino_t inum)
|
||||
{
|
||||
static u_long masterkey;
|
||||
u_long key;
|
||||
@ -2584,9 +2573,7 @@ ffs_blkrelease_start(ump, devvp, inum)
|
||||
* Deallocate a key that has been used to identify a range of blocks.
|
||||
*/
|
||||
void
|
||||
ffs_blkrelease_finish(ump, key)
|
||||
struct ufsmount *ump;
|
||||
u_long key;
|
||||
ffs_blkrelease_finish(struct ufsmount *ump, u_long key)
|
||||
{
|
||||
struct ffs_blkfree_trim_params *tp;
|
||||
|
||||
@ -2632,16 +2619,15 @@ ffs_blkrelease_finish(ump, key)
|
||||
* aggregate consecutive blocks into a single trim request.
|
||||
*/
|
||||
void
|
||||
ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, dephd, key)
|
||||
struct ufsmount *ump;
|
||||
struct fs *fs;
|
||||
struct vnode *devvp;
|
||||
ufs2_daddr_t bno;
|
||||
long size;
|
||||
ino_t inum;
|
||||
enum vtype vtype;
|
||||
struct workhead *dephd;
|
||||
u_long key;
|
||||
ffs_blkfree(struct ufsmount *ump,
|
||||
struct fs *fs,
|
||||
struct vnode *devvp,
|
||||
ufs2_daddr_t bno,
|
||||
long size,
|
||||
ino_t inum,
|
||||
enum vtype vtype,
|
||||
struct workhead *dephd,
|
||||
u_long key)
|
||||
{
|
||||
struct ffs_blkfree_trim_params *tp, *ntp;
|
||||
struct trim_blkreq *blkelm;
|
||||
@ -2740,10 +2726,9 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, dephd, key)
|
||||
* fragment is allocated, false if it is free.
|
||||
*/
|
||||
static int
|
||||
ffs_checkblk(ip, bno, size)
|
||||
struct inode *ip;
|
||||
ufs2_daddr_t bno;
|
||||
long size;
|
||||
ffs_checkblk(struct inode *ip,
|
||||
ufs2_daddr_t bno,
|
||||
long size)
|
||||
{
|
||||
struct fs *fs;
|
||||
struct cg *cgp;
|
||||
@ -2784,10 +2769,9 @@ ffs_checkblk(ip, bno, size)
|
||||
* Free an inode.
|
||||
*/
|
||||
int
|
||||
ffs_vfree(pvp, ino, mode)
|
||||
struct vnode *pvp;
|
||||
ino_t ino;
|
||||
int mode;
|
||||
ffs_vfree(struct vnode *pvp,
|
||||
ino_t ino,
|
||||
int mode)
|
||||
{
|
||||
struct ufsmount *ump;
|
||||
|
||||
@ -2804,13 +2788,12 @@ ffs_vfree(pvp, ino, mode)
|
||||
* The specified inode is placed back in the free map.
|
||||
*/
|
||||
int
|
||||
ffs_freefile(ump, fs, devvp, ino, mode, wkhd)
|
||||
struct ufsmount *ump;
|
||||
struct fs *fs;
|
||||
struct vnode *devvp;
|
||||
ino_t ino;
|
||||
int mode;
|
||||
struct workhead *wkhd;
|
||||
ffs_freefile(struct ufsmount *ump,
|
||||
struct fs *fs,
|
||||
struct vnode *devvp,
|
||||
ino_t ino,
|
||||
int mode,
|
||||
struct workhead *wkhd)
|
||||
{
|
||||
struct cg *cgp;
|
||||
struct buf *bp;
|
||||
@ -2886,10 +2869,9 @@ ffs_freefile(ump, fs, devvp, ino, mode, wkhd)
|
||||
* Used to check for allocated files in snapshots.
|
||||
*/
|
||||
int
|
||||
ffs_checkfreefile(fs, devvp, ino)
|
||||
struct fs *fs;
|
||||
struct vnode *devvp;
|
||||
ino_t ino;
|
||||
ffs_checkfreefile(struct fs *fs,
|
||||
struct vnode *devvp,
|
||||
ino_t ino)
|
||||
{
|
||||
struct cg *cgp;
|
||||
struct buf *bp;
|
||||
@ -2918,11 +2900,10 @@ ffs_checkfreefile(fs, devvp, ino)
|
||||
* available.
|
||||
*/
|
||||
static ufs1_daddr_t
|
||||
ffs_mapsearch(fs, cgp, bpref, allocsiz)
|
||||
struct fs *fs;
|
||||
struct cg *cgp;
|
||||
ufs2_daddr_t bpref;
|
||||
int allocsiz;
|
||||
ffs_mapsearch(struct fs *fs,
|
||||
struct cg *cgp,
|
||||
ufs2_daddr_t bpref,
|
||||
int allocsiz)
|
||||
{
|
||||
ufs1_daddr_t bno;
|
||||
int start, len, loc, i;
|
||||
@ -2991,13 +2972,12 @@ ffs_getmntstat(struct vnode *devvp)
|
||||
* Fetch and verify a cylinder group.
|
||||
*/
|
||||
int
|
||||
ffs_getcg(fs, devvp, cg, flags, bpp, cgpp)
|
||||
struct fs *fs;
|
||||
struct vnode *devvp;
|
||||
u_int cg;
|
||||
int flags;
|
||||
struct buf **bpp;
|
||||
struct cg **cgpp;
|
||||
ffs_getcg(struct fs *fs,
|
||||
struct vnode *devvp,
|
||||
u_int cg,
|
||||
int flags,
|
||||
struct buf **bpp,
|
||||
struct cg **cgpp)
|
||||
{
|
||||
struct buf *bp;
|
||||
struct cg *cgp;
|
||||
@ -3068,8 +3048,7 @@ ffs_getcg(fs, devvp, cg, flags, bpp, cgpp)
|
||||
}
|
||||
|
||||
static void
|
||||
ffs_ckhash_cg(bp)
|
||||
struct buf *bp;
|
||||
ffs_ckhash_cg(struct buf *bp)
|
||||
{
|
||||
uint32_t ckhash;
|
||||
struct cg *cgp;
|
||||
@ -3088,10 +3067,9 @@ ffs_ckhash_cg(bp)
|
||||
* fs: error message
|
||||
*/
|
||||
void
|
||||
ffs_fserr(fs, inum, cp)
|
||||
struct fs *fs;
|
||||
ino_t inum;
|
||||
char *cp;
|
||||
ffs_fserr(struct fs *fs,
|
||||
ino_t inum,
|
||||
char *cp)
|
||||
{
|
||||
struct thread *td = curthread; /* XXX */
|
||||
struct proc *p = td->td_proc;
|
||||
|
@ -95,9 +95,7 @@ ffs_inode_bwrite(struct vnode *vp, struct buf *bp, int flags)
|
||||
* for the write to complete.
|
||||
*/
|
||||
int
|
||||
ffs_update(vp, waitfor)
|
||||
struct vnode *vp;
|
||||
int waitfor;
|
||||
ffs_update(struct vnode *vp, int waitfor)
|
||||
{
|
||||
struct fs *fs;
|
||||
struct buf *bp;
|
||||
@ -234,11 +232,10 @@ ffs_update(vp, waitfor)
|
||||
* disk blocks.
|
||||
*/
|
||||
int
|
||||
ffs_truncate(vp, length, flags, cred)
|
||||
struct vnode *vp;
|
||||
off_t length;
|
||||
int flags;
|
||||
struct ucred *cred;
|
||||
ffs_truncate(struct vnode *vp,
|
||||
off_t length,
|
||||
int flags,
|
||||
struct ucred *cred)
|
||||
{
|
||||
struct inode *ip;
|
||||
ufs2_daddr_t bn, lbn, lastblock, lastiblock[UFS_NIADDR];
|
||||
@ -695,12 +692,12 @@ ffs_truncate(vp, length, flags, cred)
|
||||
* blocks.
|
||||
*/
|
||||
static int
|
||||
ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
|
||||
struct inode *ip;
|
||||
ufs2_daddr_t lbn, lastbn;
|
||||
ufs2_daddr_t dbn;
|
||||
int level;
|
||||
ufs2_daddr_t *countp;
|
||||
ffs_indirtrunc(struct inode *ip,
|
||||
ufs2_daddr_t lbn,
|
||||
ufs2_daddr_t lastbn,
|
||||
ufs2_daddr_t dbn,
|
||||
int level,
|
||||
ufs2_daddr_t *countp)
|
||||
{
|
||||
struct buf *bp;
|
||||
struct fs *fs;
|
||||
|
@ -80,62 +80,51 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#ifdef NO_FFS_SNAPSHOT
|
||||
int
|
||||
ffs_snapshot(mp, snapfile)
|
||||
struct mount *mp;
|
||||
char *snapfile;
|
||||
ffs_snapshot(struct mount *mp, char *snapfile)
|
||||
{
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
int
|
||||
ffs_snapblkfree(fs, devvp, bno, size, inum, vtype, wkhd)
|
||||
struct fs *fs;
|
||||
struct vnode *devvp;
|
||||
ufs2_daddr_t bno;
|
||||
long size;
|
||||
ino_t inum;
|
||||
enum vtype vtype;
|
||||
struct workhead *wkhd;
|
||||
ffs_snapblkfree(struct fs *fs,
|
||||
struct vnode *devvp,
|
||||
ufs2_daddr_t bno,
|
||||
long size,
|
||||
ino_t inum,
|
||||
enum vtype vtype,
|
||||
struct workhead *wkhd)
|
||||
{
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
void
|
||||
ffs_snapremove(vp)
|
||||
struct vnode *vp;
|
||||
ffs_snapremove(struct vnode *vp)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ffs_snapshot_mount(mp)
|
||||
struct mount *mp;
|
||||
ffs_snapshot_mount(struct mount *mp)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ffs_snapshot_unmount(mp)
|
||||
struct mount *mp;
|
||||
ffs_snapshot_unmount(struct mount *mp)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ffs_snapgone(ip)
|
||||
struct inode *ip;
|
||||
ffs_snapgone(struct inode *ip)
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
ffs_copyonwrite(devvp, bp)
|
||||
struct vnode *devvp;
|
||||
struct buf *bp;
|
||||
ffs_copyonwrite(struct vnode *devvp, struct buf *bp)
|
||||
{
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
void
|
||||
ffs_sync_snap(mp, waitfor)
|
||||
struct mount *mp;
|
||||
int waitfor;
|
||||
ffs_sync_snap(struct mount *mp, int waitfor)
|
||||
{
|
||||
}
|
||||
|
||||
@ -204,9 +193,7 @@ SYSCTL_INT(_debug, OID_AUTO, collectsnapstats, CTLFLAG_RW, &collectsnapstats,
|
||||
* Create a snapshot file and initialize it for the filesystem.
|
||||
*/
|
||||
int
|
||||
ffs_snapshot(mp, snapfile)
|
||||
struct mount *mp;
|
||||
char *snapfile;
|
||||
ffs_snapshot(struct mount *mp, char *snapfile)
|
||||
{
|
||||
ufs2_daddr_t numblks, blkno, *blkp, *snapblklist;
|
||||
int error, cg, snaploc;
|
||||
@ -906,11 +893,10 @@ ffs_snapshot(mp, snapfile)
|
||||
* replacement pass is done.
|
||||
*/
|
||||
static int
|
||||
cgaccount(cg, vp, nbp, passno)
|
||||
int cg;
|
||||
struct vnode *vp;
|
||||
struct buf *nbp;
|
||||
int passno;
|
||||
cgaccount(int cg,
|
||||
struct vnode *vp,
|
||||
struct buf *nbp,
|
||||
int passno)
|
||||
{
|
||||
struct buf *bp, *ibp;
|
||||
struct inode *ip;
|
||||
@ -1026,14 +1012,13 @@ cgaccount(cg, vp, nbp, passno)
|
||||
* is reproduced once each for UFS1 and UFS2.
|
||||
*/
|
||||
static int
|
||||
expunge_ufs1(snapvp, cancelip, fs, acctfunc, expungetype, clearmode)
|
||||
struct vnode *snapvp;
|
||||
struct inode *cancelip;
|
||||
struct fs *fs;
|
||||
expunge_ufs1(struct vnode *snapvp,
|
||||
struct inode *cancelip,
|
||||
struct fs *fs,
|
||||
int (*acctfunc)(struct vnode *, ufs1_daddr_t *, ufs1_daddr_t *,
|
||||
struct fs *, ufs_lbn_t, int);
|
||||
int expungetype;
|
||||
int clearmode;
|
||||
struct fs *, ufs_lbn_t, int),
|
||||
int expungetype,
|
||||
int clearmode)
|
||||
{
|
||||
int i, error, indiroff;
|
||||
ufs_lbn_t lbn, rlbn;
|
||||
@ -1122,20 +1107,18 @@ expunge_ufs1(snapvp, cancelip, fs, acctfunc, expungetype, clearmode)
|
||||
* its indirect blocks in snapvp.
|
||||
*/
|
||||
static int
|
||||
indiracct_ufs1(snapvp, cancelvp, level, blkno, lbn, rlbn, remblks,
|
||||
blksperindir, fs, acctfunc, expungetype)
|
||||
struct vnode *snapvp;
|
||||
struct vnode *cancelvp;
|
||||
int level;
|
||||
ufs1_daddr_t blkno;
|
||||
ufs_lbn_t lbn;
|
||||
ufs_lbn_t rlbn;
|
||||
ufs_lbn_t remblks;
|
||||
ufs_lbn_t blksperindir;
|
||||
struct fs *fs;
|
||||
indiracct_ufs1(struct vnode *snapvp,
|
||||
struct vnode *cancelvp,
|
||||
int level,
|
||||
ufs1_daddr_t blkno,
|
||||
ufs_lbn_t lbn,
|
||||
ufs_lbn_t rlbn,
|
||||
ufs_lbn_t remblks,
|
||||
ufs_lbn_t blksperindir,
|
||||
struct fs *fs,
|
||||
int (*acctfunc)(struct vnode *, ufs1_daddr_t *, ufs1_daddr_t *,
|
||||
struct fs *, ufs_lbn_t, int);
|
||||
int expungetype;
|
||||
struct fs *, ufs_lbn_t, int),
|
||||
int expungetype)
|
||||
{
|
||||
int error, num, i;
|
||||
ufs_lbn_t subblksperindir;
|
||||
@ -1199,12 +1182,12 @@ indiracct_ufs1(snapvp, cancelvp, level, blkno, lbn, rlbn, remblks,
|
||||
* Do both snap accounting and map accounting.
|
||||
*/
|
||||
static int
|
||||
fullacct_ufs1(vp, oldblkp, lastblkp, fs, lblkno, exptype)
|
||||
struct vnode *vp;
|
||||
ufs1_daddr_t *oldblkp, *lastblkp;
|
||||
struct fs *fs;
|
||||
ufs_lbn_t lblkno;
|
||||
int exptype; /* BLK_SNAP or BLK_NOCOPY */
|
||||
fullacct_ufs1(struct vnode *vp,
|
||||
ufs1_daddr_t *oldblkp,
|
||||
ufs1_daddr_t *lastblkp,
|
||||
struct fs *fs,
|
||||
ufs_lbn_t lblkno,
|
||||
int exptype) /* BLK_SNAP or BLK_NOCOPY */
|
||||
{
|
||||
int error;
|
||||
|
||||
@ -1217,12 +1200,12 @@ fullacct_ufs1(vp, oldblkp, lastblkp, fs, lblkno, exptype)
|
||||
* Identify a set of blocks allocated in a snapshot inode.
|
||||
*/
|
||||
static int
|
||||
snapacct_ufs1(vp, oldblkp, lastblkp, fs, lblkno, expungetype)
|
||||
struct vnode *vp;
|
||||
ufs1_daddr_t *oldblkp, *lastblkp;
|
||||
struct fs *fs;
|
||||
ufs_lbn_t lblkno;
|
||||
int expungetype; /* BLK_SNAP or BLK_NOCOPY */
|
||||
snapacct_ufs1(struct vnode *vp,
|
||||
ufs1_daddr_t *oldblkp,
|
||||
ufs1_daddr_t *lastblkp,
|
||||
struct fs *fs,
|
||||
ufs_lbn_t lblkno,
|
||||
int expungetype) /* BLK_SNAP or BLK_NOCOPY */
|
||||
{
|
||||
struct inode *ip = VTOI(vp);
|
||||
ufs1_daddr_t blkno, *blkp;
|
||||
@ -1270,12 +1253,12 @@ snapacct_ufs1(vp, oldblkp, lastblkp, fs, lblkno, expungetype)
|
||||
* Account for a set of blocks allocated in a snapshot inode.
|
||||
*/
|
||||
static int
|
||||
mapacct_ufs1(vp, oldblkp, lastblkp, fs, lblkno, expungetype)
|
||||
struct vnode *vp;
|
||||
ufs1_daddr_t *oldblkp, *lastblkp;
|
||||
struct fs *fs;
|
||||
ufs_lbn_t lblkno;
|
||||
int expungetype;
|
||||
mapacct_ufs1(struct vnode *vp,
|
||||
ufs1_daddr_t *oldblkp,
|
||||
ufs1_daddr_t *lastblkp,
|
||||
struct fs *fs,
|
||||
ufs_lbn_t lblkno,
|
||||
int expungetype)
|
||||
{
|
||||
ufs1_daddr_t blkno;
|
||||
struct inode *ip;
|
||||
@ -1311,14 +1294,13 @@ mapacct_ufs1(vp, oldblkp, lastblkp, fs, lblkno, expungetype)
|
||||
* is reproduced once each for UFS1 and UFS2.
|
||||
*/
|
||||
static int
|
||||
expunge_ufs2(snapvp, cancelip, fs, acctfunc, expungetype, clearmode)
|
||||
struct vnode *snapvp;
|
||||
struct inode *cancelip;
|
||||
struct fs *fs;
|
||||
expunge_ufs2(struct vnode *snapvp,
|
||||
struct inode *cancelip,
|
||||
struct fs *fs,
|
||||
int (*acctfunc)(struct vnode *, ufs2_daddr_t *, ufs2_daddr_t *,
|
||||
struct fs *, ufs_lbn_t, int);
|
||||
int expungetype;
|
||||
int clearmode;
|
||||
struct fs *, ufs_lbn_t, int),
|
||||
int expungetype,
|
||||
int clearmode)
|
||||
{
|
||||
int i, error, indiroff;
|
||||
ufs_lbn_t lbn, rlbn;
|
||||
@ -1409,20 +1391,18 @@ expunge_ufs2(snapvp, cancelip, fs, acctfunc, expungetype, clearmode)
|
||||
* its indirect blocks in snapvp.
|
||||
*/
|
||||
static int
|
||||
indiracct_ufs2(snapvp, cancelvp, level, blkno, lbn, rlbn, remblks,
|
||||
blksperindir, fs, acctfunc, expungetype)
|
||||
struct vnode *snapvp;
|
||||
struct vnode *cancelvp;
|
||||
int level;
|
||||
ufs2_daddr_t blkno;
|
||||
ufs_lbn_t lbn;
|
||||
ufs_lbn_t rlbn;
|
||||
ufs_lbn_t remblks;
|
||||
ufs_lbn_t blksperindir;
|
||||
struct fs *fs;
|
||||
indiracct_ufs2(struct vnode *snapvp,
|
||||
struct vnode *cancelvp,
|
||||
int level,
|
||||
ufs2_daddr_t blkno,
|
||||
ufs_lbn_t lbn,
|
||||
ufs_lbn_t rlbn,
|
||||
ufs_lbn_t remblks,
|
||||
ufs_lbn_t blksperindir,
|
||||
struct fs *fs,
|
||||
int (*acctfunc)(struct vnode *, ufs2_daddr_t *, ufs2_daddr_t *,
|
||||
struct fs *, ufs_lbn_t, int);
|
||||
int expungetype;
|
||||
struct fs *, ufs_lbn_t, int),
|
||||
int expungetype)
|
||||
{
|
||||
int error, num, i;
|
||||
ufs_lbn_t subblksperindir;
|
||||
@ -1486,12 +1466,12 @@ indiracct_ufs2(snapvp, cancelvp, level, blkno, lbn, rlbn, remblks,
|
||||
* Do both snap accounting and map accounting.
|
||||
*/
|
||||
static int
|
||||
fullacct_ufs2(vp, oldblkp, lastblkp, fs, lblkno, exptype)
|
||||
struct vnode *vp;
|
||||
ufs2_daddr_t *oldblkp, *lastblkp;
|
||||
struct fs *fs;
|
||||
ufs_lbn_t lblkno;
|
||||
int exptype; /* BLK_SNAP or BLK_NOCOPY */
|
||||
fullacct_ufs2(struct vnode *vp,
|
||||
ufs2_daddr_t *oldblkp,
|
||||
ufs2_daddr_t *lastblkp,
|
||||
struct fs *fs,
|
||||
ufs_lbn_t lblkno,
|
||||
int exptype) /* BLK_SNAP or BLK_NOCOPY */
|
||||
{
|
||||
int error;
|
||||
|
||||
@ -1504,12 +1484,12 @@ fullacct_ufs2(vp, oldblkp, lastblkp, fs, lblkno, exptype)
|
||||
* Identify a set of blocks allocated in a snapshot inode.
|
||||
*/
|
||||
static int
|
||||
snapacct_ufs2(vp, oldblkp, lastblkp, fs, lblkno, expungetype)
|
||||
struct vnode *vp;
|
||||
ufs2_daddr_t *oldblkp, *lastblkp;
|
||||
struct fs *fs;
|
||||
ufs_lbn_t lblkno;
|
||||
int expungetype; /* BLK_SNAP or BLK_NOCOPY */
|
||||
snapacct_ufs2(struct vnode *vp,
|
||||
ufs2_daddr_t *oldblkp,
|
||||
ufs2_daddr_t *lastblkp,
|
||||
struct fs *fs,
|
||||
ufs_lbn_t lblkno,
|
||||
int expungetype) /* BLK_SNAP or BLK_NOCOPY */
|
||||
{
|
||||
struct inode *ip = VTOI(vp);
|
||||
ufs2_daddr_t blkno, *blkp;
|
||||
@ -1557,12 +1537,12 @@ snapacct_ufs2(vp, oldblkp, lastblkp, fs, lblkno, expungetype)
|
||||
* Account for a set of blocks allocated in a snapshot inode.
|
||||
*/
|
||||
static int
|
||||
mapacct_ufs2(vp, oldblkp, lastblkp, fs, lblkno, expungetype)
|
||||
struct vnode *vp;
|
||||
ufs2_daddr_t *oldblkp, *lastblkp;
|
||||
struct fs *fs;
|
||||
ufs_lbn_t lblkno;
|
||||
int expungetype;
|
||||
mapacct_ufs2(struct vnode *vp,
|
||||
ufs2_daddr_t *oldblkp,
|
||||
ufs2_daddr_t *lastblkp,
|
||||
struct fs *fs,
|
||||
ufs_lbn_t lblkno,
|
||||
int expungetype)
|
||||
{
|
||||
ufs2_daddr_t blkno;
|
||||
struct inode *ip;
|
||||
@ -1595,8 +1575,7 @@ mapacct_ufs2(vp, oldblkp, lastblkp, fs, lblkno, expungetype)
|
||||
* It will not be freed until the last open reference goes away.
|
||||
*/
|
||||
void
|
||||
ffs_snapgone(ip)
|
||||
struct inode *ip;
|
||||
ffs_snapgone(struct inode *ip)
|
||||
{
|
||||
struct inode *xp;
|
||||
struct fs *fs;
|
||||
@ -1644,8 +1623,7 @@ ffs_snapgone(ip)
|
||||
* Prepare a snapshot file for being removed.
|
||||
*/
|
||||
void
|
||||
ffs_snapremove(vp)
|
||||
struct vnode *vp;
|
||||
ffs_snapremove(struct vnode *vp)
|
||||
{
|
||||
struct inode *ip;
|
||||
struct vnode *devvp;
|
||||
@ -1774,14 +1752,13 @@ ffs_snapremove(vp)
|
||||
* must always have been allocated from a BLK_NOCOPY location.
|
||||
*/
|
||||
int
|
||||
ffs_snapblkfree(fs, devvp, bno, size, inum, vtype, wkhd)
|
||||
struct fs *fs;
|
||||
struct vnode *devvp;
|
||||
ufs2_daddr_t bno;
|
||||
long size;
|
||||
ino_t inum;
|
||||
enum vtype vtype;
|
||||
struct workhead *wkhd;
|
||||
ffs_snapblkfree(struct fs *fs,
|
||||
struct vnode *devvp,
|
||||
ufs2_daddr_t bno,
|
||||
long size,
|
||||
ino_t inum,
|
||||
enum vtype vtype,
|
||||
struct workhead *wkhd)
|
||||
{
|
||||
struct buf *ibp, *cbp, *savedcbp = NULL;
|
||||
struct thread *td = curthread;
|
||||
@ -1993,8 +1970,7 @@ ffs_snapblkfree(fs, devvp, bno, size, inum, vtype, wkhd)
|
||||
* Associate snapshot files when mounting.
|
||||
*/
|
||||
void
|
||||
ffs_snapshot_mount(mp)
|
||||
struct mount *mp;
|
||||
ffs_snapshot_mount(struct mount *mp)
|
||||
{
|
||||
struct ufsmount *ump = VFSTOUFS(mp);
|
||||
struct vnode *devvp = ump->um_devvp;
|
||||
@ -2133,8 +2109,7 @@ ffs_snapshot_mount(mp)
|
||||
* Disassociate snapshot files when unmounting.
|
||||
*/
|
||||
void
|
||||
ffs_snapshot_unmount(mp)
|
||||
struct mount *mp;
|
||||
ffs_snapshot_unmount(struct mount *mp)
|
||||
{
|
||||
struct vnode *devvp = VFSTOUFS(mp)->um_devvp;
|
||||
struct snapdata *sn;
|
||||
@ -2169,9 +2144,7 @@ ffs_snapshot_unmount(mp)
|
||||
* leaved locked upon exit.
|
||||
*/
|
||||
static int
|
||||
ffs_bp_snapblk(devvp, bp)
|
||||
struct vnode *devvp;
|
||||
struct buf *bp;
|
||||
ffs_bp_snapblk(struct vnode *devvp, struct buf *bp)
|
||||
{
|
||||
struct snapdata *sn;
|
||||
struct fs *fs;
|
||||
@ -2203,9 +2176,7 @@ ffs_bp_snapblk(devvp, bp)
|
||||
}
|
||||
|
||||
void
|
||||
ffs_bdflush(bo, bp)
|
||||
struct bufobj *bo;
|
||||
struct buf *bp;
|
||||
ffs_bdflush(struct bufobj *bo, struct buf *bp)
|
||||
{
|
||||
struct thread *td;
|
||||
struct vnode *vp, *devvp;
|
||||
@ -2279,9 +2250,7 @@ ffs_bdflush(bo, bp)
|
||||
* copying the block if necessary.
|
||||
*/
|
||||
int
|
||||
ffs_copyonwrite(devvp, bp)
|
||||
struct vnode *devvp;
|
||||
struct buf *bp;
|
||||
ffs_copyonwrite(struct vnode *devvp, struct buf *bp)
|
||||
{
|
||||
struct snapdata *sn;
|
||||
struct buf *ibp, *cbp, *savedcbp = NULL;
|
||||
@ -2501,9 +2470,7 @@ ffs_copyonwrite(devvp, bp)
|
||||
* blocks to free.
|
||||
*/
|
||||
void
|
||||
ffs_sync_snap(mp, waitfor)
|
||||
struct mount *mp;
|
||||
int waitfor;
|
||||
ffs_sync_snap(struct mount *mp, int waitfor)
|
||||
{
|
||||
struct snapdata *sn;
|
||||
struct vnode *devvp;
|
||||
@ -2537,10 +2504,9 @@ ffs_sync_snap(mp, waitfor)
|
||||
* Much of this boiler-plate comes from bwrite().
|
||||
*/
|
||||
static int
|
||||
readblock(vp, bp, lbn)
|
||||
struct vnode *vp;
|
||||
struct buf *bp;
|
||||
ufs2_daddr_t lbn;
|
||||
readblock(struct vnode *vp,
|
||||
struct buf *bp,
|
||||
ufs2_daddr_t lbn)
|
||||
{
|
||||
struct inode *ip;
|
||||
struct fs *fs;
|
||||
@ -2688,10 +2654,9 @@ try_free_snapdata(struct vnode *devvp)
|
||||
* get the same number of recursions on the vnode's own lock.
|
||||
*/
|
||||
static void
|
||||
revert_snaplock(vp, devvp, sn)
|
||||
struct vnode *vp;
|
||||
struct vnode *devvp;
|
||||
struct snapdata *sn;
|
||||
revert_snaplock(struct vnode *vp,
|
||||
struct vnode *devvp,
|
||||
struct snapdata *sn)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -903,10 +903,7 @@ ffs_reload(struct mount *mp, int flags)
|
||||
* Common code for mount and mountroot
|
||||
*/
|
||||
static int
|
||||
ffs_mountfs(odevvp, mp, td)
|
||||
struct vnode *odevvp;
|
||||
struct mount *mp;
|
||||
struct thread *td;
|
||||
ffs_mountfs(struct vnode *odevvp, struct mount *mp, struct thread *td)
|
||||
{
|
||||
struct ufsmount *ump;
|
||||
struct fs *fs;
|
||||
@ -1272,10 +1269,9 @@ SYSCTL_INT(_debug, OID_AUTO, bigcgs, CTLFLAG_RW, &bigcgs, 0, "");
|
||||
* Unfortunately new bits get added.
|
||||
*/
|
||||
static void
|
||||
ffs_oldfscompat_read(fs, ump, sblockloc)
|
||||
struct fs *fs;
|
||||
struct ufsmount *ump;
|
||||
ufs2_daddr_t sblockloc;
|
||||
ffs_oldfscompat_read(struct fs *fs,
|
||||
struct ufsmount *ump,
|
||||
ufs2_daddr_t sblockloc)
|
||||
{
|
||||
off_t maxfilesize;
|
||||
|
||||
@ -1332,9 +1328,7 @@ ffs_oldfscompat_read(fs, ump, sblockloc)
|
||||
* Unfortunately new bits get added.
|
||||
*/
|
||||
void
|
||||
ffs_oldfscompat_write(fs, ump)
|
||||
struct fs *fs;
|
||||
struct ufsmount *ump;
|
||||
ffs_oldfscompat_write(struct fs *fs, struct ufsmount *ump)
|
||||
{
|
||||
|
||||
/*
|
||||
@ -1358,9 +1352,7 @@ ffs_oldfscompat_write(fs, ump)
|
||||
* unmount system call
|
||||
*/
|
||||
static int
|
||||
ffs_unmount(mp, mntflags)
|
||||
struct mount *mp;
|
||||
int mntflags;
|
||||
ffs_unmount(struct mount *mp, int mntflags)
|
||||
{
|
||||
struct thread *td;
|
||||
struct ufsmount *ump = VFSTOUFS(mp);
|
||||
@ -1480,10 +1472,7 @@ ffs_unmount(mp, mntflags)
|
||||
* Flush out all the files in a filesystem.
|
||||
*/
|
||||
int
|
||||
ffs_flushfiles(mp, flags, td)
|
||||
struct mount *mp;
|
||||
int flags;
|
||||
struct thread *td;
|
||||
ffs_flushfiles(struct mount *mp, int flags, struct thread *td)
|
||||
{
|
||||
struct ufsmount *ump;
|
||||
int qerror, error;
|
||||
@ -1566,9 +1555,7 @@ ffs_flushfiles(mp, flags, td)
|
||||
* Get filesystem statistics.
|
||||
*/
|
||||
static int
|
||||
ffs_statfs(mp, sbp)
|
||||
struct mount *mp;
|
||||
struct statfs *sbp;
|
||||
ffs_statfs(struct mount *mp, struct statfs *sbp)
|
||||
{
|
||||
struct ufsmount *ump;
|
||||
struct fs *fs;
|
||||
@ -1625,8 +1612,7 @@ ffs_sync_lazy_filter(struct vnode *vp, void *arg __unused)
|
||||
* disk by syncer.
|
||||
*/
|
||||
static int
|
||||
ffs_sync_lazy(mp)
|
||||
struct mount *mp;
|
||||
ffs_sync_lazy(struct mount *mp)
|
||||
{
|
||||
struct vnode *mvp, *vp;
|
||||
struct inode *ip;
|
||||
@ -1684,9 +1670,7 @@ ffs_sync_lazy(mp)
|
||||
* vfs_busy().
|
||||
*/
|
||||
static int
|
||||
ffs_sync(mp, waitfor)
|
||||
struct mount *mp;
|
||||
int waitfor;
|
||||
ffs_sync(struct mount *mp, int waitfor)
|
||||
{
|
||||
struct vnode *mvp, *vp, *devvp;
|
||||
struct thread *td;
|
||||
@ -1831,22 +1815,17 @@ ffs_sync(mp, waitfor)
|
||||
}
|
||||
|
||||
int
|
||||
ffs_vget(mp, ino, flags, vpp)
|
||||
struct mount *mp;
|
||||
ino_t ino;
|
||||
int flags;
|
||||
struct vnode **vpp;
|
||||
ffs_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
|
||||
{
|
||||
return (ffs_vgetf(mp, ino, flags, vpp, 0));
|
||||
}
|
||||
|
||||
int
|
||||
ffs_vgetf(mp, ino, flags, vpp, ffs_flags)
|
||||
struct mount *mp;
|
||||
ino_t ino;
|
||||
int flags;
|
||||
struct vnode **vpp;
|
||||
int ffs_flags;
|
||||
ffs_vgetf(struct mount *mp,
|
||||
ino_t ino,
|
||||
int flags,
|
||||
struct vnode **vpp,
|
||||
int ffs_flags)
|
||||
{
|
||||
struct fs *fs;
|
||||
struct inode *ip;
|
||||
@ -2050,11 +2029,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags)
|
||||
* those rights via. exflagsp and credanonp
|
||||
*/
|
||||
static int
|
||||
ffs_fhtovp(mp, fhp, flags, vpp)
|
||||
struct mount *mp;
|
||||
struct fid *fhp;
|
||||
int flags;
|
||||
struct vnode **vpp;
|
||||
ffs_fhtovp(struct mount *mp, struct fid *fhp, int flags, struct vnode **vpp)
|
||||
{
|
||||
struct ufid *ufhp;
|
||||
|
||||
@ -2064,13 +2039,12 @@ ffs_fhtovp(mp, fhp, flags, vpp)
|
||||
}
|
||||
|
||||
int
|
||||
ffs_inotovp(mp, ino, gen, lflags, vpp, ffs_flags)
|
||||
struct mount *mp;
|
||||
ino_t ino;
|
||||
u_int64_t gen;
|
||||
int lflags;
|
||||
struct vnode **vpp;
|
||||
int ffs_flags;
|
||||
ffs_inotovp(struct mount *mp,
|
||||
ino_t ino,
|
||||
u_int64_t gen,
|
||||
int lflags,
|
||||
struct vnode **vpp,
|
||||
int ffs_flags)
|
||||
{
|
||||
struct ufsmount *ump;
|
||||
struct vnode *nvp;
|
||||
@ -2125,8 +2099,7 @@ ffs_inotovp(mp, ino, gen, lflags, vpp, ffs_flags)
|
||||
* Initialize the filesystem.
|
||||
*/
|
||||
static int
|
||||
ffs_init(vfsp)
|
||||
struct vfsconf *vfsp;
|
||||
ffs_init(struct vfsconf *vfsp)
|
||||
{
|
||||
|
||||
ffs_susp_initialize();
|
||||
@ -2138,8 +2111,7 @@ ffs_init(vfsp)
|
||||
* Undo the work of ffs_init().
|
||||
*/
|
||||
static int
|
||||
ffs_uninit(vfsp)
|
||||
struct vfsconf *vfsp;
|
||||
ffs_uninit(struct vfsconf *vfsp)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -2166,10 +2138,7 @@ struct devfd {
|
||||
* Write a superblock and associated information back to disk.
|
||||
*/
|
||||
int
|
||||
ffs_sbupdate(ump, waitfor, suspended)
|
||||
struct ufsmount *ump;
|
||||
int waitfor;
|
||||
int suspended;
|
||||
ffs_sbupdate(struct ufsmount *ump, int waitfor, int suspended)
|
||||
{
|
||||
struct fs *fs;
|
||||
struct buf *sbbp;
|
||||
|
@ -471,13 +471,13 @@ ffs_fdatasync(struct vop_fdatasync_args *ap)
|
||||
}
|
||||
|
||||
static int
|
||||
ffs_lock(ap)
|
||||
ffs_lock(
|
||||
struct vop_lock1_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_flags;
|
||||
char *file;
|
||||
int line;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
#if !defined(NO_FFS_SNAPSHOT) || defined(DIAGNOSTIC)
|
||||
struct vnode *vp = ap->a_vp;
|
||||
@ -633,13 +633,13 @@ ffs_read_hole(struct uio *uio, long xfersize, long *size)
|
||||
* Vnode op for reading.
|
||||
*/
|
||||
static int
|
||||
ffs_read(ap)
|
||||
ffs_read(
|
||||
struct vop_read_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
int a_ioflag;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp;
|
||||
struct inode *ip;
|
||||
@ -824,13 +824,13 @@ ffs_read(ap)
|
||||
* Vnode op for writing.
|
||||
*/
|
||||
static int
|
||||
ffs_write(ap)
|
||||
ffs_write(
|
||||
struct vop_write_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
int a_ioflag;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp;
|
||||
struct uio *uio;
|
||||
@ -1506,14 +1506,12 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td
|
||||
* Otherwise we just fall through and do the usual thing.
|
||||
*/
|
||||
static int
|
||||
ffsext_strategy(struct vop_strategy_args *ap)
|
||||
/*
|
||||
struct vop_strategy_args {
|
||||
ffsext_strategy(
|
||||
struct vop_strategy_args /* {
|
||||
struct vnodeop_desc *a_desc;
|
||||
struct vnode *a_vp;
|
||||
struct buf *a_bp;
|
||||
};
|
||||
*/
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp;
|
||||
daddr_t lbn;
|
||||
@ -1531,15 +1529,13 @@ struct vop_strategy_args {
|
||||
* Vnode extattr transaction commit/abort
|
||||
*/
|
||||
static int
|
||||
ffs_openextattr(struct vop_openextattr_args *ap)
|
||||
/*
|
||||
struct vop_openextattr_args {
|
||||
ffs_openextattr(
|
||||
struct vop_openextattr_args /* {
|
||||
struct vnodeop_desc *a_desc;
|
||||
struct vnode *a_vp;
|
||||
IN struct ucred *a_cred;
|
||||
IN struct thread *a_td;
|
||||
};
|
||||
*/
|
||||
} */ *ap)
|
||||
{
|
||||
|
||||
if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK)
|
||||
@ -1552,16 +1548,14 @@ struct vop_openextattr_args {
|
||||
* Vnode extattr transaction commit/abort
|
||||
*/
|
||||
static int
|
||||
ffs_closeextattr(struct vop_closeextattr_args *ap)
|
||||
/*
|
||||
struct vop_closeextattr_args {
|
||||
ffs_closeextattr(
|
||||
struct vop_closeextattr_args /* {
|
||||
struct vnodeop_desc *a_desc;
|
||||
struct vnode *a_vp;
|
||||
int a_commit;
|
||||
IN struct ucred *a_cred;
|
||||
IN struct thread *a_td;
|
||||
};
|
||||
*/
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp;
|
||||
|
||||
@ -1584,16 +1578,14 @@ struct vop_closeextattr_args {
|
||||
* Vnode operation to remove a named attribute.
|
||||
*/
|
||||
static int
|
||||
ffs_deleteextattr(struct vop_deleteextattr_args *ap)
|
||||
/*
|
||||
vop_deleteextattr {
|
||||
ffs_deleteextattr(
|
||||
struct vop_deleteextattr_args /* {
|
||||
IN struct vnode *a_vp;
|
||||
IN int a_attrnamespace;
|
||||
IN const char *a_name;
|
||||
IN struct ucred *a_cred;
|
||||
IN struct thread *a_td;
|
||||
};
|
||||
*/
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp;
|
||||
struct inode *ip;
|
||||
@ -1666,9 +1658,8 @@ vop_deleteextattr {
|
||||
* Vnode operation to retrieve a named extended attribute.
|
||||
*/
|
||||
static int
|
||||
ffs_getextattr(struct vop_getextattr_args *ap)
|
||||
/*
|
||||
vop_getextattr {
|
||||
ffs_getextattr(
|
||||
struct vop_getextattr_args /* {
|
||||
IN struct vnode *a_vp;
|
||||
IN int a_attrnamespace;
|
||||
IN const char *a_name;
|
||||
@ -1676,8 +1667,7 @@ vop_getextattr {
|
||||
OUT size_t *a_size;
|
||||
IN struct ucred *a_cred;
|
||||
IN struct thread *a_td;
|
||||
};
|
||||
*/
|
||||
} */ *ap)
|
||||
{
|
||||
struct inode *ip;
|
||||
u_char *eae, *p;
|
||||
@ -1720,17 +1710,15 @@ vop_getextattr {
|
||||
* Vnode operation to retrieve extended attributes on a vnode.
|
||||
*/
|
||||
static int
|
||||
ffs_listextattr(struct vop_listextattr_args *ap)
|
||||
/*
|
||||
vop_listextattr {
|
||||
ffs_listextattr(
|
||||
struct vop_listextattr_args /* {
|
||||
IN struct vnode *a_vp;
|
||||
IN int a_attrnamespace;
|
||||
INOUT struct uio *a_uio;
|
||||
OUT size_t *a_size;
|
||||
IN struct ucred *a_cred;
|
||||
IN struct thread *a_td;
|
||||
};
|
||||
*/
|
||||
} */ *ap)
|
||||
{
|
||||
struct inode *ip;
|
||||
struct extattr *eap, *eaend;
|
||||
@ -1779,17 +1767,15 @@ vop_listextattr {
|
||||
* Vnode operation to set a named attribute.
|
||||
*/
|
||||
static int
|
||||
ffs_setextattr(struct vop_setextattr_args *ap)
|
||||
/*
|
||||
vop_setextattr {
|
||||
ffs_setextattr(
|
||||
struct vop_setextattr_args /* {
|
||||
IN struct vnode *a_vp;
|
||||
IN int a_attrnamespace;
|
||||
IN const char *a_name;
|
||||
INOUT struct uio *a_uio;
|
||||
IN struct ucred *a_cred;
|
||||
IN struct thread *a_td;
|
||||
};
|
||||
*/
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp;
|
||||
struct inode *ip;
|
||||
@ -1910,13 +1896,11 @@ vop_setextattr {
|
||||
* Vnode pointer to File handle
|
||||
*/
|
||||
static int
|
||||
ffs_vptofh(struct vop_vptofh_args *ap)
|
||||
/*
|
||||
vop_vptofh {
|
||||
ffs_vptofh(
|
||||
struct vop_vptofh_args /* {
|
||||
IN struct vnode *a_vp;
|
||||
IN struct fid *a_fhp;
|
||||
};
|
||||
*/
|
||||
} */ *ap)
|
||||
{
|
||||
struct inode *ip;
|
||||
struct ufid *ufhp;
|
||||
|
@ -65,7 +65,7 @@ static int readindir(struct vnode *, ufs_lbn_t, ufs2_daddr_t, struct buf **);
|
||||
* number to index into the array of block pointers described by the dinode.
|
||||
*/
|
||||
int
|
||||
ufs_bmap(ap)
|
||||
ufs_bmap(
|
||||
struct vop_bmap_args /* {
|
||||
struct vnode *a_vp;
|
||||
daddr_t a_bn;
|
||||
@ -73,7 +73,7 @@ ufs_bmap(ap)
|
||||
daddr_t *a_bnp;
|
||||
int *a_runp;
|
||||
int *a_runb;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
ufs2_daddr_t blkno;
|
||||
int error;
|
||||
@ -94,11 +94,10 @@ ufs_bmap(ap)
|
||||
}
|
||||
|
||||
static int
|
||||
readindir(vp, lbn, daddr, bpp)
|
||||
struct vnode *vp;
|
||||
ufs_lbn_t lbn;
|
||||
ufs2_daddr_t daddr;
|
||||
struct buf **bpp;
|
||||
readindir(struct vnode *vp,
|
||||
ufs_lbn_t lbn,
|
||||
ufs2_daddr_t daddr,
|
||||
struct buf **bpp)
|
||||
{
|
||||
struct buf *bp;
|
||||
struct mount *mp;
|
||||
@ -153,13 +152,12 @@ readindir(vp, lbn, daddr, bpp)
|
||||
*/
|
||||
|
||||
int
|
||||
ufs_bmaparray(vp, bn, bnp, nbp, runp, runb)
|
||||
struct vnode *vp;
|
||||
ufs2_daddr_t bn;
|
||||
ufs2_daddr_t *bnp;
|
||||
struct buf *nbp;
|
||||
int *runp;
|
||||
int *runb;
|
||||
ufs_bmaparray(struct vnode *vp,
|
||||
ufs2_daddr_t bn,
|
||||
ufs2_daddr_t *bnp,
|
||||
struct buf *nbp,
|
||||
int *runp,
|
||||
int *runb)
|
||||
{
|
||||
struct inode *ip;
|
||||
struct buf *bp;
|
||||
@ -333,9 +331,7 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb)
|
||||
}
|
||||
|
||||
static ufs_lbn_t
|
||||
lbn_count(ump, level)
|
||||
struct ufsmount *ump;
|
||||
int level;
|
||||
lbn_count(struct ufsmount *ump, int level)
|
||||
{
|
||||
ufs_lbn_t blockcnt;
|
||||
|
||||
@ -345,9 +341,7 @@ lbn_count(ump, level)
|
||||
}
|
||||
|
||||
int
|
||||
ufs_bmap_seekdata(vp, offp)
|
||||
struct vnode *vp;
|
||||
off_t *offp;
|
||||
ufs_bmap_seekdata(struct vnode *vp, off_t *offp)
|
||||
{
|
||||
struct buf *bp;
|
||||
struct indir a[UFS_NIADDR + 1], *ap;
|
||||
@ -448,11 +442,10 @@ ufs_bmap_seekdata(vp, offp)
|
||||
* once with the offset into the page itself.
|
||||
*/
|
||||
int
|
||||
ufs_getlbns(vp, bn, ap, nump)
|
||||
struct vnode *vp;
|
||||
ufs2_daddr_t bn;
|
||||
struct indir *ap;
|
||||
int *nump;
|
||||
ufs_getlbns(struct vnode *vp,
|
||||
ufs2_daddr_t bn,
|
||||
struct indir *ap,
|
||||
int *nump)
|
||||
{
|
||||
ufs2_daddr_t blockcnt;
|
||||
ufs_lbn_t metalbn, realbn;
|
||||
|
@ -810,9 +810,8 @@ ufs_extattrctl(struct mount *mp, int cmd, struct vnode *filename_vp,
|
||||
* Vnode operating to retrieve a named extended attribute.
|
||||
*/
|
||||
int
|
||||
ufs_getextattr(struct vop_getextattr_args *ap)
|
||||
/*
|
||||
vop_getextattr {
|
||||
ufs_getextattr(
|
||||
struct vop_getextattr_args /* {
|
||||
IN struct vnode *a_vp;
|
||||
IN int a_attrnamespace;
|
||||
IN const char *a_name;
|
||||
@ -820,8 +819,7 @@ vop_getextattr {
|
||||
OUT size_t *a_size;
|
||||
IN struct ucred *a_cred;
|
||||
IN struct thread *a_td;
|
||||
};
|
||||
*/
|
||||
} */ *ap)
|
||||
{
|
||||
struct mount *mp = ap->a_vp->v_mount;
|
||||
struct ufsmount *ump = VFSTOUFS(mp);
|
||||
@ -982,16 +980,14 @@ ufs_extattr_get(struct vnode *vp, int attrnamespace, const char *name,
|
||||
* Vnode operation to remove a named attribute.
|
||||
*/
|
||||
int
|
||||
ufs_deleteextattr(struct vop_deleteextattr_args *ap)
|
||||
/*
|
||||
vop_deleteextattr {
|
||||
ufs_deleteextattr(
|
||||
struct vop_deleteextattr_args /* {
|
||||
IN struct vnode *a_vp;
|
||||
IN int a_attrnamespace;
|
||||
IN const char *a_name;
|
||||
IN struct ucred *a_cred;
|
||||
IN struct thread *a_td;
|
||||
};
|
||||
*/
|
||||
} */ *ap)
|
||||
{
|
||||
struct mount *mp = ap->a_vp->v_mount;
|
||||
struct ufsmount *ump = VFSTOUFS(mp);
|
||||
@ -1011,17 +1007,15 @@ vop_deleteextattr {
|
||||
* Vnode operation to set a named attribute.
|
||||
*/
|
||||
int
|
||||
ufs_setextattr(struct vop_setextattr_args *ap)
|
||||
/*
|
||||
vop_setextattr {
|
||||
ufs_setextattr(
|
||||
vop_setextattr_args /* {
|
||||
IN struct vnode *a_vp;
|
||||
IN int a_attrnamespace;
|
||||
IN const char *a_name;
|
||||
INOUT struct uio *a_uio;
|
||||
IN struct ucred *a_cred;
|
||||
IN struct thread *a_td;
|
||||
};
|
||||
*/
|
||||
} */ *ap)
|
||||
{
|
||||
struct mount *mp = ap->a_vp->v_mount;
|
||||
struct ufsmount *ump = VFSTOUFS(mp);
|
||||
|
@ -64,8 +64,7 @@ __FBSDID("$FreeBSD$");
|
||||
#endif
|
||||
|
||||
int
|
||||
ufs_need_inactive(ap)
|
||||
struct vop_need_inactive_args *ap;
|
||||
ufs_need_inactive(struct vop_need_inactive_args *ap)
|
||||
{
|
||||
struct vnode *vp;
|
||||
struct inode *ip;
|
||||
@ -103,10 +102,10 @@ ufs_need_inactive(ap)
|
||||
* Last reference to an inode. If necessary, write or delete it.
|
||||
*/
|
||||
int
|
||||
ufs_inactive(ap)
|
||||
ufs_inactive(
|
||||
struct vop_inactive_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct inode *ip = VTOI(vp);
|
||||
@ -219,10 +218,10 @@ ufs_inactive(ap)
|
||||
* Reclaim an inode so that it can be used for other purposes.
|
||||
*/
|
||||
int
|
||||
ufs_reclaim(ap)
|
||||
ufs_reclaim(
|
||||
struct vop_reclaim_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct inode *ip = VTOI(vp);
|
||||
|
@ -177,12 +177,12 @@ ufs_delete_denied(struct vnode *vdp, struct vnode *tdp, struct ucred *cred,
|
||||
* nor deleting, add name to cache
|
||||
*/
|
||||
int
|
||||
ufs_lookup(ap)
|
||||
ufs_lookup(
|
||||
struct vop_cachedlookup_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode **a_vpp;
|
||||
struct componentname *a_cnp;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
|
||||
return (ufs_lookup_ino(ap->a_dvp, ap->a_vpp, ap->a_cnp, NULL));
|
||||
@ -760,10 +760,7 @@ ufs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp,
|
||||
}
|
||||
|
||||
void
|
||||
ufs_dirbad(ip, offset, how)
|
||||
struct inode *ip;
|
||||
doff_t offset;
|
||||
char *how;
|
||||
ufs_dirbad(struct inode *ip, doff_t offset, char *how)
|
||||
{
|
||||
struct mount *mp;
|
||||
|
||||
@ -787,10 +784,7 @@ ufs_dirbad(ip, offset, how)
|
||||
* name must be as long as advertised, and null terminated
|
||||
*/
|
||||
int
|
||||
ufs_dirbadentry(dp, ep, entryoffsetinblock)
|
||||
struct vnode *dp;
|
||||
struct direct *ep;
|
||||
int entryoffsetinblock;
|
||||
ufs_dirbadentry(struct vnode *dp, struct direct *ep, int entryoffsetinblock)
|
||||
{
|
||||
int i, namlen;
|
||||
|
||||
@ -830,10 +824,8 @@ ufs_dirbadentry(dp, ep, entryoffsetinblock)
|
||||
* argument ip is the inode to which the new directory entry will refer.
|
||||
*/
|
||||
void
|
||||
ufs_makedirentry(ip, cnp, newdirp)
|
||||
struct inode *ip;
|
||||
struct componentname *cnp;
|
||||
struct direct *newdirp;
|
||||
ufs_makedirentry(struct inode *ip, struct componentname *cnp,
|
||||
struct direct *newdirp)
|
||||
{
|
||||
u_int namelen;
|
||||
|
||||
@ -872,12 +864,8 @@ ufs_makedirentry(ip, cnp, newdirp)
|
||||
* soft dependency code).
|
||||
*/
|
||||
int
|
||||
ufs_direnter(dvp, tvp, dirp, cnp, newdirbp)
|
||||
struct vnode *dvp;
|
||||
struct vnode *tvp;
|
||||
struct direct *dirp;
|
||||
struct componentname *cnp;
|
||||
struct buf *newdirbp;
|
||||
ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp,
|
||||
struct componentname *cnp, struct buf *newdirbp)
|
||||
{
|
||||
struct ucred *cr;
|
||||
struct thread *td;
|
||||
@ -1130,11 +1118,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp)
|
||||
* to the size of the previous entry.
|
||||
*/
|
||||
int
|
||||
ufs_dirremove(dvp, ip, flags, isrmdir)
|
||||
struct vnode *dvp;
|
||||
struct inode *ip;
|
||||
int flags;
|
||||
int isrmdir;
|
||||
ufs_dirremove(struct vnode *dvp, struct inode *ip, int flags, int isrmdir)
|
||||
{
|
||||
struct inode *dp;
|
||||
struct direct *ep, *rep;
|
||||
@ -1256,11 +1240,8 @@ ufs_dirremove(dvp, ip, flags, isrmdir)
|
||||
* set up by a call to namei.
|
||||
*/
|
||||
int
|
||||
ufs_dirrewrite(dp, oip, newinum, newtype, isrmdir)
|
||||
struct inode *dp, *oip;
|
||||
ino_t newinum;
|
||||
int newtype;
|
||||
int isrmdir;
|
||||
ufs_dirrewrite(struct inode *dp, struct inode *oip, ino_t newinum, int newtype,
|
||||
int isrmdir)
|
||||
{
|
||||
struct buf *bp;
|
||||
struct direct *ep;
|
||||
@ -1334,10 +1315,7 @@ ufs_dirrewrite(dp, oip, newinum, newtype, isrmdir)
|
||||
* NB: does not handle corrupted directories.
|
||||
*/
|
||||
int
|
||||
ufs_dirempty(ip, parentino, cred)
|
||||
struct inode *ip;
|
||||
ino_t parentino;
|
||||
struct ucred *cred;
|
||||
ufs_dirempty(struct inode *ip, ino_t parentino, struct ucred *cred)
|
||||
{
|
||||
doff_t off;
|
||||
struct dirtemplate dbuf;
|
||||
|
@ -1681,9 +1681,7 @@ dqflush(struct vnode *vp)
|
||||
* Return count of number of quota structures found.
|
||||
*/
|
||||
int
|
||||
quotaref(vp, qrp)
|
||||
struct vnode *vp;
|
||||
struct dquot **qrp;
|
||||
quotaref(struct vnode *vp, struct dquot **qrp)
|
||||
{
|
||||
struct inode *ip;
|
||||
struct dquot *dq;
|
||||
@ -1718,8 +1716,7 @@ quotaref(vp, qrp)
|
||||
* Release a set of quota structures obtained from a vnode.
|
||||
*/
|
||||
void
|
||||
quotarele(qrp)
|
||||
struct dquot **qrp;
|
||||
quotarele(struct dquot **qrp)
|
||||
{
|
||||
struct dquot *dq;
|
||||
int i;
|
||||
@ -1736,10 +1733,7 @@ quotarele(qrp)
|
||||
* Positive numbers when adding blocks; negative numbers when freeing blocks.
|
||||
*/
|
||||
void
|
||||
quotaadj(qrp, ump, blkcount)
|
||||
struct dquot **qrp;
|
||||
struct ufsmount *ump;
|
||||
int64_t blkcount;
|
||||
quotaadj(struct dquot **qrp, struct ufsmount *ump, int64_t blkcount)
|
||||
{
|
||||
struct dquot *dq;
|
||||
ufs2_daddr_t ncurblocks;
|
||||
|
@ -68,10 +68,7 @@ MALLOC_DEFINE(M_UFSMNT, "ufs_mount", "UFS mount structure");
|
||||
* Return the root of a filesystem.
|
||||
*/
|
||||
int
|
||||
ufs_root(mp, flags, vpp)
|
||||
struct mount *mp;
|
||||
int flags;
|
||||
struct vnode **vpp;
|
||||
ufs_root(struct mount *mp, int flags, struct vnode **vpp)
|
||||
{
|
||||
struct vnode *nvp;
|
||||
int error;
|
||||
@ -87,12 +84,7 @@ ufs_root(mp, flags, vpp)
|
||||
* Do operations associated with quotas
|
||||
*/
|
||||
int
|
||||
ufs_quotactl(mp, cmds, id, arg, mp_busy)
|
||||
struct mount *mp;
|
||||
int cmds;
|
||||
uid_t id;
|
||||
void *arg;
|
||||
bool *mp_busy;
|
||||
ufs_quotactl(struct mount *mp, int cmds, uid_t id, void *arg, bool *mp_busy)
|
||||
{
|
||||
#ifndef QUOTA
|
||||
return (EOPNOTSUPP);
|
||||
@ -180,8 +172,7 @@ ufs_quotactl(mp, cmds, id, arg, mp_busy)
|
||||
* Initial UFS filesystems, done only once.
|
||||
*/
|
||||
int
|
||||
ufs_init(vfsp)
|
||||
struct vfsconf *vfsp;
|
||||
ufs_init(struct vfsconf *vfsp)
|
||||
{
|
||||
|
||||
#ifdef QUOTA
|
||||
@ -197,8 +188,7 @@ ufs_init(vfsp)
|
||||
* Uninitialise UFS filesystems, done before module unload.
|
||||
*/
|
||||
int
|
||||
ufs_uninit(vfsp)
|
||||
struct vfsconf *vfsp;
|
||||
ufs_uninit(struct vfsconf *vfsp)
|
||||
{
|
||||
|
||||
#ifdef QUOTA
|
||||
|
@ -238,13 +238,13 @@ ufs_sync_nlink(struct vnode *vp, struct vnode *vp1)
|
||||
* Create a regular file
|
||||
*/
|
||||
static int
|
||||
ufs_create(ap)
|
||||
ufs_create(
|
||||
struct vop_create_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode **a_vpp;
|
||||
struct componentname *a_cnp;
|
||||
struct vattr *a_vap;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
int error;
|
||||
|
||||
@ -263,13 +263,13 @@ ufs_create(ap)
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
ufs_mknod(ap)
|
||||
ufs_mknod(
|
||||
struct vop_mknod_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode **a_vpp;
|
||||
struct componentname *a_cnp;
|
||||
struct vattr *a_vap;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vattr *vap = ap->a_vap;
|
||||
struct vnode **vpp = ap->a_vpp;
|
||||
@ -345,13 +345,13 @@ ufs_open(struct vop_open_args *ap)
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
ufs_close(ap)
|
||||
ufs_close(
|
||||
struct vop_close_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_fflag;
|
||||
struct ucred *a_cred;
|
||||
struct thread *a_td;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp = ap->a_vp;
|
||||
int usecount;
|
||||
@ -365,13 +365,13 @@ ufs_close(ap)
|
||||
}
|
||||
|
||||
static int
|
||||
ufs_accessx(ap)
|
||||
ufs_accessx(
|
||||
struct vop_accessx_args /* {
|
||||
struct vnode *a_vp;
|
||||
accmode_t a_accmode;
|
||||
struct ucred *a_cred;
|
||||
struct thread *a_td;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct inode *ip = VTOI(vp);
|
||||
@ -478,12 +478,12 @@ ufs_accessx(ap)
|
||||
* the comment above cache_fplookup for details.
|
||||
*/
|
||||
static int
|
||||
ufs_fplookup_vexec(ap)
|
||||
ufs_fplookup_vexec(
|
||||
struct vop_fplookup_vexec_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct ucred *a_cred;
|
||||
struct thread *a_td;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp;
|
||||
struct inode *ip;
|
||||
@ -574,12 +574,12 @@ ufs_stat(struct vop_stat_args *ap)
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
ufs_getattr(ap)
|
||||
ufs_getattr(
|
||||
struct vop_getattr_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct vattr *a_vap;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct inode *ip = VTOI(vp);
|
||||
@ -636,12 +636,12 @@ ufs_getattr(ap)
|
||||
* Set attribute vnode op. called from several syscalls
|
||||
*/
|
||||
static int
|
||||
ufs_setattr(ap)
|
||||
ufs_setattr(
|
||||
struct vop_setattr_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct vattr *a_vap;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vattr *vap = ap->a_vap;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
@ -828,10 +828,10 @@ ufs_update_nfs4_acl_after_mode_change(struct vnode *vp, int mode,
|
||||
#endif /* UFS_ACL */
|
||||
|
||||
static int
|
||||
ufs_mmapped(ap)
|
||||
ufs_mmapped(
|
||||
struct vop_mmapped_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp;
|
||||
struct inode *ip;
|
||||
@ -854,11 +854,7 @@ ufs_mmapped(ap)
|
||||
* Inode must be locked before calling.
|
||||
*/
|
||||
static int
|
||||
ufs_chmod(vp, mode, cred, td)
|
||||
struct vnode *vp;
|
||||
int mode;
|
||||
struct ucred *cred;
|
||||
struct thread *td;
|
||||
ufs_chmod(struct vnode *vp, int mode, struct ucred *cred, struct thread *td)
|
||||
{
|
||||
struct inode *ip = VTOI(vp);
|
||||
int newmode, error;
|
||||
@ -914,12 +910,8 @@ ufs_chmod(vp, mode, cred, td)
|
||||
* inode must be locked prior to call.
|
||||
*/
|
||||
static int
|
||||
ufs_chown(vp, uid, gid, cred, td)
|
||||
struct vnode *vp;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
struct ucred *cred;
|
||||
struct thread *td;
|
||||
ufs_chown(struct vnode *vp, uid_t uid, gid_t gid, struct ucred *cred,
|
||||
struct thread *td)
|
||||
{
|
||||
struct inode *ip = VTOI(vp);
|
||||
uid_t ouid;
|
||||
@ -1029,12 +1021,12 @@ ufs_chown(vp, uid, gid, cred, td)
|
||||
}
|
||||
|
||||
static int
|
||||
ufs_remove(ap)
|
||||
ufs_remove(
|
||||
struct vop_remove_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode *a_vp;
|
||||
struct componentname *a_cnp;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct inode *ip;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
@ -1093,12 +1085,12 @@ print_bad_link_count(const char *funcname, struct vnode *dvp)
|
||||
* link vnode call
|
||||
*/
|
||||
static int
|
||||
ufs_link(ap)
|
||||
ufs_link(
|
||||
struct vop_link_args /* {
|
||||
struct vnode *a_tdvp;
|
||||
struct vnode *a_vp;
|
||||
struct componentname *a_cnp;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct vnode *tdvp = ap->a_tdvp;
|
||||
@ -1171,12 +1163,12 @@ ufs_link(ap)
|
||||
* whiteout vnode call
|
||||
*/
|
||||
static int
|
||||
ufs_whiteout(ap)
|
||||
ufs_whiteout(
|
||||
struct vop_whiteout_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct componentname *a_cnp;
|
||||
int a_flags;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *dvp = ap->a_dvp;
|
||||
struct componentname *cnp = ap->a_cnp;
|
||||
@ -1261,7 +1253,7 @@ SYSCTL_INT(_vfs_ufs, OID_AUTO, rename_restarts, CTLFLAG_RD,
|
||||
* directory.
|
||||
*/
|
||||
static int
|
||||
ufs_rename(ap)
|
||||
ufs_rename(
|
||||
struct vop_rename_args /* {
|
||||
struct vnode *a_fdvp;
|
||||
struct vnode *a_fvp;
|
||||
@ -1269,7 +1261,7 @@ ufs_rename(ap)
|
||||
struct vnode *a_tdvp;
|
||||
struct vnode *a_tvp;
|
||||
struct componentname *a_tcnp;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *tvp = ap->a_tvp;
|
||||
struct vnode *tdvp = ap->a_tdvp;
|
||||
@ -2009,13 +2001,13 @@ ufs_do_nfs4_acl_inheritance(struct vnode *dvp, struct vnode *tvp,
|
||||
* Mkdir system call
|
||||
*/
|
||||
static int
|
||||
ufs_mkdir(ap)
|
||||
ufs_mkdir(
|
||||
struct vop_mkdir_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode **a_vpp;
|
||||
struct componentname *a_cnp;
|
||||
struct vattr *a_vap;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *dvp = ap->a_dvp;
|
||||
struct vattr *vap = ap->a_vap;
|
||||
@ -2270,12 +2262,12 @@ ufs_mkdir(ap)
|
||||
* Rmdir system call.
|
||||
*/
|
||||
static int
|
||||
ufs_rmdir(ap)
|
||||
ufs_rmdir(
|
||||
struct vop_rmdir_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode *a_vp;
|
||||
struct componentname *a_cnp;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct vnode *dvp = ap->a_dvp;
|
||||
@ -2372,14 +2364,14 @@ ufs_rmdir(ap)
|
||||
* symlink -- make a symbolic link
|
||||
*/
|
||||
static int
|
||||
ufs_symlink(ap)
|
||||
ufs_symlink(
|
||||
struct vop_symlink_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode **a_vpp;
|
||||
struct componentname *a_cnp;
|
||||
struct vattr *a_vap;
|
||||
const char *a_target;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp, **vpp = ap->a_vpp;
|
||||
struct inode *ip;
|
||||
@ -2411,7 +2403,7 @@ ufs_symlink(ap)
|
||||
* Vnode op for reading directories.
|
||||
*/
|
||||
int
|
||||
ufs_readdir(ap)
|
||||
ufs_readdir(
|
||||
struct vop_readdir_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
@ -2419,7 +2411,7 @@ ufs_readdir(ap)
|
||||
int *a_eofflag;
|
||||
int *a_ncookies;
|
||||
uint64_t **a_cookies;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct uio *uio = ap->a_uio;
|
||||
@ -2550,12 +2542,12 @@ ufs_readdir(ap)
|
||||
* Return target name of a symbolic link
|
||||
*/
|
||||
static int
|
||||
ufs_readlink(ap)
|
||||
ufs_readlink(
|
||||
struct vop_readlink_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct inode *ip = VTOI(vp);
|
||||
@ -2575,11 +2567,11 @@ ufs_readlink(ap)
|
||||
* deadlock on memory. See ufs_bmap() for details.
|
||||
*/
|
||||
static int
|
||||
ufs_strategy(ap)
|
||||
ufs_strategy(
|
||||
struct vop_strategy_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct buf *a_bp;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct buf *bp = ap->a_bp;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
@ -2611,10 +2603,10 @@ ufs_strategy(ap)
|
||||
* Print out the contents of an inode.
|
||||
*/
|
||||
static int
|
||||
ufs_print(ap)
|
||||
ufs_print(
|
||||
struct vop_print_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct inode *ip = VTOI(vp);
|
||||
@ -2640,13 +2632,13 @@ ufs_print(ap)
|
||||
* Update the times on the inode then do device close.
|
||||
*/
|
||||
static int
|
||||
ufsfifo_close(ap)
|
||||
ufsfifo_close(
|
||||
struct vop_close_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_fflag;
|
||||
struct ucred *a_cred;
|
||||
struct thread *a_td;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
struct vnode *vp = ap->a_vp;
|
||||
int usecount;
|
||||
@ -2663,12 +2655,12 @@ ufsfifo_close(ap)
|
||||
* Return POSIX pathconf information applicable to ufs filesystems.
|
||||
*/
|
||||
static int
|
||||
ufs_pathconf(ap)
|
||||
ufs_pathconf(
|
||||
struct vop_pathconf_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_name;
|
||||
int *a_retval;
|
||||
} */ *ap;
|
||||
} */ *ap)
|
||||
{
|
||||
int error;
|
||||
|
||||
@ -2767,10 +2759,7 @@ ufs_pathconf(ap)
|
||||
* vnodes.
|
||||
*/
|
||||
int
|
||||
ufs_vinit(mntp, fifoops, vpp)
|
||||
struct mount *mntp;
|
||||
struct vop_vector *fifoops;
|
||||
struct vnode **vpp;
|
||||
ufs_vinit(struct mount *mntp, struct vop_vector *fifoops, struct vnode **vpp)
|
||||
{
|
||||
struct inode *ip;
|
||||
struct vnode *vp;
|
||||
@ -2797,12 +2786,8 @@ ufs_vinit(mntp, fifoops, vpp)
|
||||
* Vnode dvp must be locked.
|
||||
*/
|
||||
static int
|
||||
ufs_makeinode(mode, dvp, vpp, cnp, callfunc)
|
||||
int mode;
|
||||
struct vnode *dvp;
|
||||
struct vnode **vpp;
|
||||
struct componentname *cnp;
|
||||
const char *callfunc;
|
||||
ufs_makeinode(int mode, struct vnode *dvp, struct vnode **vpp,
|
||||
struct componentname *cnp, const char *callfunc)
|
||||
{
|
||||
struct inode *ip, *pdir;
|
||||
struct direct newdir;
|
||||
|
Loading…
Reference in New Issue
Block a user