Commit 07f08be5 authored by Nathan Scott's avatar Nathan Scott

[XFS] whitespace and code formatting changes

parent a3510967
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
STATIC struct quotactl_ops linvfs_qops; STATIC struct quotactl_ops linvfs_qops;
STATIC struct super_operations linvfs_sops; STATIC struct super_operations linvfs_sops;
STATIC struct export_operations linvfs_export_ops; STATIC struct export_operations linvfs_export_ops;
STATIC kmem_cache_t * linvfs_inode_cachep;
#define MNTOPT_LOGBUFS "logbufs" /* number of XFS log buffers */ #define MNTOPT_LOGBUFS "logbufs" /* number of XFS log buffers */
#define MNTOPT_LOGBSIZE "logbsize" /* size of XFS log buffers */ #define MNTOPT_LOGBSIZE "logbsize" /* size of XFS log buffers */
...@@ -320,11 +321,11 @@ xfs_set_inodeops( ...@@ -320,11 +321,11 @@ xfs_set_inodeops(
STATIC __inline__ void STATIC __inline__ void
xfs_revalidate_inode( xfs_revalidate_inode(
xfs_mount_t *mp, xfs_mount_t *mp,
vnode_t *vp, vnode_t *vp,
xfs_inode_t *ip) xfs_inode_t *ip)
{ {
struct inode *inode = LINVFS_GET_IP(vp); struct inode *inode = LINVFS_GET_IP(vp);
inode->i_mode = (ip->i_d.di_mode & MODEMASK) | VTTOIF(vp->v_type); inode->i_mode = (ip->i_d.di_mode & MODEMASK) | VTTOIF(vp->v_type);
inode->i_nlink = ip->i_d.di_nlink; inode->i_nlink = ip->i_d.di_nlink;
...@@ -353,21 +354,22 @@ xfs_revalidate_inode( ...@@ -353,21 +354,22 @@ xfs_revalidate_inode(
void void
xfs_initialize_vnode( xfs_initialize_vnode(
bhv_desc_t *bdp, bhv_desc_t *bdp,
vnode_t *vp, vnode_t *vp,
bhv_desc_t *inode_bhv, bhv_desc_t *inode_bhv,
int unlock) int unlock)
{ {
xfs_inode_t *ip = XFS_BHVTOI(inode_bhv); xfs_inode_t *ip = XFS_BHVTOI(inode_bhv);
struct inode *inode = LINVFS_GET_IP(vp); struct inode *inode = LINVFS_GET_IP(vp);
if (inode_bhv->bd_vobj == NULL) { if (!inode_bhv->bd_vobj) {
vp->v_vfsp = bhvtovfs(bdp); vp->v_vfsp = bhvtovfs(bdp);
bhv_desc_init(inode_bhv, ip, vp, &xfs_vnodeops); bhv_desc_init(inode_bhv, ip, vp, &xfs_vnodeops);
bhv_insert(VN_BHV_HEAD(vp), inode_bhv); bhv_insert(VN_BHV_HEAD(vp), inode_bhv);
} }
vp->v_type = IFTOVT(ip->i_d.di_mode); vp->v_type = IFTOVT(ip->i_d.di_mode);
/* Have we been called during the new inode create process, /* Have we been called during the new inode create process,
* in which case we are too early to fill in the Linux inode. * in which case we are too early to fill in the Linux inode.
*/ */
...@@ -466,8 +468,6 @@ xfs_alloc_buftarg( ...@@ -466,8 +468,6 @@ xfs_alloc_buftarg(
return btp; return btp;
} }
STATIC kmem_cache_t * linvfs_inode_cachep;
STATIC __inline__ unsigned int gfp_mask(void) STATIC __inline__ unsigned int gfp_mask(void)
{ {
/* If we're not in a transaction, FS activity is ok */ /* If we're not in a transaction, FS activity is ok */
...@@ -475,7 +475,6 @@ STATIC __inline__ unsigned int gfp_mask(void) ...@@ -475,7 +475,6 @@ STATIC __inline__ unsigned int gfp_mask(void)
return GFP_KERNEL; return GFP_KERNEL;
} }
STATIC struct inode * STATIC struct inode *
linvfs_alloc_inode( linvfs_alloc_inode(
struct super_block *sb) struct super_block *sb)
...@@ -937,49 +936,6 @@ STATIC struct file_system_type xfs_fs_type = { ...@@ -937,49 +936,6 @@ STATIC struct file_system_type xfs_fs_type = {
}; };
void
bhv_remove_vfsops(
struct vfs *vfsp,
int pos)
{
struct bhv_desc *bhv;
bhv = bhv_lookup_range(&vfsp->vfs_bh, pos, pos);
if (!bhv)
return;
bhv_remove(&vfsp->vfs_bh, bhv);
kmem_free(bhv, sizeof(*bhv));
}
void
bhv_remove_all_vfsops(
struct vfs *vfsp,
int freebase)
{
struct xfs_mount *mp;
bhv_remove_vfsops(vfsp, VFS_POSITION_QM);
bhv_remove_vfsops(vfsp, VFS_POSITION_DM);
if (!freebase)
return;
mp = XFS_BHVTOM(bhv_lookup(VFS_BHVHEAD(vfsp), &xfs_vfsops));
VFS_REMOVEBHV(vfsp, &mp->m_bhv);
xfs_mount_free(mp, 0);
}
void
bhv_insert_all_vfsops(
struct vfs *vfsp)
{
struct xfs_mount *mp;
mp = xfs_mount_init();
vfs_insertbhv(vfsp, &mp->m_bhv, &xfs_vfsops, mp);
vfs_insertdmapi(vfsp);
vfs_insertquota(vfsp);
}
STATIC int __init STATIC int __init
init_xfs_fs( void ) init_xfs_fs( void )
{ {
...@@ -1000,6 +956,10 @@ init_xfs_fs( void ) ...@@ -1000,6 +956,10 @@ init_xfs_fs( void )
error = pagebuf_init(); error = pagebuf_init();
if (error < 0) if (error < 0)
goto undo_pagebuf; goto undo_pagebuf;
vn_init();
xfs_init();
error = vfs_initdmapi(); error = vfs_initdmapi();
if (error < 0) if (error < 0)
goto undo_dmapi; goto undo_dmapi;
...@@ -1007,9 +967,6 @@ init_xfs_fs( void ) ...@@ -1007,9 +967,6 @@ init_xfs_fs( void )
if (error < 0) if (error < 0)
goto undo_quota; goto undo_quota;
vn_init();
xfs_init();
error = register_filesystem(&xfs_fs_type); error = register_filesystem(&xfs_fs_type);
if (error) if (error)
goto undo_fs; goto undo_fs;
...@@ -1030,8 +987,8 @@ init_xfs_fs( void ) ...@@ -1030,8 +987,8 @@ init_xfs_fs( void )
STATIC void __exit STATIC void __exit
exit_xfs_fs( void ) exit_xfs_fs( void )
{ {
xfs_cleanup();
unregister_filesystem(&xfs_fs_type); unregister_filesystem(&xfs_fs_type);
xfs_cleanup();
vfs_exitquota(); vfs_exitquota();
vfs_exitdmapi(); vfs_exitdmapi();
pagebuf_terminate(); pagebuf_terminate();
......
...@@ -111,8 +111,4 @@ extern void xfs_free_buftarg(struct pb_target *); ...@@ -111,8 +111,4 @@ extern void xfs_free_buftarg(struct pb_target *);
extern void xfs_setsize_buftarg(struct pb_target *, unsigned int, unsigned int); extern void xfs_setsize_buftarg(struct pb_target *, unsigned int, unsigned int);
extern unsigned int xfs_getsize_buftarg(struct pb_target *); extern unsigned int xfs_getsize_buftarg(struct pb_target *);
extern void bhv_insert_all_vfsops(struct vfs *);
extern void bhv_remove_all_vfsops(struct vfs *, int);
extern void bhv_remove_vfsops(struct vfs *, int);
#endif /* __XFS_SUPER_H__ */ #endif /* __XFS_SUPER_H__ */
...@@ -33,9 +33,13 @@ ...@@ -33,9 +33,13 @@
#include <xfs.h> #include <xfs.h>
int int
vfs_mount(bhv_desc_t *bdp, struct xfs_mount_args *args, struct cred *cr) vfs_mount(
struct bhv_desc *bdp,
struct xfs_mount_args *args,
struct cred *cr)
{ {
bhv_desc_t *next = bdp; struct bhv_desc *next = bdp;
ASSERT(next); ASSERT(next);
while (! (bhvtovfsops(next))->vfs_mount) while (! (bhvtovfsops(next))->vfs_mount)
next = BHV_NEXT(next); next = BHV_NEXT(next);
...@@ -43,9 +47,14 @@ vfs_mount(bhv_desc_t *bdp, struct xfs_mount_args *args, struct cred *cr) ...@@ -43,9 +47,14 @@ vfs_mount(bhv_desc_t *bdp, struct xfs_mount_args *args, struct cred *cr)
} }
int int
vfs_parseargs(bhv_desc_t *bdp, char *s, struct xfs_mount_args *args, int f) vfs_parseargs(
struct bhv_desc *bdp,
char *s,
struct xfs_mount_args *args,
int f)
{ {
bhv_desc_t *next = bdp; struct bhv_desc *next = bdp;
ASSERT(next); ASSERT(next);
while (! (bhvtovfsops(next))->vfs_parseargs) while (! (bhvtovfsops(next))->vfs_parseargs)
next = BHV_NEXT(next); next = BHV_NEXT(next);
...@@ -53,9 +62,12 @@ vfs_parseargs(bhv_desc_t *bdp, char *s, struct xfs_mount_args *args, int f) ...@@ -53,9 +62,12 @@ vfs_parseargs(bhv_desc_t *bdp, char *s, struct xfs_mount_args *args, int f)
} }
int int
vfs_showargs(bhv_desc_t *bdp, struct seq_file *m) vfs_showargs(
struct bhv_desc *bdp,
struct seq_file *m)
{ {
bhv_desc_t *next = bdp; struct bhv_desc *next = bdp;
ASSERT(next); ASSERT(next);
while (! (bhvtovfsops(next))->vfs_showargs) while (! (bhvtovfsops(next))->vfs_showargs)
next = BHV_NEXT(next); next = BHV_NEXT(next);
...@@ -63,9 +75,13 @@ vfs_showargs(bhv_desc_t *bdp, struct seq_file *m) ...@@ -63,9 +75,13 @@ vfs_showargs(bhv_desc_t *bdp, struct seq_file *m)
} }
int int
vfs_unmount(bhv_desc_t *bdp, int fl, struct cred *cr) vfs_unmount(
struct bhv_desc *bdp,
int fl,
struct cred *cr)
{ {
bhv_desc_t *next = bdp; struct bhv_desc *next = bdp;
ASSERT(next); ASSERT(next);
while (! (bhvtovfsops(next))->vfs_unmount) while (! (bhvtovfsops(next))->vfs_unmount)
next = BHV_NEXT(next); next = BHV_NEXT(next);
...@@ -73,9 +89,12 @@ vfs_unmount(bhv_desc_t *bdp, int fl, struct cred *cr) ...@@ -73,9 +89,12 @@ vfs_unmount(bhv_desc_t *bdp, int fl, struct cred *cr)
} }
int int
vfs_root(bhv_desc_t *bdp, struct vnode **vpp) vfs_root(
struct bhv_desc *bdp,
struct vnode **vpp)
{ {
bhv_desc_t *next = bdp; struct bhv_desc *next = bdp;
ASSERT(next); ASSERT(next);
while (! (bhvtovfsops(next))->vfs_root) while (! (bhvtovfsops(next))->vfs_root)
next = BHV_NEXT(next); next = BHV_NEXT(next);
...@@ -83,9 +102,13 @@ vfs_root(bhv_desc_t *bdp, struct vnode **vpp) ...@@ -83,9 +102,13 @@ vfs_root(bhv_desc_t *bdp, struct vnode **vpp)
} }
int int
vfs_statvfs(bhv_desc_t *bdp, struct statfs *sp, struct vnode *vp) vfs_statvfs(
struct bhv_desc *bdp,
struct statfs *sp,
struct vnode *vp)
{ {
bhv_desc_t *next = bdp; struct bhv_desc *next = bdp;
ASSERT(next); ASSERT(next);
while (! (bhvtovfsops(next))->vfs_statvfs) while (! (bhvtovfsops(next))->vfs_statvfs)
next = BHV_NEXT(next); next = BHV_NEXT(next);
...@@ -93,9 +116,13 @@ vfs_statvfs(bhv_desc_t *bdp, struct statfs *sp, struct vnode *vp) ...@@ -93,9 +116,13 @@ vfs_statvfs(bhv_desc_t *bdp, struct statfs *sp, struct vnode *vp)
} }
int int
vfs_sync(bhv_desc_t *bdp, int fl, struct cred *cr) vfs_sync(
struct bhv_desc *bdp,
int fl,
struct cred *cr)
{ {
bhv_desc_t *next = bdp; struct bhv_desc *next = bdp;
ASSERT(next); ASSERT(next);
while (! (bhvtovfsops(next))->vfs_sync) while (! (bhvtovfsops(next))->vfs_sync)
next = BHV_NEXT(next); next = BHV_NEXT(next);
...@@ -103,9 +130,13 @@ vfs_sync(bhv_desc_t *bdp, int fl, struct cred *cr) ...@@ -103,9 +130,13 @@ vfs_sync(bhv_desc_t *bdp, int fl, struct cred *cr)
} }
int int
vfs_vget(bhv_desc_t *bdp, struct vnode **vpp, struct fid *fidp) vfs_vget(
struct bhv_desc *bdp,
struct vnode **vpp,
struct fid *fidp)
{ {
bhv_desc_t *next = bdp; struct bhv_desc *next = bdp;
ASSERT(next); ASSERT(next);
while (! (bhvtovfsops(next))->vfs_vget) while (! (bhvtovfsops(next))->vfs_vget)
next = BHV_NEXT(next); next = BHV_NEXT(next);
...@@ -113,9 +144,12 @@ vfs_vget(bhv_desc_t *bdp, struct vnode **vpp, struct fid *fidp) ...@@ -113,9 +144,12 @@ vfs_vget(bhv_desc_t *bdp, struct vnode **vpp, struct fid *fidp)
} }
int int
vfs_dmapiops(bhv_desc_t *bdp, caddr_t addr) vfs_dmapiops(
struct bhv_desc *bdp,
caddr_t addr)
{ {
bhv_desc_t *next = bdp; struct bhv_desc *next = bdp;
ASSERT(next); ASSERT(next);
while (! (bhvtovfsops(next))->vfs_dmapiops) while (! (bhvtovfsops(next))->vfs_dmapiops)
next = BHV_NEXT(next); next = BHV_NEXT(next);
...@@ -123,9 +157,14 @@ vfs_dmapiops(bhv_desc_t *bdp, caddr_t addr) ...@@ -123,9 +157,14 @@ vfs_dmapiops(bhv_desc_t *bdp, caddr_t addr)
} }
int int
vfs_quotactl(bhv_desc_t *bdp, int cmd, int id, caddr_t addr) vfs_quotactl(
struct bhv_desc *bdp,
int cmd,
int id,
caddr_t addr)
{ {
bhv_desc_t *next = bdp; struct bhv_desc *next = bdp;
ASSERT(next); ASSERT(next);
while (! (bhvtovfsops(next))->vfs_quotactl) while (! (bhvtovfsops(next))->vfs_quotactl)
next = BHV_NEXT(next); next = BHV_NEXT(next);
...@@ -133,9 +172,14 @@ vfs_quotactl(bhv_desc_t *bdp, int cmd, int id, caddr_t addr) ...@@ -133,9 +172,14 @@ vfs_quotactl(bhv_desc_t *bdp, int cmd, int id, caddr_t addr)
} }
void void
vfs_init_vnode(bhv_desc_t *bdp, struct vnode *vp, bhv_desc_t *bp, int unlock) vfs_init_vnode(
struct bhv_desc *bdp,
struct vnode *vp,
struct bhv_desc *bp,
int unlock)
{ {
bhv_desc_t *next = bdp; struct bhv_desc *next = bdp;
ASSERT(next); ASSERT(next);
while (! (bhvtovfsops(next))->vfs_init_vnode) while (! (bhvtovfsops(next))->vfs_init_vnode)
next = BHV_NEXT(next); next = BHV_NEXT(next);
...@@ -143,9 +187,14 @@ vfs_init_vnode(bhv_desc_t *bdp, struct vnode *vp, bhv_desc_t *bp, int unlock) ...@@ -143,9 +187,14 @@ vfs_init_vnode(bhv_desc_t *bdp, struct vnode *vp, bhv_desc_t *bp, int unlock)
} }
void void
vfs_force_shutdown(bhv_desc_t *bdp, int fl, char *file, int line) vfs_force_shutdown(
struct bhv_desc *bdp,
int fl,
char *file,
int line)
{ {
bhv_desc_t *next = bdp; struct bhv_desc *next = bdp;
ASSERT(next); ASSERT(next);
while (! (bhvtovfsops(next))->vfs_force_shutdown) while (! (bhvtovfsops(next))->vfs_force_shutdown)
next = BHV_NEXT(next); next = BHV_NEXT(next);
...@@ -153,31 +202,84 @@ vfs_force_shutdown(bhv_desc_t *bdp, int fl, char *file, int line) ...@@ -153,31 +202,84 @@ vfs_force_shutdown(bhv_desc_t *bdp, int fl, char *file, int line)
} }
vfs_t * vfs_t *
vfs_allocate(void) vfs_allocate( void )
{ {
vfs_t *vfsp = kmem_zalloc(sizeof(vfs_t), KM_SLEEP); struct vfs *vfsp;
vfsp = kmem_zalloc(sizeof(vfs_t), KM_SLEEP);
bhv_head_init(VFS_BHVHEAD(vfsp), "vfs"); bhv_head_init(VFS_BHVHEAD(vfsp), "vfs");
return vfsp; return vfsp;
} }
void void
vfs_deallocate(vfs_t *vfsp) vfs_deallocate(
struct vfs *vfsp)
{ {
bhv_head_destroy(VFS_BHVHEAD(vfsp)); bhv_head_destroy(VFS_BHVHEAD(vfsp));
kmem_free(vfsp, sizeof(vfs_t)); kmem_free(vfsp, sizeof(vfs_t));
} }
void void
vfs_insertops(vfs_t *vfsp, vfsops_t *vfsops) vfs_insertops(
struct vfs *vfsp,
struct vfsops *vfsops)
{ {
bhv_desc_t *bdp = kmem_alloc(sizeof(bhv_desc_t), KM_SLEEP); struct bhv_desc *bdp;
bdp = kmem_alloc(sizeof(struct bhv_desc), KM_SLEEP);
bhv_desc_init(bdp, NULL, vfsp, vfsops); bhv_desc_init(bdp, NULL, vfsp, vfsops);
bhv_insert(&vfsp->vfs_bh, bdp); bhv_insert(&vfsp->vfs_bh, bdp);
} }
void void
vfs_insertbhv(vfs_t *vfsp, bhv_desc_t *bdp, vfsops_t *vfsops, void *mount) vfs_insertbhv(
struct vfs *vfsp,
struct bhv_desc *bdp,
struct vfsops *vfsops,
void *mount)
{ {
bhv_desc_init(bdp, mount, vfsp, vfsops); bhv_desc_init(bdp, mount, vfsp, vfsops);
bhv_insert_initial(&vfsp->vfs_bh, bdp); bhv_insert_initial(&vfsp->vfs_bh, bdp);
} }
void
bhv_remove_vfsops(
struct vfs *vfsp,
int pos)
{
struct bhv_desc *bhv;
bhv = bhv_lookup_range(&vfsp->vfs_bh, pos, pos);
if (!bhv)
return;
bhv_remove(&vfsp->vfs_bh, bhv);
kmem_free(bhv, sizeof(*bhv));
}
void
bhv_remove_all_vfsops(
struct vfs *vfsp,
int freebase)
{
struct xfs_mount *mp;
bhv_remove_vfsops(vfsp, VFS_POSITION_QM);
bhv_remove_vfsops(vfsp, VFS_POSITION_DM);
if (!freebase)
return;
mp = XFS_BHVTOM(bhv_lookup(VFS_BHVHEAD(vfsp), &xfs_vfsops));
VFS_REMOVEBHV(vfsp, &mp->m_bhv);
xfs_mount_free(mp, 0);
}
void
bhv_insert_all_vfsops(
struct vfs *vfsp)
{
struct xfs_mount *mp;
mp = xfs_mount_init();
vfs_insertbhv(vfsp, &mp->m_bhv, &xfs_vfsops, mp);
vfs_insertdmapi(vfsp);
vfs_insertquota(vfsp);
}
...@@ -170,4 +170,8 @@ extern void vfs_deallocate(vfs_t *); ...@@ -170,4 +170,8 @@ extern void vfs_deallocate(vfs_t *);
extern void vfs_insertops(vfs_t *, vfsops_t *); extern void vfs_insertops(vfs_t *, vfsops_t *);
extern void vfs_insertbhv(vfs_t *, bhv_desc_t *, vfsops_t *, void *); extern void vfs_insertbhv(vfs_t *, bhv_desc_t *, vfsops_t *, void *);
extern void bhv_insert_all_vfsops(struct vfs *);
extern void bhv_remove_all_vfsops(struct vfs *, int);
extern void bhv_remove_vfsops(struct vfs *, int);
#endif /* __XFS_VFS_H__ */ #endif /* __XFS_VFS_H__ */
/* /*
* Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as * under the terms of version 2 of the GNU General Public License as
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
*/ */
#include <xfs.h> #include <xfs.h>
#include <linux/pagemap.h>
uint64_t vn_generation; /* vnode generation number */ uint64_t vn_generation; /* vnode generation number */
...@@ -73,19 +72,19 @@ vn_init(void) ...@@ -73,19 +72,19 @@ vn_init(void)
* Clean a vnode of filesystem-specific data and prepare it for reuse. * Clean a vnode of filesystem-specific data and prepare it for reuse.
*/ */
STATIC int STATIC int
vn_reclaim(struct vnode *vp) vn_reclaim(
struct vnode *vp)
{ {
int error; int error;
XFS_STATS_INC(xfsstats.vn_reclaim); XFS_STATS_INC(xfsstats.vn_reclaim);
vn_trace_entry(vp, "vn_reclaim", (inst_t *)__return_address); vn_trace_entry(vp, "vn_reclaim", (inst_t *)__return_address);
/* /*
* Only make the VOP_RECLAIM call if there are behaviors * Only make the VOP_RECLAIM call if there are behaviors
* to call. * to call.
*/ */
if (vp->v_fbhv != NULL) { if (vp->v_fbhv) {
VOP_RECLAIM(vp, error); VOP_RECLAIM(vp, error);
if (error) if (error)
return -error; return -error;
...@@ -108,18 +107,19 @@ vn_reclaim(struct vnode *vp) ...@@ -108,18 +107,19 @@ vn_reclaim(struct vnode *vp)
} }
STATIC void STATIC void
vn_wakeup(struct vnode *vp) vn_wakeup(
struct vnode *vp)
{ {
VN_LOCK(vp); VN_LOCK(vp);
if (vp->v_flag & VWAIT) { if (vp->v_flag & VWAIT)
sv_broadcast(vptosync(vp)); sv_broadcast(vptosync(vp));
}
vp->v_flag &= ~(VRECLM|VWAIT|VMODIFIED); vp->v_flag &= ~(VRECLM|VWAIT|VMODIFIED);
VN_UNLOCK(vp, 0); VN_UNLOCK(vp, 0);
} }
int int
vn_wait(struct vnode *vp) vn_wait(
struct vnode *vp)
{ {
VN_LOCK(vp); VN_LOCK(vp);
if (vp->v_flag & (VINACT | VRECLM)) { if (vp->v_flag & (VINACT | VRECLM)) {
...@@ -132,7 +132,8 @@ vn_wait(struct vnode *vp) ...@@ -132,7 +132,8 @@ vn_wait(struct vnode *vp)
} }
struct vnode * struct vnode *
vn_initialize(struct inode *inode) vn_initialize(
struct inode *inode)
{ {
struct vnode *vp = LINVFS_GET_VP(inode); struct vnode *vp = LINVFS_GET_VP(inode);
...@@ -165,7 +166,9 @@ vn_initialize(struct inode *inode) ...@@ -165,7 +166,9 @@ vn_initialize(struct inode *inode)
* Get a reference on a vnode. * Get a reference on a vnode.
*/ */
vnode_t * vnode_t *
vn_get(struct vnode *vp, vmap_t *vmap) vn_get(
struct vnode *vp,
vmap_t *vmap)
{ {
struct inode *inode; struct inode *inode;
...@@ -175,7 +178,7 @@ vn_get(struct vnode *vp, vmap_t *vmap) ...@@ -175,7 +178,7 @@ vn_get(struct vnode *vp, vmap_t *vmap)
return NULL; return NULL;
inode = ilookup(vmap->v_vfsp->vfs_super, vmap->v_ino); inode = ilookup(vmap->v_vfsp->vfs_super, vmap->v_ino);
if (inode == NULL) /* Inode not present */ if (!inode) /* Inode not present */
return NULL; return NULL;
vn_trace_exit(vp, "vn_get", (inst_t *)__return_address); vn_trace_exit(vp, "vn_get", (inst_t *)__return_address);
...@@ -187,11 +190,12 @@ vn_get(struct vnode *vp, vmap_t *vmap) ...@@ -187,11 +190,12 @@ vn_get(struct vnode *vp, vmap_t *vmap)
* Revalidate the Linux inode from the vnode. * Revalidate the Linux inode from the vnode.
*/ */
int int
vn_revalidate(struct vnode *vp) vn_revalidate(
struct vnode *vp)
{ {
int error;
struct inode *inode; struct inode *inode;
vattr_t va; vattr_t va;
int error;
vn_trace_entry(vp, "vn_revalidate", (inst_t *)__return_address); vn_trace_entry(vp, "vn_revalidate", (inst_t *)__return_address);
ASSERT(vp->v_fbhv != NULL); ASSERT(vp->v_fbhv != NULL);
...@@ -224,7 +228,9 @@ vn_revalidate(struct vnode *vp) ...@@ -224,7 +228,9 @@ vn_revalidate(struct vnode *vp)
* get a handle (via vn_get) on the vnode (usually done via a mount/vfs lock). * get a handle (via vn_get) on the vnode (usually done via a mount/vfs lock).
*/ */
void void
vn_purge(struct vnode *vp, vmap_t *vmap) vn_purge(
struct vnode *vp,
vmap_t *vmap)
{ {
vn_trace_entry(vp, "vn_purge", (inst_t *)__return_address); vn_trace_entry(vp, "vn_purge", (inst_t *)__return_address);
...@@ -284,9 +290,10 @@ vn_purge(struct vnode *vp, vmap_t *vmap) ...@@ -284,9 +290,10 @@ vn_purge(struct vnode *vp, vmap_t *vmap)
* Add a reference to a referenced vnode. * Add a reference to a referenced vnode.
*/ */
struct vnode * struct vnode *
vn_hold(struct vnode *vp) vn_hold(
struct vnode *vp)
{ {
struct inode *inode; struct inode *inode;
XFS_STATS_INC(xfsstats.vn_hold); XFS_STATS_INC(xfsstats.vn_hold);
...@@ -302,10 +309,11 @@ vn_hold(struct vnode *vp) ...@@ -302,10 +309,11 @@ vn_hold(struct vnode *vp)
* Call VOP_INACTIVE on last reference. * Call VOP_INACTIVE on last reference.
*/ */
void void
vn_rele(struct vnode *vp) vn_rele(
struct vnode *vp)
{ {
int vcnt; int vcnt;
int cache; int cache;
XFS_STATS_INC(xfsstats.vn_rele); XFS_STATS_INC(xfsstats.vn_rele);
...@@ -319,7 +327,7 @@ vn_rele(struct vnode *vp) ...@@ -319,7 +327,7 @@ vn_rele(struct vnode *vp)
* that i_count won't be decremented after we * that i_count won't be decremented after we
* return. * return.
*/ */
if (vcnt == 0) { if (!vcnt) {
/* /*
* As soon as we turn this on, noone can find us in vn_get * As soon as we turn this on, noone can find us in vn_get
* until we turn off VINACT or VRECLM * until we turn off VINACT or VRECLM
...@@ -331,19 +339,14 @@ vn_rele(struct vnode *vp) ...@@ -331,19 +339,14 @@ vn_rele(struct vnode *vp)
* Do not make the VOP_INACTIVE call if there * Do not make the VOP_INACTIVE call if there
* are no behaviors attached to the vnode to call. * are no behaviors attached to the vnode to call.
*/ */
if (vp->v_fbhv != NULL) { if (vp->v_fbhv)
VOP_INACTIVE(vp, NULL, cache); VOP_INACTIVE(vp, NULL, cache);
}
VN_LOCK(vp); VN_LOCK(vp);
if (vp->v_flag & VWAIT) { if (vp->v_flag & VWAIT)
if (vp->v_flag & VWAIT) { sv_broadcast(vptosync(vp));
sv_broadcast(vptosync(vp));
}
}
vp->v_flag &= ~(VINACT|VWAIT|VRECLM|VMODIFIED); vp->v_flag &= ~(VINACT|VWAIT|VRECLM|VMODIFIED);
} }
VN_UNLOCK(vp, 0); VN_UNLOCK(vp, 0);
...@@ -355,17 +358,16 @@ vn_rele(struct vnode *vp) ...@@ -355,17 +358,16 @@ vn_rele(struct vnode *vp)
* Finish the removal of a vnode. * Finish the removal of a vnode.
*/ */
void void
vn_remove(struct vnode *vp) vn_remove(
struct vnode *vp)
{ {
/* REFERENCED */ vmap_t vmap;
vmap_t vmap;
/* Make sure we don't do this to the same vnode twice */ /* Make sure we don't do this to the same vnode twice */
if (!(vp->v_fbhv)) if (!(vp->v_fbhv))
return; return;
XFS_STATS_INC(xfsstats.vn_remove); XFS_STATS_INC(xfsstats.vn_remove);
vn_trace_exit(vp, "vn_remove", (inst_t *)__return_address); vn_trace_exit(vp, "vn_remove", (inst_t *)__return_address);
/* /*
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
STATIC void xfs_mount_reset_sbqflags(xfs_mount_t *); STATIC void xfs_mount_reset_sbqflags(xfs_mount_t *);
STATIC void xfs_mount_log_sbunit(xfs_mount_t *, __int64_t); STATIC void xfs_mount_log_sbunit(xfs_mount_t *, __int64_t);
STATIC int xfs_uuid_mount(xfs_mount_t *); STATIC int xfs_uuid_mount(xfs_mount_t *);
STATIC void xfs_uuid_unmount(xfs_mount_t *mp);
mutex_t xfs_uuidtabmon; /* monitor for uuidtab */ mutex_t xfs_uuidtabmon; /* monitor for uuidtab */
STATIC int xfs_uuidtab_size; STATIC int xfs_uuidtab_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment