diff options
author | David Chinner <david@fromorbit.com> | 2008-10-30 02:15:12 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@sgi.com> | 2008-10-30 02:15:12 -0400 |
commit | 2030b5aba8a4bcaca5aca85968514fa58207d3bd (patch) | |
tree | e01122f234efd0acad9c3217ffae05f023f8b247 /fs/xfs | |
parent | bc60a99323b3ec628273b5fa998285c87d464ca6 (diff) |
[XFS] use xfs_sync_inodes rather than xfs_syncsub
Kill the unused arg in xfs_syncsub() and xfs_sync_inodes(). For callers of
xfs_syncsub() that only want to flush inodes, replace xfs_syncsub() with
direct calls to xfs_sync_inodes() as that is all that is being done with
the specific flags being passed in.
SGI-PV: 988140
SGI-Modid: xfs-linux-melb:xfs-kern:32305a
Signed-off-by: David Chinner <david@fromorbit.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_sync.c | 21 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_sync.h | 2 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_qm_syscalls.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_mount.h | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_vfsops.c | 14 |
5 files changed, 16 insertions, 25 deletions
diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c index 461c1dc35d37..7e9fb5251b2e 100644 --- a/fs/xfs/linux-2.6/xfs_sync.c +++ b/fs/xfs/linux-2.6/xfs_sync.c | |||
@@ -117,7 +117,7 @@ xfs_sync( | |||
117 | if (flags & SYNC_IOWAIT) | 117 | if (flags & SYNC_IOWAIT) |
118 | xfs_filestream_flush(mp); | 118 | xfs_filestream_flush(mp); |
119 | 119 | ||
120 | return xfs_syncsub(mp, flags, NULL); | 120 | return xfs_syncsub(mp, flags); |
121 | } | 121 | } |
122 | 122 | ||
123 | /* | 123 | /* |
@@ -128,8 +128,7 @@ STATIC int | |||
128 | xfs_sync_inodes_ag( | 128 | xfs_sync_inodes_ag( |
129 | xfs_mount_t *mp, | 129 | xfs_mount_t *mp, |
130 | int ag, | 130 | int ag, |
131 | int flags, | 131 | int flags) |
132 | int *bypassed) | ||
133 | { | 132 | { |
134 | xfs_perag_t *pag = &mp->m_perag[ag]; | 133 | xfs_perag_t *pag = &mp->m_perag[ag]; |
135 | int nr_found; | 134 | int nr_found; |
@@ -260,8 +259,6 @@ xfs_sync_inodes_ag( | |||
260 | error = xfs_iflush(ip, XFS_IFLUSH_DELWRI); | 259 | error = xfs_iflush(ip, XFS_IFLUSH_DELWRI); |
261 | else | 260 | else |
262 | xfs_ifunlock(ip); | 261 | xfs_ifunlock(ip); |
263 | } else if (bypassed) { | ||
264 | (*bypassed)++; | ||
265 | } | 262 | } |
266 | } | 263 | } |
267 | 264 | ||
@@ -288,15 +285,12 @@ xfs_sync_inodes_ag( | |||
288 | int | 285 | int |
289 | xfs_sync_inodes( | 286 | xfs_sync_inodes( |
290 | xfs_mount_t *mp, | 287 | xfs_mount_t *mp, |
291 | int flags, | 288 | int flags) |
292 | int *bypassed) | ||
293 | { | 289 | { |
294 | int error; | 290 | int error; |
295 | int last_error; | 291 | int last_error; |
296 | int i; | 292 | int i; |
297 | 293 | ||
298 | if (bypassed) | ||
299 | *bypassed = 0; | ||
300 | if (mp->m_flags & XFS_MOUNT_RDONLY) | 294 | if (mp->m_flags & XFS_MOUNT_RDONLY) |
301 | return 0; | 295 | return 0; |
302 | error = 0; | 296 | error = 0; |
@@ -305,7 +299,7 @@ xfs_sync_inodes( | |||
305 | for (i = 0; i < mp->m_sb.sb_agcount; i++) { | 299 | for (i = 0; i < mp->m_sb.sb_agcount; i++) { |
306 | if (!mp->m_perag[i].pag_ici_init) | 300 | if (!mp->m_perag[i].pag_ici_init) |
307 | continue; | 301 | continue; |
308 | error = xfs_sync_inodes_ag(mp, i, flags, bypassed); | 302 | error = xfs_sync_inodes_ag(mp, i, flags); |
309 | if (error) | 303 | if (error) |
310 | last_error = error; | 304 | last_error = error; |
311 | if (error == EFSCORRUPTED) | 305 | if (error == EFSCORRUPTED) |
@@ -408,11 +402,10 @@ xfs_sync_fsdata( | |||
408 | * interface as explained above under xfs_sync. | 402 | * interface as explained above under xfs_sync. |
409 | * | 403 | * |
410 | */ | 404 | */ |
411 | int | 405 | STATIC int |
412 | xfs_syncsub( | 406 | xfs_syncsub( |
413 | xfs_mount_t *mp, | 407 | xfs_mount_t *mp, |
414 | int flags, | 408 | int flags) |
415 | int *bypassed) | ||
416 | { | 409 | { |
417 | int error = 0; | 410 | int error = 0; |
418 | int last_error = 0; | 411 | int last_error = 0; |
@@ -431,7 +424,7 @@ xfs_syncsub( | |||
431 | if (flags & SYNC_BDFLUSH) | 424 | if (flags & SYNC_BDFLUSH) |
432 | xfs_finish_reclaim_all(mp, 1, XFS_IFLUSH_DELWRI_ELSE_ASYNC); | 425 | xfs_finish_reclaim_all(mp, 1, XFS_IFLUSH_DELWRI_ELSE_ASYNC); |
433 | else | 426 | else |
434 | error = xfs_sync_inodes(mp, flags, bypassed); | 427 | error = xfs_sync_inodes(mp, flags); |
435 | } | 428 | } |
436 | 429 | ||
437 | /* | 430 | /* |
diff --git a/fs/xfs/linux-2.6/xfs_sync.h b/fs/xfs/linux-2.6/xfs_sync.h index 3746d153ec8e..295486199406 100644 --- a/fs/xfs/linux-2.6/xfs_sync.h +++ b/fs/xfs/linux-2.6/xfs_sync.h | |||
@@ -55,7 +55,7 @@ int xfs_syncd_init(struct xfs_mount *mp); | |||
55 | void xfs_syncd_stop(struct xfs_mount *mp); | 55 | void xfs_syncd_stop(struct xfs_mount *mp); |
56 | 56 | ||
57 | int xfs_sync(struct xfs_mount *mp, int flags); | 57 | int xfs_sync(struct xfs_mount *mp, int flags); |
58 | int xfs_syncsub(struct xfs_mount *mp, int flags, int *bypassed); | 58 | int xfs_sync_inodes(struct xfs_mount *mp, int flags); |
59 | 59 | ||
60 | void xfs_flush_inode(struct xfs_inode *ip); | 60 | void xfs_flush_inode(struct xfs_inode *ip); |
61 | void xfs_flush_device(struct xfs_inode *ip); | 61 | void xfs_flush_device(struct xfs_inode *ip); |
diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c index 4254b074223b..9ff28e6c5b8b 100644 --- a/fs/xfs/quota/xfs_qm_syscalls.c +++ b/fs/xfs/quota/xfs_qm_syscalls.c | |||
@@ -127,7 +127,7 @@ xfs_qm_quotactl( | |||
127 | break; | 127 | break; |
128 | 128 | ||
129 | case Q_XQUOTASYNC: | 129 | case Q_XQUOTASYNC: |
130 | return (xfs_sync_inodes(mp, SYNC_DELWRI, NULL)); | 130 | return xfs_sync_inodes(mp, SYNC_DELWRI); |
131 | 131 | ||
132 | default: | 132 | default: |
133 | break; | 133 | break; |
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 0ba052691126..4e62802b6abc 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h | |||
@@ -523,8 +523,6 @@ extern struct xfs_buf *xfs_getsb(xfs_mount_t *, int); | |||
523 | extern int xfs_readsb(xfs_mount_t *, int); | 523 | extern int xfs_readsb(xfs_mount_t *, int); |
524 | extern void xfs_freesb(xfs_mount_t *); | 524 | extern void xfs_freesb(xfs_mount_t *); |
525 | extern int xfs_fs_writable(xfs_mount_t *); | 525 | extern int xfs_fs_writable(xfs_mount_t *); |
526 | extern int xfs_syncsub(xfs_mount_t *, int, int *); | ||
527 | extern int xfs_sync_inodes(xfs_mount_t *, int, int *); | ||
528 | extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); | 526 | extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); |
529 | 527 | ||
530 | extern int xfs_dmops_get(struct xfs_mount *, struct xfs_mount_args *); | 528 | extern int xfs_dmops_get(struct xfs_mount *, struct xfs_mount_args *); |
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 0c5ee5ec7ee4..d5396d6f5170 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c | |||
@@ -68,15 +68,15 @@ xfs_quiesce_fs( | |||
68 | xfs_flush_buftarg(mp->m_ddev_targp, 0); | 68 | xfs_flush_buftarg(mp->m_ddev_targp, 0); |
69 | xfs_finish_reclaim_all(mp, 0, XFS_IFLUSH_DELWRI_ELSE_ASYNC); | 69 | xfs_finish_reclaim_all(mp, 0, XFS_IFLUSH_DELWRI_ELSE_ASYNC); |
70 | 70 | ||
71 | /* This loop must run at least twice. | 71 | /* |
72 | * The first instance of the loop will flush | 72 | * This loop must run at least twice. The first instance of the loop |
73 | * most meta data but that will generate more | 73 | * will flush most meta data but that will generate more meta data |
74 | * meta data (typically directory updates). | 74 | * (typically directory updates). Which then must be flushed and |
75 | * Which then must be flushed and logged before | 75 | * logged before we can write the unmount record. |
76 | * we can write the unmount record. | ||
77 | */ | 76 | */ |
78 | do { | 77 | do { |
79 | xfs_syncsub(mp, SYNC_INODE_QUIESCE, NULL); | 78 | xfs_log_force(mp, 0, XFS_LOG_FORCE|XFS_LOG_SYNC); |
79 | xfs_sync_inodes(mp, SYNC_INODE_QUIESCE); | ||
80 | pincount = xfs_flush_buftarg(mp->m_ddev_targp, 1); | 80 | pincount = xfs_flush_buftarg(mp->m_ddev_targp, 1); |
81 | if (!pincount) { | 81 | if (!pincount) { |
82 | delay(50); | 82 | delay(50); |