[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>
This commit is contained in:
committed by
Lachlan McIlroy
parent
bc60a99323
commit
2030b5aba8
@@ -117,7 +117,7 @@ xfs_sync(
|
|||||||
if (flags & SYNC_IOWAIT)
|
if (flags & SYNC_IOWAIT)
|
||||||
xfs_filestream_flush(mp);
|
xfs_filestream_flush(mp);
|
||||||
|
|
||||||
return xfs_syncsub(mp, flags, NULL);
|
return xfs_syncsub(mp, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -128,8 +128,7 @@ STATIC int
|
|||||||
xfs_sync_inodes_ag(
|
xfs_sync_inodes_ag(
|
||||||
xfs_mount_t *mp,
|
xfs_mount_t *mp,
|
||||||
int ag,
|
int ag,
|
||||||
int flags,
|
int flags)
|
||||||
int *bypassed)
|
|
||||||
{
|
{
|
||||||
xfs_perag_t *pag = &mp->m_perag[ag];
|
xfs_perag_t *pag = &mp->m_perag[ag];
|
||||||
int nr_found;
|
int nr_found;
|
||||||
@@ -260,8 +259,6 @@ xfs_sync_inodes_ag(
|
|||||||
error = xfs_iflush(ip, XFS_IFLUSH_DELWRI);
|
error = xfs_iflush(ip, XFS_IFLUSH_DELWRI);
|
||||||
else
|
else
|
||||||
xfs_ifunlock(ip);
|
xfs_ifunlock(ip);
|
||||||
} else if (bypassed) {
|
|
||||||
(*bypassed)++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,15 +285,12 @@ xfs_sync_inodes_ag(
|
|||||||
int
|
int
|
||||||
xfs_sync_inodes(
|
xfs_sync_inodes(
|
||||||
xfs_mount_t *mp,
|
xfs_mount_t *mp,
|
||||||
int flags,
|
int flags)
|
||||||
int *bypassed)
|
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
int last_error;
|
int last_error;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (bypassed)
|
|
||||||
*bypassed = 0;
|
|
||||||
if (mp->m_flags & XFS_MOUNT_RDONLY)
|
if (mp->m_flags & XFS_MOUNT_RDONLY)
|
||||||
return 0;
|
return 0;
|
||||||
error = 0;
|
error = 0;
|
||||||
@@ -305,7 +299,7 @@ xfs_sync_inodes(
|
|||||||
for (i = 0; i < mp->m_sb.sb_agcount; i++) {
|
for (i = 0; i < mp->m_sb.sb_agcount; i++) {
|
||||||
if (!mp->m_perag[i].pag_ici_init)
|
if (!mp->m_perag[i].pag_ici_init)
|
||||||
continue;
|
continue;
|
||||||
error = xfs_sync_inodes_ag(mp, i, flags, bypassed);
|
error = xfs_sync_inodes_ag(mp, i, flags);
|
||||||
if (error)
|
if (error)
|
||||||
last_error = error;
|
last_error = error;
|
||||||
if (error == EFSCORRUPTED)
|
if (error == EFSCORRUPTED)
|
||||||
@@ -408,11 +402,10 @@ xfs_sync_fsdata(
|
|||||||
* interface as explained above under xfs_sync.
|
* interface as explained above under xfs_sync.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int
|
STATIC int
|
||||||
xfs_syncsub(
|
xfs_syncsub(
|
||||||
xfs_mount_t *mp,
|
xfs_mount_t *mp,
|
||||||
int flags,
|
int flags)
|
||||||
int *bypassed)
|
|
||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
int last_error = 0;
|
int last_error = 0;
|
||||||
@@ -431,7 +424,7 @@ xfs_syncsub(
|
|||||||
if (flags & SYNC_BDFLUSH)
|
if (flags & SYNC_BDFLUSH)
|
||||||
xfs_finish_reclaim_all(mp, 1, XFS_IFLUSH_DELWRI_ELSE_ASYNC);
|
xfs_finish_reclaim_all(mp, 1, XFS_IFLUSH_DELWRI_ELSE_ASYNC);
|
||||||
else
|
else
|
||||||
error = xfs_sync_inodes(mp, flags, bypassed);
|
error = xfs_sync_inodes(mp, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -55,7 +55,7 @@ int xfs_syncd_init(struct xfs_mount *mp);
|
|||||||
void xfs_syncd_stop(struct xfs_mount *mp);
|
void xfs_syncd_stop(struct xfs_mount *mp);
|
||||||
|
|
||||||
int xfs_sync(struct xfs_mount *mp, int flags);
|
int xfs_sync(struct xfs_mount *mp, int flags);
|
||||||
int xfs_syncsub(struct xfs_mount *mp, int flags, int *bypassed);
|
int xfs_sync_inodes(struct xfs_mount *mp, int flags);
|
||||||
|
|
||||||
void xfs_flush_inode(struct xfs_inode *ip);
|
void xfs_flush_inode(struct xfs_inode *ip);
|
||||||
void xfs_flush_device(struct xfs_inode *ip);
|
void xfs_flush_device(struct xfs_inode *ip);
|
||||||
|
@@ -127,7 +127,7 @@ xfs_qm_quotactl(
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case Q_XQUOTASYNC:
|
case Q_XQUOTASYNC:
|
||||||
return (xfs_sync_inodes(mp, SYNC_DELWRI, NULL));
|
return xfs_sync_inodes(mp, SYNC_DELWRI);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@@ -523,8 +523,6 @@ extern struct xfs_buf *xfs_getsb(xfs_mount_t *, int);
|
|||||||
extern int xfs_readsb(xfs_mount_t *, int);
|
extern int xfs_readsb(xfs_mount_t *, int);
|
||||||
extern void xfs_freesb(xfs_mount_t *);
|
extern void xfs_freesb(xfs_mount_t *);
|
||||||
extern int xfs_fs_writable(xfs_mount_t *);
|
extern int xfs_fs_writable(xfs_mount_t *);
|
||||||
extern int xfs_syncsub(xfs_mount_t *, int, int *);
|
|
||||||
extern int xfs_sync_inodes(xfs_mount_t *, int, int *);
|
|
||||||
extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t);
|
extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t);
|
||||||
|
|
||||||
extern int xfs_dmops_get(struct xfs_mount *, struct xfs_mount_args *);
|
extern int xfs_dmops_get(struct xfs_mount *, struct xfs_mount_args *);
|
||||||
|
@@ -68,15 +68,15 @@ xfs_quiesce_fs(
|
|||||||
xfs_flush_buftarg(mp->m_ddev_targp, 0);
|
xfs_flush_buftarg(mp->m_ddev_targp, 0);
|
||||||
xfs_finish_reclaim_all(mp, 0, XFS_IFLUSH_DELWRI_ELSE_ASYNC);
|
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
|
* This loop must run at least twice. The first instance of the loop
|
||||||
* most meta data but that will generate more
|
* will flush most meta data but that will generate more meta data
|
||||||
* meta data (typically directory updates).
|
* (typically directory updates). Which then must be flushed and
|
||||||
* Which then must be flushed and logged before
|
* logged before we can write the unmount record.
|
||||||
* we can write the unmount record.
|
|
||||||
*/
|
*/
|
||||||
do {
|
do {
|
||||||
xfs_syncsub(mp, SYNC_INODE_QUIESCE, NULL);
|
xfs_log_force(mp, 0, XFS_LOG_FORCE|XFS_LOG_SYNC);
|
||||||
|
xfs_sync_inodes(mp, SYNC_INODE_QUIESCE);
|
||||||
pincount = xfs_flush_buftarg(mp->m_ddev_targp, 1);
|
pincount = xfs_flush_buftarg(mp->m_ddev_targp, 1);
|
||||||
if (!pincount) {
|
if (!pincount) {
|
||||||
delay(50);
|
delay(50);
|
||||||
|
Reference in New Issue
Block a user