Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124817
b: refs/heads/master
c: 75c68f4
h: refs/heads/master
i:
  124815: f873424
v: v3
  • Loading branch information
David Chinner authored and Lachlan McIlroy committed Oct 30, 2008
1 parent ed96ba4 commit 2633218
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 65 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: a167b17e899a930758506bbc18748078d6fd8c89
refs/heads/master: 75c68f411b1242c8fdaf731078fdd4e77b14981d
2 changes: 1 addition & 1 deletion trunk/fs/xfs/linux-2.6/xfs_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ xfs_syncsub(

if (flags & (SYNC_ATTR|SYNC_DELWRI)) {
if (flags & SYNC_BDFLUSH)
xfs_finish_reclaim_all(mp, 1);
xfs_finish_reclaim_all(mp, 1, XFS_IFLUSH_DELWRI_ELSE_ASYNC);
else
error = xfs_sync_inodes(mp, flags, bypassed);
}
Expand Down
35 changes: 0 additions & 35 deletions trunk/fs/xfs/xfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -3499,41 +3499,6 @@ xfs_iflush_int(
}


/*
* Flush all inactive inodes in mp.
*/
void
xfs_iflush_all(
xfs_mount_t *mp)
{
xfs_inode_t *ip;

again:
XFS_MOUNT_ILOCK(mp);
ip = mp->m_inodes;
if (ip == NULL)
goto out;

do {
/* Make sure we skip markers inserted by sync */
if (ip->i_mount == NULL) {
ip = ip->i_mnext;
continue;
}

if (!VFS_I(ip)) {
XFS_MOUNT_IUNLOCK(mp);
xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC);
goto again;
}

ASSERT(vn_count(VFS_I(ip)) == 0);

ip = ip->i_mnext;
} while (ip != mp->m_inodes);
out:
XFS_MOUNT_IUNLOCK(mp);
}

#ifdef XFS_ILOCK_TRACE
ktrace_t *xfs_ilock_trace_buf;
Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/xfs/xfs_inode.h
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ uint xfs_ilock_map_shared(xfs_inode_t *);
void xfs_iunlock_map_shared(xfs_inode_t *, uint);
void xfs_ireclaim(xfs_inode_t *);
int xfs_finish_reclaim(xfs_inode_t *, int, int);
int xfs_finish_reclaim_all(struct xfs_mount *, int);
int xfs_finish_reclaim_all(struct xfs_mount *, int, int);

/*
* xfs_inode.c prototypes.
Expand All @@ -530,7 +530,6 @@ void xfs_iext_realloc(xfs_inode_t *, int, int);
void xfs_ipin(xfs_inode_t *);
void xfs_iunpin(xfs_inode_t *);
int xfs_iflush(xfs_inode_t *, uint);
void xfs_iflush_all(struct xfs_mount *);
void xfs_ichgtime(xfs_inode_t *, int);
xfs_fsize_t xfs_file_last_byte(xfs_inode_t *);
void xfs_lock_inodes(xfs_inode_t **, int, uint);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/xfs/xfs_mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ xfs_unmountfs(
* need to force the log first.
*/
xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE | XFS_LOG_SYNC);
xfs_iflush_all(mp);
xfs_finish_reclaim_all(mp, 0, XFS_IFLUSH_ASYNC);

XFS_QM_DQPURGEALL(mp, XFS_QMOPT_QUOTALL | XFS_QMOPT_UMOUNTING);

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/xfs/xfs_vfsops.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ xfs_quiesce_fs(
int count = 0, pincount;

xfs_flush_buftarg(mp->m_ddev_targp, 0);
xfs_finish_reclaim_all(mp, 0);
xfs_finish_reclaim_all(mp, 0, XFS_IFLUSH_DELWRI_ELSE_ASYNC);

/* This loop must run at least twice.
* The first instance of the loop will flush
Expand Down
42 changes: 18 additions & 24 deletions trunk/fs/xfs/xfs_vnodeops.c
Original file line number Diff line number Diff line change
Expand Up @@ -2918,36 +2918,30 @@ xfs_finish_reclaim(
}

int
xfs_finish_reclaim_all(xfs_mount_t *mp, int noblock)
xfs_finish_reclaim_all(
xfs_mount_t *mp,
int noblock,
int mode)
{
int purged;
xfs_inode_t *ip, *n;
int done = 0;

while (!done) {
purged = 0;
XFS_MOUNT_ILOCK(mp);
list_for_each_entry_safe(ip, n, &mp->m_del_inodes, i_reclaim) {
if (noblock) {
if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0)
continue;
if (xfs_ipincount(ip) ||
!xfs_iflock_nowait(ip)) {
xfs_iunlock(ip, XFS_ILOCK_EXCL);
continue;
}
restart:
XFS_MOUNT_ILOCK(mp);
list_for_each_entry_safe(ip, n, &mp->m_del_inodes, i_reclaim) {
if (noblock) {
if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0)
continue;
if (xfs_ipincount(ip) ||
!xfs_iflock_nowait(ip)) {
xfs_iunlock(ip, XFS_ILOCK_EXCL);
continue;
}
XFS_MOUNT_IUNLOCK(mp);
if (xfs_finish_reclaim(ip, noblock,
XFS_IFLUSH_DELWRI_ELSE_ASYNC))
delay(1);
purged = 1;
break;
}

done = !purged;
XFS_MOUNT_IUNLOCK(mp);
if (xfs_finish_reclaim(ip, noblock, mode))
delay(1);
goto restart;
}

XFS_MOUNT_IUNLOCK(mp);
return 0;
}
Expand Down

0 comments on commit 2633218

Please sign in to comment.