mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-09 23:00:21 +00:00
[XFS] remove bhv_lookup, _range version works aswell and has more useful
semantics. SGI-PV: 954580 SGI-Modid: xfs-linux-melb:xfs-kern:26563a Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nathan Scott <nathans@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
This commit is contained in:
parent
1121b219bf
commit
fe48cae9ed
@ -85,8 +85,6 @@ typedef enum {
|
|||||||
#define VN_BHV_HEAD(vp) ((bhv_head_t *)(&((vp)->v_bh)))
|
#define VN_BHV_HEAD(vp) ((bhv_head_t *)(&((vp)->v_bh)))
|
||||||
#define vn_bhv_head_init(bhp,name) bhv_head_init(bhp,name)
|
#define vn_bhv_head_init(bhp,name) bhv_head_init(bhp,name)
|
||||||
#define vn_bhv_remove(bhp,bdp) bhv_remove(bhp,bdp)
|
#define vn_bhv_remove(bhp,bdp) bhv_remove(bhp,bdp)
|
||||||
#define vn_bhv_lookup(bhp,ops) bhv_lookup(bhp,ops)
|
|
||||||
#define vn_bhv_lookup_unlocked(bhp,ops) bhv_lookup_unlocked(bhp,ops)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Vnode to Linux inode mapping.
|
* Vnode to Linux inode mapping.
|
||||||
|
@ -109,26 +109,6 @@ bhv_remove_not_first(bhv_head_t *bhp, bhv_desc_t *bdp)
|
|||||||
prev->bd_next = bdp->bd_next; /* remove from after prev */
|
prev->bd_next = bdp->bd_next; /* remove from after prev */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Look for a specific ops vector on the specified behavior chain.
|
|
||||||
* Return the associated behavior descriptor. Or NULL, if not found.
|
|
||||||
*/
|
|
||||||
bhv_desc_t *
|
|
||||||
bhv_lookup(bhv_head_t *bhp, void *ops)
|
|
||||||
{
|
|
||||||
bhv_desc_t *curdesc;
|
|
||||||
|
|
||||||
for (curdesc = bhp->bh_first;
|
|
||||||
curdesc != NULL;
|
|
||||||
curdesc = curdesc->bd_next) {
|
|
||||||
|
|
||||||
if (curdesc->bd_ops == ops)
|
|
||||||
return curdesc;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Looks for the first behavior within a specified range of positions.
|
* Looks for the first behavior within a specified range of positions.
|
||||||
* Return the associated behavior descriptor. Or NULL, if none found.
|
* Return the associated behavior descriptor. Or NULL, if none found.
|
||||||
|
@ -176,12 +176,10 @@ extern void bhv_insert_initial(bhv_head_t *, bhv_desc_t *);
|
|||||||
* Behavior module prototypes.
|
* Behavior module prototypes.
|
||||||
*/
|
*/
|
||||||
extern void bhv_remove_not_first(bhv_head_t *bhp, bhv_desc_t *bdp);
|
extern void bhv_remove_not_first(bhv_head_t *bhp, bhv_desc_t *bdp);
|
||||||
extern bhv_desc_t * bhv_lookup(bhv_head_t *bhp, void *ops);
|
|
||||||
extern bhv_desc_t * bhv_lookup_range(bhv_head_t *bhp, int low, int high);
|
extern bhv_desc_t * bhv_lookup_range(bhv_head_t *bhp, int low, int high);
|
||||||
extern bhv_desc_t * bhv_base(bhv_head_t *bhp);
|
extern bhv_desc_t * bhv_base(bhv_head_t *bhp);
|
||||||
|
|
||||||
/* No bhv locking on Linux */
|
/* No bhv locking on Linux */
|
||||||
#define bhv_lookup_unlocked bhv_lookup
|
|
||||||
#define bhv_base_unlocked bhv_base
|
#define bhv_base_unlocked bhv_base
|
||||||
|
|
||||||
#endif /* __XFS_BEHAVIOR_H__ */
|
#endif /* __XFS_BEHAVIOR_H__ */
|
||||||
|
@ -541,7 +541,8 @@ static inline xfs_mount_t *xfs_bhvtom(bhv_desc_t *bdp)
|
|||||||
#define XFS_VFSTOM(vfs) xfs_vfstom(vfs)
|
#define XFS_VFSTOM(vfs) xfs_vfstom(vfs)
|
||||||
static inline xfs_mount_t *xfs_vfstom(bhv_vfs_t *vfs)
|
static inline xfs_mount_t *xfs_vfstom(bhv_vfs_t *vfs)
|
||||||
{
|
{
|
||||||
return XFS_BHVTOM(bhv_lookup(VFS_BHVHEAD(vfs), &xfs_vfsops));
|
return XFS_BHVTOM(bhv_lookup_range(VFS_BHVHEAD(vfs),
|
||||||
|
VFS_POSITION_XFS, VFS_POSITION_XFS));
|
||||||
}
|
}
|
||||||
|
|
||||||
#define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d)
|
#define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user