Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276312
b: refs/heads/master
c: 4dd2cb4
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Ben Myers committed Nov 29, 2011
1 parent 993af75 commit 9158acd
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fa8b18edd752a8b4e9d1ee2cd615b82c93cf8bba
refs/heads/master: 4dd2cb4a28b7ab1f37163a4eba280926a13a8749
21 changes: 21 additions & 0 deletions trunk/fs/xfs/xfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2835,6 +2835,27 @@ xfs_iflush_int(
return XFS_ERROR(EFSCORRUPTED);
}

void
xfs_promote_inode(
struct xfs_inode *ip)
{
struct xfs_buf *bp;

ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_ILOCK_SHARED));

bp = xfs_incore(ip->i_mount->m_ddev_targp, ip->i_imap.im_blkno,
ip->i_imap.im_len, XBF_TRYLOCK);
if (!bp)
return;

if (XFS_BUF_ISDELAYWRITE(bp)) {
xfs_buf_delwri_promote(bp);
wake_up_process(ip->i_mount->m_ddev_targp->bt_task);
}

xfs_buf_relse(bp);
}

/*
* Return a pointer to the extent record at file index idx.
*/
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/xfs/xfs_inode.h
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ int xfs_iunlink(struct xfs_trans *, xfs_inode_t *);
void xfs_iext_realloc(xfs_inode_t *, int, int);
void xfs_iunpin_wait(xfs_inode_t *);
int xfs_iflush(xfs_inode_t *, uint);
void xfs_promote_inode(struct xfs_inode *);
void xfs_lock_inodes(xfs_inode_t **, int, uint);
void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint);

Expand Down
11 changes: 11 additions & 0 deletions trunk/fs/xfs/xfs_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,17 @@ xfs_reclaim_inode(
if (!xfs_iflock_nowait(ip)) {
if (!(sync_mode & SYNC_WAIT))
goto out;

/*
* If we only have a single dirty inode in a cluster there is
* a fair chance that the AIL push may have pushed it into
* the buffer, but xfsbufd won't touch it until 30 seconds
* from now, and thus we will lock up here.
*
* Promote the inode buffer to the front of the delwri list
* and wake up xfsbufd now.
*/
xfs_promote_inode(ip);
xfs_iflock(ip);
}

Expand Down

0 comments on commit 9158acd

Please sign in to comment.