Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108311
b: refs/heads/master
c: 863890c
h: refs/heads/master
i:
  108309: 53b25e9
  108307: a398c2f
  108303: 0f9daae
v: v3
  • Loading branch information
Christoph Hellwig authored and Lachlan McIlroy committed Aug 13, 2008
1 parent 8575a33 commit a19dbbc
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a19d033cd2cc66120f01b370ec081d67b59b7924
refs/heads/master: 863890cd90e8b213f7028036c6e2200d93223527
2 changes: 1 addition & 1 deletion trunk/fs/xfs/linux-2.6/xfs_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
#define xfs_sort(a,n,s,fn) sort(a,n,s,fn,NULL)
#define xfs_stack_trace() dump_stack()
#define xfs_itruncate_data(ip, off) \
(-vmtruncate(vn_to_inode(VFS_I(ip)), (off)))
(-vmtruncate(VFS_I(ip), (off)))


/* Move the kernel do_div definition off to one side */
Expand Down
14 changes: 6 additions & 8 deletions trunk/fs/xfs/linux-2.6/xfs_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,10 +613,9 @@ xfs_set_inodeops(
STATIC_INLINE void
xfs_revalidate_inode(
xfs_mount_t *mp,
bhv_vnode_t *vp,
struct inode *inode,
xfs_inode_t *ip)
{
struct inode *inode = vn_to_inode(vp);

inode->i_mode = ip->i_d.di_mode;
inode->i_nlink = ip->i_d.di_nlink;
Expand Down Expand Up @@ -665,13 +664,12 @@ xfs_revalidate_inode(
void
xfs_initialize_vnode(
struct xfs_mount *mp,
bhv_vnode_t *vp,
struct inode *inode,
struct xfs_inode *ip)
{
struct inode *inode = vn_to_inode(vp);

if (!ip->i_vnode) {
ip->i_vnode = vp;
ip->i_vnode = inode;
inode->i_private = ip;
}

Expand All @@ -683,7 +681,7 @@ xfs_initialize_vnode(
* finish our work.
*/
if (ip->i_d.di_mode != 0 && (inode->i_state & I_NEW)) {
xfs_revalidate_inode(mp, vp, ip);
xfs_revalidate_inode(mp, inode, ip);
xfs_set_inodeops(inode);

xfs_iflags_clear(ip, XFS_INEW);
Expand Down Expand Up @@ -987,7 +985,7 @@ xfs_fs_alloc_inode(
vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP);
if (unlikely(!vp))
return NULL;
return vn_to_inode(vp);
return vp;
}

STATIC void
Expand All @@ -1001,7 +999,7 @@ STATIC void
xfs_fs_inode_init_once(
void *vnode)
{
inode_init_once(vn_to_inode((bhv_vnode_t *)vnode));
inode_init_once((struct inode *)vnode);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/xfs/linux-2.6/xfs_vnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ vn_hold(

XFS_STATS_INC(vn_hold);

inode = igrab(vn_to_inode(vp));
inode = igrab(vp);
ASSERT(inode);

return vp;
Expand Down
24 changes: 8 additions & 16 deletions trunk/fs/xfs/linux-2.6/xfs_vnode.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ struct attrlist_cursor_kern;

typedef struct inode bhv_vnode_t;

/*
* Vnode to Linux inode mapping.
*/
static inline struct inode *vn_to_inode(bhv_vnode_t *vnode)
{
return vnode;
}

/*
* Return values for xfs_inactive. A return value of
* VN_INACTIVE_NOCACHE implies that the file system behavior
Expand Down Expand Up @@ -74,7 +66,7 @@ extern void vn_ioerror(struct xfs_inode *ip, int error, char *f, int l);

static inline int vn_count(bhv_vnode_t *vp)
{
return atomic_read(&vn_to_inode(vp)->i_count);
return atomic_read(&vp->i_count);
}

/*
Expand All @@ -88,23 +80,23 @@ extern bhv_vnode_t *vn_hold(bhv_vnode_t *);
xfs_itrace_hold(XFS_I(vp), __FILE__, __LINE__, (inst_t *)__return_address))
#define VN_RELE(vp) \
(xfs_itrace_rele(XFS_I(vp), __FILE__, __LINE__, (inst_t *)__return_address), \
iput(vn_to_inode(vp)))
iput(vp))
#else
#define VN_HOLD(vp) ((void)vn_hold(vp))
#define VN_RELE(vp) (iput(vn_to_inode(vp)))
#define VN_RELE(vp) (iput(vp))
#endif

static inline bhv_vnode_t *vn_grab(bhv_vnode_t *vp)
{
return igrab(vn_to_inode(vp));
return igrab(vp);
}

/*
* Dealing with bad inodes
*/
static inline int VN_BAD(bhv_vnode_t *vp)
{
return is_bad_inode(vn_to_inode(vp));
return is_bad_inode(vp);
}

/*
Expand All @@ -129,9 +121,9 @@ static inline void vn_atime_to_time_t(bhv_vnode_t *vp, time_t *tt)
/*
* Some useful predicates.
*/
#define VN_MAPPED(vp) mapping_mapped(vn_to_inode(vp)->i_mapping)
#define VN_CACHED(vp) (vn_to_inode(vp)->i_mapping->nrpages)
#define VN_DIRTY(vp) mapping_tagged(vn_to_inode(vp)->i_mapping, \
#define VN_MAPPED(vp) mapping_mapped(vp->i_mapping)
#define VN_CACHED(vp) (vp->i_mapping->nrpages)
#define VN_DIRTY(vp) mapping_tagged(vp->i_mapping, \
PAGECACHE_TAG_DIRTY)


Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/xfs/xfs_vnodeops.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ xfs_fsync(
return XFS_ERROR(EIO);

/* capture size updates in I/O completion before writing the inode. */
error = filemap_fdatawait(vn_to_inode(VFS_I(ip))->i_mapping);
error = filemap_fdatawait(VFS_I(ip)->i_mapping);
if (error)
return XFS_ERROR(error);

Expand Down Expand Up @@ -2917,7 +2917,7 @@ xfs_reclaim(
XFS_MOUNT_ILOCK(mp);
spin_lock(&ip->i_flags_lock);
__xfs_iflags_set(ip, XFS_IRECLAIMABLE);
vn_to_inode(vp)->i_private = NULL;
vp->i_private = NULL;
ip->i_vnode = NULL;
spin_unlock(&ip->i_flags_lock);
list_add_tail(&ip->i_reclaim, &mp->m_del_inodes);
Expand Down

0 comments on commit a19dbbc

Please sign in to comment.