diff options
author | Christoph Hellwig <hch@infradead.org> | 2009-11-24 13:02:23 -0500 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2009-12-11 16:11:21 -0500 |
commit | 6ad112bfb5af537e9e3103c807748bb4a99bbd9e (patch) | |
tree | 783d7ea24d916914914287f696c1a957e495bd59 /fs/xfs/xfs_trans_buf.c | |
parent | c355c656fede21f6e967816a603905f0ad6a7311 (diff) |
xfs: simplify xfs_buf_get / xfs_buf_read interfaces
Currently the low-level buffer cache interfaces are highly confusing
as we have a _flags variant of each that does actually respect the
flags, and one without _flags which has a flags argument that gets
ignored and overriden with a default set. Given that very few places
use the default arguments get rid of the duplication and convert all
callers to pass the flags explicitly. Also remove the now confusing
_flags postfix.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_trans_buf.c')
-rw-r--r-- | fs/xfs/xfs_trans_buf.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c index 218829e6a152..03a1f701fea8 100644 --- a/fs/xfs/xfs_trans_buf.c +++ b/fs/xfs/xfs_trans_buf.c | |||
@@ -79,11 +79,8 @@ xfs_trans_get_buf(xfs_trans_t *tp, | |||
79 | /* | 79 | /* |
80 | * Default to a normal get_buf() call if the tp is NULL. | 80 | * Default to a normal get_buf() call if the tp is NULL. |
81 | */ | 81 | */ |
82 | if (tp == NULL) { | 82 | if (tp == NULL) |
83 | bp = xfs_buf_get_flags(target_dev, blkno, len, | 83 | return xfs_buf_get(target_dev, blkno, len, flags | BUF_BUSY); |
84 | flags | BUF_BUSY); | ||
85 | return(bp); | ||
86 | } | ||
87 | 84 | ||
88 | /* | 85 | /* |
89 | * If we find the buffer in the cache with this transaction | 86 | * If we find the buffer in the cache with this transaction |
@@ -129,7 +126,7 @@ xfs_trans_get_buf(xfs_trans_t *tp, | |||
129 | * easily deadlock with our current transaction as well as cause | 126 | * easily deadlock with our current transaction as well as cause |
130 | * us to run out of stack space. | 127 | * us to run out of stack space. |
131 | */ | 128 | */ |
132 | bp = xfs_buf_get_flags(target_dev, blkno, len, flags | BUF_BUSY); | 129 | bp = xfs_buf_get(target_dev, blkno, len, flags | BUF_BUSY); |
133 | if (bp == NULL) { | 130 | if (bp == NULL) { |
134 | return NULL; | 131 | return NULL; |
135 | } | 132 | } |
@@ -302,7 +299,7 @@ xfs_trans_read_buf( | |||
302 | * Default to a normal get_buf() call if the tp is NULL. | 299 | * Default to a normal get_buf() call if the tp is NULL. |
303 | */ | 300 | */ |
304 | if (tp == NULL) { | 301 | if (tp == NULL) { |
305 | bp = xfs_buf_read_flags(target, blkno, len, flags | BUF_BUSY); | 302 | bp = xfs_buf_read(target, blkno, len, flags | BUF_BUSY); |
306 | if (!bp) | 303 | if (!bp) |
307 | return (flags & XFS_BUF_TRYLOCK) ? | 304 | return (flags & XFS_BUF_TRYLOCK) ? |
308 | EAGAIN : XFS_ERROR(ENOMEM); | 305 | EAGAIN : XFS_ERROR(ENOMEM); |
@@ -398,7 +395,7 @@ xfs_trans_read_buf( | |||
398 | * easily deadlock with our current transaction as well as cause | 395 | * easily deadlock with our current transaction as well as cause |
399 | * us to run out of stack space. | 396 | * us to run out of stack space. |
400 | */ | 397 | */ |
401 | bp = xfs_buf_read_flags(target, blkno, len, flags | BUF_BUSY); | 398 | bp = xfs_buf_read(target, blkno, len, flags | BUF_BUSY); |
402 | if (bp == NULL) { | 399 | if (bp == NULL) { |
403 | *bpp = NULL; | 400 | *bpp = NULL; |
404 | return 0; | 401 | return 0; |