Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269870
b: refs/heads/master
c: c2b006c
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Alex Elder committed Oct 12, 2011
1 parent 4ebd027 commit ccc39a2
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 41 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: 61551f1ee536289084a4a8f1c4f187e2f371c440
refs/heads/master: c2b006c1da1602551def200e4661535f02b82488
7 changes: 4 additions & 3 deletions trunk/fs/xfs/xfs_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2128,9 +2128,10 @@ xfs_attr_rmtval_set(xfs_da_args_t *args)
xfs_buf_iomove(bp, 0, tmp, src, XBRW_WRITE);
if (tmp < XFS_BUF_SIZE(bp))
xfs_buf_zero(bp, tmp, XFS_BUF_SIZE(bp) - tmp);
if ((error = xfs_bwrite(mp, bp))) {/* GROT: NOTE: synchronous write */
return (error);
}
error = xfs_bwrite(bp); /* GROT: NOTE: synchronous write */
xfs_buf_relse(bp);
if (error)
return error;
src += tmp;
valuelen -= tmp;

Expand Down
8 changes: 4 additions & 4 deletions trunk/fs/xfs/xfs_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,6 @@ xfs_buf_ioerror(

int
xfs_bwrite(
struct xfs_mount *mp,
struct xfs_buf *bp)
{
int error;
Expand All @@ -1026,9 +1025,10 @@ xfs_bwrite(
xfs_bdstrat_cb(bp);

error = xfs_buf_iowait(bp);
if (error)
xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR);
xfs_buf_relse(bp);
if (error) {
xfs_force_shutdown(bp->b_target->bt_mount,
SHUTDOWN_META_IO_ERROR);
}
return error;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/xfs/xfs_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ extern void xfs_buf_unlock(xfs_buf_t *);
((bp)->b_sema.count <= 0)

/* Buffer Read and Write Routines */
extern int xfs_bwrite(struct xfs_mount *mp, struct xfs_buf *bp);
extern int xfs_bwrite(struct xfs_buf *bp);

extern void xfsbdstrat(struct xfs_mount *, struct xfs_buf *);
extern int xfs_bdstrat_cb(struct xfs_buf *);
Expand Down
8 changes: 4 additions & 4 deletions trunk/fs/xfs/xfs_dquot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1242,11 +1242,11 @@ xfs_qm_dqflush(
}

if (flags & SYNC_WAIT)
error = xfs_bwrite(mp, bp);
else {
error = xfs_bwrite(bp);
else
xfs_buf_delwri_queue(bp);
xfs_buf_relse(bp);
}

xfs_buf_relse(bp);

trace_xfs_dqflush_done(dqp);

Expand Down
40 changes: 22 additions & 18 deletions trunk/fs/xfs/xfs_fsops.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,11 @@ xfs_growfs_data_private(
tmpsize = agsize - XFS_PREALLOC_BLOCKS(mp);
agf->agf_freeblks = cpu_to_be32(tmpsize);
agf->agf_longest = cpu_to_be32(tmpsize);
error = xfs_bwrite(mp, bp);
if (error) {
error = xfs_bwrite(bp);
xfs_buf_relse(bp);
if (error)
goto error0;
}

/*
* AG inode header block
*/
Expand All @@ -240,10 +241,11 @@ xfs_growfs_data_private(
agi->agi_dirino = cpu_to_be32(NULLAGINO);
for (bucket = 0; bucket < XFS_AGI_UNLINKED_BUCKETS; bucket++)
agi->agi_unlinked[bucket] = cpu_to_be32(NULLAGINO);
error = xfs_bwrite(mp, bp);
if (error) {
error = xfs_bwrite(bp);
xfs_buf_relse(bp);
if (error)
goto error0;
}

/*
* BNO btree root block
*/
Expand All @@ -262,10 +264,11 @@ xfs_growfs_data_private(
arec->ar_startblock = cpu_to_be32(XFS_PREALLOC_BLOCKS(mp));
arec->ar_blockcount = cpu_to_be32(
agsize - be32_to_cpu(arec->ar_startblock));
error = xfs_bwrite(mp, bp);
if (error) {
error = xfs_bwrite(bp);
xfs_buf_relse(bp);
if (error)
goto error0;
}

/*
* CNT btree root block
*/
Expand All @@ -285,10 +288,11 @@ xfs_growfs_data_private(
arec->ar_blockcount = cpu_to_be32(
agsize - be32_to_cpu(arec->ar_startblock));
nfree += be32_to_cpu(arec->ar_blockcount);
error = xfs_bwrite(mp, bp);
if (error) {
error = xfs_bwrite(bp);
xfs_buf_relse(bp);
if (error)
goto error0;
}

/*
* INO btree root block
*/
Expand All @@ -303,10 +307,10 @@ xfs_growfs_data_private(
block->bb_numrecs = 0;
block->bb_u.s.bb_leftsib = cpu_to_be32(NULLAGBLOCK);
block->bb_u.s.bb_rightsib = cpu_to_be32(NULLAGBLOCK);
error = xfs_bwrite(mp, bp);
if (error) {
error = xfs_bwrite(bp);
xfs_buf_relse(bp);
if (error)
goto error0;
}
}
xfs_trans_agblocks_delta(tp, nfree);
/*
Expand Down Expand Up @@ -396,9 +400,9 @@ xfs_growfs_data_private(
* just issue a warning and continue. The real work is
* already done and committed.
*/
if (!(error = xfs_bwrite(mp, bp))) {
continue;
} else {
error = xfs_bwrite(bp);
xfs_buf_relse(bp);
if (error) {
xfs_warn(mp,
"write error %d updating secondary superblock for ag %d",
error, agno);
Expand Down
8 changes: 4 additions & 4 deletions trunk/fs/xfs/xfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2597,11 +2597,11 @@ xfs_iflush(
goto cluster_corrupt_out;

if (flags & SYNC_WAIT)
error = xfs_bwrite(mp, bp);
else {
error = xfs_bwrite(bp);
else
xfs_buf_delwri_queue(bp);
xfs_buf_relse(bp);
}

xfs_buf_relse(bp);
return error;

corrupt_out:
Expand Down
11 changes: 7 additions & 4 deletions trunk/fs/xfs/xfs_log_recover.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,12 @@ xlog_bwrite(
xfs_buf_lock(bp);
XFS_BUF_SET_COUNT(bp, BBTOB(nbblks));

if ((error = xfs_bwrite(log->l_mp, bp)))
error = xfs_bwrite(bp);
if (error) {
xfs_ioerror_alert("xlog_bwrite", log->l_mp,
bp, XFS_BUF_ADDR(bp));
}
xfs_buf_relse(bp);
return error;
}

Expand Down Expand Up @@ -2172,15 +2175,15 @@ xlog_recover_buffer_pass2(
(XFS_BUF_COUNT(bp) != MAX(log->l_mp->m_sb.sb_blocksize,
(__uint32_t)XFS_INODE_CLUSTER_SIZE(log->l_mp)))) {
XFS_BUF_STALE(bp);
error = xfs_bwrite(mp, bp);
error = xfs_bwrite(bp);
} else {
ASSERT(bp->b_target->bt_mount == mp);
bp->b_iodone = xlog_recover_iodone;
xfs_buf_delwri_queue(bp);
xfs_buf_relse(bp);
}

return (error);
xfs_buf_relse(bp);
return error;
}

STATIC int
Expand Down
6 changes: 4 additions & 2 deletions trunk/fs/xfs/xfs_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ xfs_sync_fsdata(
struct xfs_mount *mp)
{
struct xfs_buf *bp;
int error;

/*
* If the buffer is pinned then push on the log so we won't get stuck
Expand All @@ -334,8 +335,9 @@ xfs_sync_fsdata(
bp = xfs_getsb(mp, 0);
if (xfs_buf_ispinned(bp))
xfs_log_force(mp, 0);

return xfs_bwrite(mp, bp);
error = xfs_bwrite(bp);
xfs_buf_relse(bp);
return error;
}

/*
Expand Down

0 comments on commit ccc39a2

Please sign in to comment.