aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_buf.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-06-22 04:50:10 -0400
committerBen Myers <bpm@sgi.com>2012-07-01 15:50:05 -0400
commit6dde27077eaf590eac279627f74b7e4e40b864b2 (patch)
tree0556e1118b68fc251c33ba650a0ffc75e7caa8d9 /fs/xfs/xfs_buf.h
parent3e85c868a697805a3d4c7800a6bacdfc81d15cdf (diff)
xfs: add discontiguous buffer map interface
With the internal interfaces supporting discontiguous buffer maps, add external lookup, read and get interfaces so they can start to be used. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_buf.h')
-rw-r--r--fs/xfs/xfs_buf.h46
1 files changed, 40 insertions, 6 deletions
diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h
index 67d134994ae4..aa96bd410aed 100644
--- a/fs/xfs/xfs_buf.h
+++ b/fs/xfs/xfs_buf.h
@@ -184,12 +184,46 @@ xfs_buf_alloc(
184 return _xfs_buf_alloc(target, &map, 1, flags); 184 return _xfs_buf_alloc(target, &map, 1, flags);
185} 185}
186 186
187struct xfs_buf *xfs_buf_get(struct xfs_buftarg *target, xfs_daddr_t blkno, 187struct xfs_buf *xfs_buf_get_map(struct xfs_buftarg *target,
188 size_t numblks, xfs_buf_flags_t flags); 188 struct xfs_buf_map *map, int nmaps,
189struct xfs_buf *xfs_buf_read(struct xfs_buftarg *target, xfs_daddr_t blkno, 189 xfs_buf_flags_t flags);
190 size_t numblks, xfs_buf_flags_t flags); 190struct xfs_buf *xfs_buf_read_map(struct xfs_buftarg *target,
191void xfs_buf_readahead(struct xfs_buftarg *target, xfs_daddr_t blkno, 191 struct xfs_buf_map *map, int nmaps,
192 size_t numblks); 192 xfs_buf_flags_t flags);
193void xfs_buf_readahead_map(struct xfs_buftarg *target,
194 struct xfs_buf_map *map, int nmaps);
195
196static inline struct xfs_buf *
197xfs_buf_get(
198 struct xfs_buftarg *target,
199 xfs_daddr_t blkno,
200 size_t numblks,
201 xfs_buf_flags_t flags)
202{
203 DEFINE_SINGLE_BUF_MAP(map, blkno, numblks);
204 return xfs_buf_get_map(target, &map, 1, flags);
205}
206
207static inline struct xfs_buf *
208xfs_buf_read(
209 struct xfs_buftarg *target,
210 xfs_daddr_t blkno,
211 size_t numblks,
212 xfs_buf_flags_t flags)
213{
214 DEFINE_SINGLE_BUF_MAP(map, blkno, numblks);
215 return xfs_buf_read_map(target, &map, 1, flags);
216}
217
218static inline void
219xfs_buf_readahead(
220 struct xfs_buftarg *target,
221 xfs_daddr_t blkno,
222 size_t numblks)
223{
224 DEFINE_SINGLE_BUF_MAP(map, blkno, numblks);
225 return xfs_buf_readahead_map(target, &map, 1);
226}
193 227
194struct xfs_buf *xfs_buf_get_empty(struct xfs_buftarg *target, size_t numblks); 228struct xfs_buf *xfs_buf_get_empty(struct xfs_buftarg *target, size_t numblks);
195void xfs_buf_set_empty(struct xfs_buf *bp, size_t numblks); 229void xfs_buf_set_empty(struct xfs_buf *bp, size_t numblks);