Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181792
b: refs/heads/master
c: 64e0bc7
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Alex Elder committed Jan 15, 2010
1 parent eb9712e commit 5977eee
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 51 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: 873ff5501d8cd1a21045d6c1da34f0c3876bc235
refs/heads/master: 64e0bc7d2a6609ad265757a600e2a0d93c8adb47
27 changes: 27 additions & 0 deletions trunk/fs/xfs/linux-2.6/xfs_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,33 @@ xfs_buf_ioerror(
trace_xfs_buf_ioerror(bp, error, _RET_IP_);
}

int
xfs_bwrite(
struct xfs_mount *mp,
struct xfs_buf *bp)
{
int iowait = (bp->b_flags & XBF_ASYNC) == 0;
int error = 0;

bp->b_strat = xfs_bdstrat_cb;
bp->b_mount = mp;
bp->b_flags |= XBF_WRITE;
if (!iowait)
bp->b_flags |= _XBF_RUN_QUEUES;

xfs_buf_delwri_dequeue(bp);
xfs_buf_iostrategy(bp);

if (iowait) {
error = xfs_buf_iowait(bp);
if (error)
xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR);
xfs_buf_relse(bp);
}

return error;
}

int
xfs_bawrite(
void *mp,
Expand Down
19 changes: 1 addition & 18 deletions trunk/fs/xfs/linux-2.6/xfs_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ extern void xfs_buf_lock(xfs_buf_t *);
extern void xfs_buf_unlock(xfs_buf_t *);

/* Buffer Read and Write Routines */
extern int xfs_bwrite(struct xfs_mount *mp, struct xfs_buf *bp);
extern int xfs_bawrite(void *mp, xfs_buf_t *bp);
extern void xfs_bdwrite(void *mp, xfs_buf_t *bp);
extern void xfs_buf_ioend(xfs_buf_t *, int);
Expand Down Expand Up @@ -390,24 +391,6 @@ static inline void xfs_buf_relse(xfs_buf_t *bp)
#define xfs_biozero(bp, off, len) \
xfs_buf_iomove((bp), (off), (len), NULL, XBRW_ZERO)


static inline int XFS_bwrite(xfs_buf_t *bp)
{
int iowait = (bp->b_flags & XBF_ASYNC) == 0;
int error = 0;

if (!iowait)
bp->b_flags |= _XBF_RUN_QUEUES;

xfs_buf_delwri_dequeue(bp);
xfs_buf_iostrategy(bp);
if (iowait) {
error = xfs_buf_iowait(bp);
xfs_buf_relse(bp);
}
return error;
}

#define xfs_iowait(bp) xfs_buf_iowait(bp)

#define xfs_baread(target, rablkno, ralen) \
Expand Down
31 changes: 0 additions & 31 deletions trunk/fs/xfs/xfs_rw.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,37 +305,6 @@ xfs_read_buf(
return (error);
}

/*
* Wrapper around bwrite() so that we can trap
* write errors, and act accordingly.
*/
int
xfs_bwrite(
struct xfs_mount *mp,
struct xfs_buf *bp)
{
int error;

/*
* XXXsup how does this work for quotas.
*/
XFS_BUF_SET_BDSTRAT_FUNC(bp, xfs_bdstrat_cb);
bp->b_mount = mp;
XFS_BUF_WRITE(bp);

if ((error = XFS_bwrite(bp))) {
ASSERT(mp);
/*
* Cannot put a buftrace here since if the buffer is not
* B_HOLD then we will brelse() the buffer before returning
* from bwrite and we could be tracing a buffer that has
* been reused.
*/
xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR);
}
return (error);
}

/*
* helper function to extract extent size hint from inode
*/
Expand Down
1 change: 0 additions & 1 deletion trunk/fs/xfs/xfs_rw.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb)
* Prototypes for functions in xfs_rw.c.
*/
extern int xfs_write_clear_setuid(struct xfs_inode *ip);
extern int xfs_bwrite(struct xfs_mount *mp, struct xfs_buf *bp);
extern int xfs_bioerror(struct xfs_buf *bp);
extern int xfs_bioerror_relse(struct xfs_buf *bp);
extern int xfs_read_buf(struct xfs_mount *mp, xfs_buftarg_t *btp,
Expand Down

0 comments on commit 5977eee

Please sign in to comment.