Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311976
b: refs/heads/master
c: 1632dcc
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Ben Myers committed Jul 13, 2012
1 parent 9b72a10 commit 572af22
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 32 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: 40a9b7963df32e743c45d79a5f41445fe2476f15
refs/heads/master: 1632dcc93f55f9ab407b373da1957a727b1a7fe3
51 changes: 22 additions & 29 deletions trunk/fs/xfs/xfs_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,27 +989,6 @@ xfs_buf_ioerror_alert(
(__uint64_t)XFS_BUF_ADDR(bp), func, bp->b_error, bp->b_length);
}

int
xfs_bwrite(
struct xfs_buf *bp)
{
int error;

ASSERT(xfs_buf_islocked(bp));

bp->b_flags |= XBF_WRITE;
bp->b_flags &= ~(XBF_ASYNC | XBF_READ | _XBF_DELWRI_Q);

xfs_bdstrat_cb(bp);

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

/*
* Called when we want to stop a buffer from getting written or read.
* We attach the EIO error, muck with its flags, and call xfs_buf_ioend
Expand Down Expand Up @@ -1079,14 +1058,7 @@ xfs_bioerror_relse(
return EIO;
}


/*
* All xfs metadata buffers except log state machine buffers
* get this attached as their b_bdstrat callback function.
* This is so that we can catch a buffer
* after prematurely unpinning it to forcibly shutdown the filesystem.
*/
int
STATIC int
xfs_bdstrat_cb(
struct xfs_buf *bp)
{
Expand All @@ -1107,6 +1079,27 @@ xfs_bdstrat_cb(
return 0;
}

int
xfs_bwrite(
struct xfs_buf *bp)
{
int error;

ASSERT(xfs_buf_islocked(bp));

bp->b_flags |= XBF_WRITE;
bp->b_flags &= ~(XBF_ASYNC | XBF_READ | _XBF_DELWRI_Q);

xfs_bdstrat_cb(bp);

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

/*
* Wrapper around bdstrat so that we can stop data from going to disk in case
* we are shutting down the filesystem. Typically user data goes thru this
Expand Down
1 change: 0 additions & 1 deletion trunk/fs/xfs/xfs_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ extern void xfs_buf_unlock(xfs_buf_t *);
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 *);

extern void xfs_buf_ioend(xfs_buf_t *, int);
extern void xfs_buf_ioerror(xfs_buf_t *, int);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/xfs/xfs_buf_item.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ xfs_buf_iodone_callbacks(

if (!XFS_BUF_ISSTALE(bp)) {
bp->b_flags |= XBF_WRITE | XBF_ASYNC | XBF_DONE;
xfs_bdstrat_cb(bp);
xfs_buf_iorequest(bp);
} else {
xfs_buf_relse(bp);
}
Expand Down

0 comments on commit 572af22

Please sign in to comment.