Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186387
b: refs/heads/master
c: 60ec678
h: refs/heads/master
i:
  186385: c4a61c8
  186383: bd3bd31
v: v3
  • Loading branch information
Christoph Hellwig authored and Alex Elder committed Mar 1, 2010
1 parent d8d17ce commit 80ad3df
Show file tree
Hide file tree
Showing 2 changed files with 13 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: d7658d487f4c62983015ba6c99f02dedb3ea97c7
refs/heads/master: 60ec678371183f6e0d487e55fe8adbb33816518e
40 changes: 12 additions & 28 deletions trunk/fs/xfs/xfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2467,47 +2467,31 @@ xfs_iunpin(
}

/*
* This is called to unpin an inode. It can be directed to wait or to return
* immediately without waiting for the inode to be unpinned. The caller must
* have the inode locked in at least shared mode so that the buffer cannot be
* subsequently pinned once someone is waiting for it to be unpinned.
* 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
* once someone is waiting for it to be unpinned.
*/
STATIC void
__xfs_iunpin_wait(
xfs_inode_t *ip,
int wait)
static void
xfs_iunpin_nowait(
struct xfs_inode *ip)
{
xfs_inode_log_item_t *iip = ip->i_itemp;

ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_ILOCK_SHARED));
if (atomic_read(&ip->i_pincount) == 0)
return;

/* Give the log a push to start the unpinning I/O */
if (iip && iip->ili_last_lsn)
xfs_log_force_lsn(ip->i_mount, iip->ili_last_lsn, 0);
else
xfs_log_force(ip->i_mount, 0);
xfs_log_force_lsn(ip->i_mount, ip->i_itemp->ili_last_lsn, 0);

if (wait)
wait_event(ip->i_ipin_wait, (atomic_read(&ip->i_pincount) == 0));
}

void
xfs_iunpin_wait(
xfs_inode_t *ip)
struct xfs_inode *ip)
{
__xfs_iunpin_wait(ip, 1);
}

static inline void
xfs_iunpin_nowait(
xfs_inode_t *ip)
{
__xfs_iunpin_wait(ip, 0);
if (xfs_ipincount(ip)) {
xfs_iunpin_nowait(ip);
wait_event(ip->i_ipin_wait, (xfs_ipincount(ip) == 0));
}
}


/*
* xfs_iextents_copy()
*
Expand Down

0 comments on commit 80ad3df

Please sign in to comment.