aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_buf.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-04-23 01:58:49 -0400
committerBen Myers <bpm@sgi.com>2012-05-14 17:20:45 -0400
commite70b73f84f474cc594a39bd8ff083974e6d69aea (patch)
tree0d365698ca2b6542aab8ca92c8e1f23b9c43da55 /fs/xfs/xfs_buf.h
parentbf813cdddfb3a5bc88e1612e8f62a12367871213 (diff)
xfs: clean up buffer get/read call API
The xfs_buf_get/read API is not consistent in the units it uses, and does not use appropriate or consistent units/types for the variables. Convert the API to use disk addresses and block counts for all buffer get and read calls. Use consistent naming for all the functions and their declarations, and convert the internal functions to use disk addresses and block counts to avoid need to convert them from one type to another and back again. Fix all the callers to use disk addresses and block counts. In many cases, this removes an additional conversion from the function call as the callers already have a block count. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_buf.h')
-rw-r--r--fs/xfs/xfs_buf.h38
1 files changed, 21 insertions, 17 deletions
diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h
index 87a474853f8a..ffd6da045d22 100644
--- a/fs/xfs/xfs_buf.h
+++ b/fs/xfs/xfs_buf.h
@@ -150,26 +150,30 @@ typedef struct xfs_buf {
150 150
151 151
152/* Finding and Reading Buffers */ 152/* Finding and Reading Buffers */
153extern xfs_buf_t *_xfs_buf_find(xfs_buftarg_t *, xfs_off_t, size_t, 153struct xfs_buf *_xfs_buf_find(struct xfs_buftarg *target, xfs_daddr_t blkno,
154 xfs_buf_flags_t, xfs_buf_t *); 154 size_t numblks, xfs_buf_flags_t flags,
155 struct xfs_buf *new_bp);
155#define xfs_incore(buftarg,blkno,len,lockit) \ 156#define xfs_incore(buftarg,blkno,len,lockit) \
156 _xfs_buf_find(buftarg, blkno ,len, lockit, NULL) 157 _xfs_buf_find(buftarg, blkno ,len, lockit, NULL)
157 158
158extern xfs_buf_t *xfs_buf_get(xfs_buftarg_t *, xfs_off_t, size_t, 159struct xfs_buf *xfs_buf_get(struct xfs_buftarg *target, xfs_daddr_t blkno,
159 xfs_buf_flags_t); 160 size_t numblks, xfs_buf_flags_t flags);
160extern xfs_buf_t *xfs_buf_read(xfs_buftarg_t *, xfs_off_t, size_t, 161struct xfs_buf *xfs_buf_read(struct xfs_buftarg *target, xfs_daddr_t blkno,
161 xfs_buf_flags_t); 162 size_t numblks, xfs_buf_flags_t flags);
162 163void xfs_buf_readahead(struct xfs_buftarg *target, xfs_daddr_t blkno,
163struct xfs_buf *xfs_buf_alloc(struct xfs_buftarg *, xfs_off_t, size_t, 164 size_t numblks);
164 xfs_buf_flags_t); 165
165extern void xfs_buf_set_empty(struct xfs_buf *bp, size_t len); 166struct xfs_buf *xfs_buf_get_empty(struct xfs_buftarg *target, size_t numblks);
166extern xfs_buf_t *xfs_buf_get_uncached(struct xfs_buftarg *, size_t, int); 167struct xfs_buf *xfs_buf_alloc(struct xfs_buftarg *target, xfs_daddr_t blkno,
167extern int xfs_buf_associate_memory(xfs_buf_t *, void *, size_t); 168 size_t numblks, xfs_buf_flags_t flags);
168extern void xfs_buf_hold(xfs_buf_t *); 169void xfs_buf_set_empty(struct xfs_buf *bp, size_t numblks);
169extern void xfs_buf_readahead(xfs_buftarg_t *, xfs_off_t, size_t); 170int xfs_buf_associate_memory(struct xfs_buf *bp, void *mem, size_t length);
170struct xfs_buf *xfs_buf_read_uncached(struct xfs_mount *mp, 171
171 struct xfs_buftarg *target, 172struct xfs_buf *xfs_buf_get_uncached(struct xfs_buftarg *target, size_t numblks,
172 xfs_daddr_t daddr, size_t length, int flags); 173 int flags);
174struct xfs_buf *xfs_buf_read_uncached(struct xfs_buftarg *target,
175 xfs_daddr_t daddr, size_t numblks, int flags);
176void xfs_buf_hold(struct xfs_buf *bp);
173 177
174/* Releasing Buffers */ 178/* Releasing Buffers */
175extern void xfs_buf_free(xfs_buf_t *); 179extern void xfs_buf_free(xfs_buf_t *);