diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_buf.h')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.h | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h index 6a83b46b4bcf..620972b8094d 100644 --- a/fs/xfs/linux-2.6/xfs_buf.h +++ b/fs/xfs/linux-2.6/xfs_buf.h | |||
@@ -228,11 +228,15 @@ extern void xfs_buf_delwri_promote(xfs_buf_t *); | |||
228 | extern int xfs_buf_init(void); | 228 | extern int xfs_buf_init(void); |
229 | extern void xfs_buf_terminate(void); | 229 | extern void xfs_buf_terminate(void); |
230 | 230 | ||
231 | #define xfs_buf_target_name(target) \ | 231 | static inline const char * |
232 | ({ char __b[BDEVNAME_SIZE]; bdevname((target)->bt_bdev, __b); __b; }) | 232 | xfs_buf_target_name(struct xfs_buftarg *target) |
233 | { | ||
234 | static char __b[BDEVNAME_SIZE]; | ||
235 | |||
236 | return bdevname(target->bt_bdev, __b); | ||
237 | } | ||
233 | 238 | ||
234 | 239 | ||
235 | #define XFS_BUF_BFLAGS(bp) ((bp)->b_flags) | ||
236 | #define XFS_BUF_ZEROFLAGS(bp) \ | 240 | #define XFS_BUF_ZEROFLAGS(bp) \ |
237 | ((bp)->b_flags &= ~(XBF_READ|XBF_WRITE|XBF_ASYNC|XBF_DELWRI| \ | 241 | ((bp)->b_flags &= ~(XBF_READ|XBF_WRITE|XBF_ASYNC|XBF_DELWRI| \ |
238 | XBF_SYNCIO|XBF_FUA|XBF_FLUSH)) | 242 | XBF_SYNCIO|XBF_FUA|XBF_FLUSH)) |
@@ -251,23 +255,14 @@ void xfs_buf_stale(struct xfs_buf *bp); | |||
251 | #define XFS_BUF_UNDELAYWRITE(bp) xfs_buf_delwri_dequeue(bp) | 255 | #define XFS_BUF_UNDELAYWRITE(bp) xfs_buf_delwri_dequeue(bp) |
252 | #define XFS_BUF_ISDELAYWRITE(bp) ((bp)->b_flags & XBF_DELWRI) | 256 | #define XFS_BUF_ISDELAYWRITE(bp) ((bp)->b_flags & XBF_DELWRI) |
253 | 257 | ||
254 | #define XFS_BUF_ERROR(bp,no) xfs_buf_ioerror(bp,no) | ||
255 | #define XFS_BUF_GETERROR(bp) xfs_buf_geterror(bp) | ||
256 | #define XFS_BUF_ISERROR(bp) (xfs_buf_geterror(bp) ? 1 : 0) | ||
257 | |||
258 | #define XFS_BUF_DONE(bp) ((bp)->b_flags |= XBF_DONE) | 258 | #define XFS_BUF_DONE(bp) ((bp)->b_flags |= XBF_DONE) |
259 | #define XFS_BUF_UNDONE(bp) ((bp)->b_flags &= ~XBF_DONE) | 259 | #define XFS_BUF_UNDONE(bp) ((bp)->b_flags &= ~XBF_DONE) |
260 | #define XFS_BUF_ISDONE(bp) ((bp)->b_flags & XBF_DONE) | 260 | #define XFS_BUF_ISDONE(bp) ((bp)->b_flags & XBF_DONE) |
261 | 261 | ||
262 | #define XFS_BUF_BUSY(bp) do { } while (0) | ||
263 | #define XFS_BUF_UNBUSY(bp) do { } while (0) | ||
264 | #define XFS_BUF_ISBUSY(bp) (1) | ||
265 | |||
266 | #define XFS_BUF_ASYNC(bp) ((bp)->b_flags |= XBF_ASYNC) | 262 | #define XFS_BUF_ASYNC(bp) ((bp)->b_flags |= XBF_ASYNC) |
267 | #define XFS_BUF_UNASYNC(bp) ((bp)->b_flags &= ~XBF_ASYNC) | 263 | #define XFS_BUF_UNASYNC(bp) ((bp)->b_flags &= ~XBF_ASYNC) |
268 | #define XFS_BUF_ISASYNC(bp) ((bp)->b_flags & XBF_ASYNC) | 264 | #define XFS_BUF_ISASYNC(bp) ((bp)->b_flags & XBF_ASYNC) |
269 | 265 | ||
270 | #define XFS_BUF_HOLD(bp) xfs_buf_hold(bp) | ||
271 | #define XFS_BUF_READ(bp) ((bp)->b_flags |= XBF_READ) | 266 | #define XFS_BUF_READ(bp) ((bp)->b_flags |= XBF_READ) |
272 | #define XFS_BUF_UNREAD(bp) ((bp)->b_flags &= ~XBF_READ) | 267 | #define XFS_BUF_UNREAD(bp) ((bp)->b_flags &= ~XBF_READ) |
273 | #define XFS_BUF_ISREAD(bp) ((bp)->b_flags & XBF_READ) | 268 | #define XFS_BUF_ISREAD(bp) ((bp)->b_flags & XBF_READ) |
@@ -276,10 +271,6 @@ void xfs_buf_stale(struct xfs_buf *bp); | |||
276 | #define XFS_BUF_UNWRITE(bp) ((bp)->b_flags &= ~XBF_WRITE) | 271 | #define XFS_BUF_UNWRITE(bp) ((bp)->b_flags &= ~XBF_WRITE) |
277 | #define XFS_BUF_ISWRITE(bp) ((bp)->b_flags & XBF_WRITE) | 272 | #define XFS_BUF_ISWRITE(bp) ((bp)->b_flags & XBF_WRITE) |
278 | 273 | ||
279 | #define XFS_BUF_SET_START(bp) do { } while (0) | ||
280 | |||
281 | #define XFS_BUF_PTR(bp) (xfs_caddr_t)((bp)->b_addr) | ||
282 | #define XFS_BUF_SET_PTR(bp, val, cnt) xfs_buf_associate_memory(bp, val, cnt) | ||
283 | #define XFS_BUF_ADDR(bp) ((bp)->b_bn) | 274 | #define XFS_BUF_ADDR(bp) ((bp)->b_bn) |
284 | #define XFS_BUF_SET_ADDR(bp, bno) ((bp)->b_bn = (xfs_daddr_t)(bno)) | 275 | #define XFS_BUF_SET_ADDR(bp, bno) ((bp)->b_bn = (xfs_daddr_t)(bno)) |
285 | #define XFS_BUF_OFFSET(bp) ((bp)->b_file_offset) | 276 | #define XFS_BUF_OFFSET(bp) ((bp)->b_file_offset) |
@@ -299,14 +290,13 @@ xfs_buf_set_ref( | |||
299 | #define XFS_BUF_SET_VTYPE_REF(bp, type, ref) xfs_buf_set_ref(bp, ref) | 290 | #define XFS_BUF_SET_VTYPE_REF(bp, type, ref) xfs_buf_set_ref(bp, ref) |
300 | #define XFS_BUF_SET_VTYPE(bp, type) do { } while (0) | 291 | #define XFS_BUF_SET_VTYPE(bp, type) do { } while (0) |
301 | 292 | ||
302 | #define XFS_BUF_ISPINNED(bp) atomic_read(&((bp)->b_pin_count)) | 293 | static inline int xfs_buf_ispinned(struct xfs_buf *bp) |
294 | { | ||
295 | return atomic_read(&bp->b_pin_count); | ||
296 | } | ||
303 | 297 | ||
304 | #define XFS_BUF_FINISH_IOWAIT(bp) complete(&bp->b_iowait); | 298 | #define XFS_BUF_FINISH_IOWAIT(bp) complete(&bp->b_iowait); |
305 | 299 | ||
306 | #define XFS_BUF_SET_TARGET(bp, target) ((bp)->b_target = (target)) | ||
307 | #define XFS_BUF_TARGET(bp) ((bp)->b_target) | ||
308 | #define XFS_BUFTARG_NAME(target) xfs_buf_target_name(target) | ||
309 | |||
310 | static inline void xfs_buf_relse(xfs_buf_t *bp) | 300 | static inline void xfs_buf_relse(xfs_buf_t *bp) |
311 | { | 301 | { |
312 | xfs_buf_unlock(bp); | 302 | xfs_buf_unlock(bp); |