Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186388
b: refs/heads/master
c: a14a5ab
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Alex Elder committed Mar 1, 2010
1 parent 80ad3df commit 5fe7968
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 38 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: 60ec678371183f6e0d487e55fe8adbb33816518e
refs/heads/master: a14a5ab58f9d783ec3a2a287320fab22e1764813
28 changes: 0 additions & 28 deletions trunk/fs/xfs/xfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2438,34 +2438,6 @@ xfs_idestroy_fork(
}
}

/*
* Increment the pin count of the given buffer.
* This value is protected by ipinlock spinlock in the mount structure.
*/
void
xfs_ipin(
xfs_inode_t *ip)
{
ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));

atomic_inc(&ip->i_pincount);
}

/*
* Decrement the pin count of the given inode, and wake up
* anyone in xfs_iwait_unpin() if the count goes to 0. The
* inode must have been previously pinned with a call to xfs_ipin().
*/
void
xfs_iunpin(
xfs_inode_t *ip)
{
ASSERT(atomic_read(&ip->i_pincount) > 0);

if (atomic_dec_and_test(&ip->i_pincount))
wake_up(&ip->i_ipin_wait);
}

/*
* This is called to unpin an inode. The caller must have the inode locked
* in at least shared mode so that the buffer cannot be subsequently pinned
Expand Down
2 changes: 0 additions & 2 deletions trunk/fs/xfs/xfs_inode.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,6 @@ int xfs_itruncate_finish(struct xfs_trans **, xfs_inode_t *,
int xfs_iunlink(struct xfs_trans *, xfs_inode_t *);

void xfs_iext_realloc(xfs_inode_t *, int, int);
void xfs_ipin(xfs_inode_t *);
void xfs_iunpin(xfs_inode_t *);
void xfs_iunpin_wait(xfs_inode_t *);
int xfs_iflush(xfs_inode_t *, uint);
void xfs_ichgtime(xfs_inode_t *, int);
Expand Down
18 changes: 11 additions & 7 deletions trunk/fs/xfs/xfs_inode_item.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,31 +535,35 @@ xfs_inode_item_format(

/*
* This is called to pin the inode associated with the inode log
* item in memory so it cannot be written out. Do this by calling
* xfs_ipin() to bump the pin count in the inode while holding the
* inode pin lock.
* item in memory so it cannot be written out.
*/
STATIC void
xfs_inode_item_pin(
xfs_inode_log_item_t *iip)
{
ASSERT(xfs_isilocked(iip->ili_inode, XFS_ILOCK_EXCL));
xfs_ipin(iip->ili_inode);

atomic_inc(&iip->ili_inode->i_pincount);
}


/*
* This is called to unpin the inode associated with the inode log
* item which was previously pinned with a call to xfs_inode_item_pin().
* Just call xfs_iunpin() on the inode to do this.
*
* Also wake up anyone in xfs_iunpin_wait() if the count goes to 0.
*/
/* ARGSUSED */
STATIC void
xfs_inode_item_unpin(
xfs_inode_log_item_t *iip,
int stale)
{
xfs_iunpin(iip->ili_inode);
struct xfs_inode *ip = iip->ili_inode;

ASSERT(atomic_read(&ip->i_pincount) > 0);
if (atomic_dec_and_test(&ip->i_pincount))
wake_up(&ip->i_ipin_wait);
}

/* ARGSUSED */
Expand All @@ -568,7 +572,7 @@ xfs_inode_item_unpin_remove(
xfs_inode_log_item_t *iip,
xfs_trans_t *tp)
{
xfs_iunpin(iip->ili_inode);
xfs_inode_item_unpin(iip, 0);
}

/*
Expand Down

0 comments on commit 5fe7968

Please sign in to comment.