Commit 821eb21d97a8b686649c08b7284d0b9f34d0e138

Authored by Dave Chinner
Committed by Dave Chinner
1 parent 430cbeb86f

xfs: connect up buffer reclaim priority hooks

Now that the buffer reclaim infrastructure can handle different reclaim
priorities for different types of buffers, reconnect the hooks in the
XFS code that has been sitting dormant since it was ported to Linux. This
should finally give use reclaim prioritisation that is on a par with the
functionality that Irix provided XFS 15 years ago.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>

Showing 4 changed files with 14 additions and 9 deletions Side-by-side Diff

fs/xfs/linux-2.6/xfs_buf.h
... ... @@ -336,9 +336,15 @@
336 336 #define XFS_BUF_SIZE(bp) ((bp)->b_buffer_length)
337 337 #define XFS_BUF_SET_SIZE(bp, cnt) ((bp)->b_buffer_length = (cnt))
338 338  
339   -#define XFS_BUF_SET_VTYPE_REF(bp, type, ref) do { } while (0)
  339 +static inline void
  340 +xfs_buf_set_ref(
  341 + struct xfs_buf *bp,
  342 + int lru_ref)
  343 +{
  344 + atomic_set(&bp->b_lru_ref, lru_ref);
  345 +}
  346 +#define XFS_BUF_SET_VTYPE_REF(bp, type, ref) xfs_buf_set_ref(bp, ref)
340 347 #define XFS_BUF_SET_VTYPE(bp, type) do { } while (0)
341   -#define XFS_BUF_SET_REF(bp, ref) do { } while (0)
342 348  
343 349 #define XFS_BUF_ISPINNED(bp) atomic_read(&((bp)->b_pin_count))
344 350  
... ... @@ -634,9 +634,8 @@
634 634 return error;
635 635 }
636 636 ASSERT(!bp || !XFS_BUF_GETERROR(bp));
637   - if (bp != NULL) {
  637 + if (bp)
638 638 XFS_BUF_SET_VTYPE_REF(bp, B_FS_MAP, refval);
639   - }
640 639 *bpp = bp;
641 640 return 0;
642 641 }
643 642  
644 643  
... ... @@ -944,13 +943,13 @@
944 943 switch (cur->bc_btnum) {
945 944 case XFS_BTNUM_BNO:
946 945 case XFS_BTNUM_CNT:
947   - XFS_BUF_SET_VTYPE_REF(*bpp, B_FS_MAP, XFS_ALLOC_BTREE_REF);
  946 + XFS_BUF_SET_VTYPE_REF(bp, B_FS_MAP, XFS_ALLOC_BTREE_REF);
948 947 break;
949 948 case XFS_BTNUM_INO:
950   - XFS_BUF_SET_VTYPE_REF(*bpp, B_FS_INOMAP, XFS_INO_BTREE_REF);
  949 + XFS_BUF_SET_VTYPE_REF(bp, B_FS_INOMAP, XFS_INO_BTREE_REF);
951 950 break;
952 951 case XFS_BTNUM_BMAP:
953   - XFS_BUF_SET_VTYPE_REF(*bpp, B_FS_MAP, XFS_BMAP_BTREE_REF);
  952 + XFS_BUF_SET_VTYPE_REF(bp, B_FS_MAP, XFS_BMAP_BTREE_REF);
954 953 break;
955 954 default:
956 955 ASSERT(0);
... ... @@ -887,7 +887,7 @@
887 887 * around for a while. This helps to keep recently accessed
888 888 * meta-data in-core longer.
889 889 */
890   - XFS_BUF_SET_REF(bp, XFS_INO_REF);
  890 + xfs_buf_set_ref(bp, XFS_INO_REF);
891 891  
892 892 /*
893 893 * Use xfs_trans_brelse() to release the buffer containing the
... ... @@ -294,8 +294,8 @@
294 294 #define XFS_ALLOC_BTREE_REF 2
295 295 #define XFS_BMAP_BTREE_REF 2
296 296 #define XFS_DIR_BTREE_REF 2
  297 +#define XFS_INO_REF 2
297 298 #define XFS_ATTR_BTREE_REF 1
298   -#define XFS_INO_REF 1
299 299 #define XFS_DQUOT_REF 1
300 300  
301 301 #ifdef __KERNEL__