Mercurial > linux > xfs-patches
changeset 2:818e80678261
fixed up patch message & fixed a bug
author | Josef "Jeff" Sipek <jsipek@cs.sunysb.edu> |
---|---|
date | Sun, 29 Jul 2007 01:22:38 -0400 |
parents | be7e3e4b76b7 |
children | 4184ac3250c3 |
files | xfs-save-buf-reference-count-as-page-weight |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/xfs-save-buf-reference-count-as-page-weight Sun Jul 29 01:16:05 2007 -0400 +++ b/xfs-save-buf-reference-count-as-page-weight Sun Jul 29 01:22:38 2007 -0400 @@ -1,12 +1,13 @@ XFS: Save buffer type and references count -Save values passed to XFS_BUF_SET_{VTYPE,REF,VTYPE_REF} inside the xfs_buf_t -struct. +Save buffer type passed to XFS_BUF_SET_{VTYPE,REF,VTYPE_REF} inside the +xfs_buf_t struct; and convert XFS buffer references counter to a valid page +weight. Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu> diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h -index b5908a3..99099d0 100644 +index b5908a3..a94cb4a 100644 --- a/fs/xfs/linux-2.6/xfs_buf.h +++ b/fs/xfs/linux-2.6/xfs_buf.h @@ -31,6 +31,19 @@ @@ -52,10 +53,10 @@ +static inline void XFS_BUF_SET_REF(xfs_buf_t *bp, char ref) +{ + int i; -+ int weight = !!(ref-1); ++ int weight = (ref > 1) ? (NR_INACTIVE_LISTS - 1) : 0; + + for (i = 0; i < XFS_BUF_SIZE(bp); i++) -+ set_page_weight(bp->b_pages, weight); ++ set_page_weight(bp->b_pages[i], weight); +} + +static inline void XFS_BUF_SET_VTYPE_REF(xfs_buf_t *bp, xfs_bvtype_t type,