Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213256
b: refs/heads/master
c: 5adc94c
h: refs/heads/master
v: v3
  • Loading branch information
Dave Chinner authored and Alex Elder committed Oct 18, 2010
1 parent c4a14f0 commit 02c2858
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 686865f76e35b28ba7aa6afa19209426f0da6201
refs/heads/master: 5adc94c247c3779782c7b0b8b5e28cf50596eb37
34 changes: 34 additions & 0 deletions trunk/fs/xfs/linux-2.6/xfs_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,40 @@ xfs_buf_readahead(
xfs_buf_read(target, ioff, isize, flags);
}

/*
* Read an uncached buffer from disk. Allocates and returns a locked
* buffer containing the disk contents or nothing.
*/
struct xfs_buf *
xfs_buf_read_uncached(
struct xfs_mount *mp,
struct xfs_buftarg *target,
xfs_daddr_t daddr,
size_t length,
int flags)
{
xfs_buf_t *bp;
int error;

bp = xfs_buf_get_uncached(target, length, flags);
if (!bp)
return NULL;

/* set up the buffer for a read IO */
xfs_buf_lock(bp);
XFS_BUF_SET_ADDR(bp, daddr);
XFS_BUF_READ(bp);
XFS_BUF_BUSY(bp);

xfsbdstrat(mp, bp);
error = xfs_iowait(bp);
if (error || bp->b_error) {
xfs_buf_relse(bp);
return NULL;
}
return bp;
}

xfs_buf_t *
xfs_buf_get_empty(
size_t len,
Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/xfs/linux-2.6/xfs_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ extern int xfs_buf_associate_memory(xfs_buf_t *, void *, size_t);
extern void xfs_buf_hold(xfs_buf_t *);
extern void xfs_buf_readahead(xfs_buftarg_t *, xfs_off_t, size_t,
xfs_buf_flags_t);
struct xfs_buf *xfs_buf_read_uncached(struct xfs_mount *mp,
struct xfs_buftarg *target,
xfs_daddr_t daddr, size_t length, int flags);

/* Releasing Buffers */
extern void xfs_buf_free(xfs_buf_t *);
Expand Down

0 comments on commit 02c2858

Please sign in to comment.