The patch titled readahead: common macros has been added to the -mm tree. Its filename is readahead-common-macros.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: readahead: common macros From: Wu Fengguang <wfg@xxxxxxxxxxxxxxxx> Define some common used macros for the read-ahead logics. Signed-off-by: Wu Fengguang <wfg@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- mm/readahead.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff -puN mm/readahead.c~readahead-common-macros mm/readahead.c --- 25/mm/readahead.c~readahead-common-macros Wed May 24 16:49:11 2006 +++ 25-akpm/mm/readahead.c Wed May 24 16:49:11 2006 @@ -5,6 +5,8 @@ * * 09Apr2002 akpm@xxxxxxxxxx * Initial version. + * 21May2006 Wu Fengguang <wfg@xxxxxxxxxxxxxxxx> + * Adaptive read-ahead framework. */ #include <linux/kernel.h> @@ -14,6 +16,14 @@ #include <linux/blkdev.h> #include <linux/backing-dev.h> #include <linux/pagevec.h> +#include <linux/writeback.h> +#include <linux/nfsd/const.h> + +#define PAGES_BYTE(size) (((size) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT) +#define PAGES_KB(size) PAGES_BYTE((size)*1024) + +#define next_page(pg) (list_entry((pg)->lru.prev, struct page, lru)) +#define prev_page(pg) (list_entry((pg)->lru.next, struct page, lru)) void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page) { @@ -21,7 +31,7 @@ void default_unplug_io_fn(struct backing EXPORT_SYMBOL(default_unplug_io_fn); struct backing_dev_info default_backing_dev_info = { - .ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE, + .ra_pages = PAGES_KB(VM_MAX_READAHEAD), .state = 0, .capabilities = BDI_CAP_MAP_COPY, .unplug_io_fn = default_unplug_io_fn, @@ -50,7 +60,7 @@ static inline unsigned long get_max_read static inline unsigned long get_min_readahead(struct file_ra_state *ra) { - return (VM_MIN_READAHEAD * 1024) / PAGE_CACHE_SIZE; + return PAGES_KB(VM_MIN_READAHEAD); } static inline void reset_ahead_window(struct file_ra_state *ra) _ Patches currently in -mm which might be from wfg@xxxxxxxxxxxxxxxx are readahead-kconfig-options.patch radixtree-look-aside-cache.patch radixtree-hole-scanning-functions.patch readahead-page-flag-pg_readahead.patch readahead-refactor-do_generic_mapping_read.patch readahead-refactor-__do_page_cache_readahead.patch readahead-insert-cond_resched-calls.patch readahead-common-macros.patch readahead-events-accounting.patch readahead-support-functions.patch readahead-sysctl-parameters.patch readahead-min-max-sizes.patch readahead-state-based-method-aging-accounting.patch readahead-state-based-method-data-structure.patch readahead-state-based-method-routines.patch readahead-state-based-method.patch readahead-context-based-method.patch readahead-initial-method-guiding-sizes.patch readahead-initial-method-thrashing-guard-size.patch readahead-initial-method-expected-read-size.patch readahead-initial-method-user-recommended-size.patch readahead-initial-method.patch readahead-backward-prefetching-method.patch readahead-seeking-reads-method.patch readahead-thrashing-recovery-method.patch readahead-call-scheme.patch readahead-laptop-mode.patch readahead-loop-case.patch readahead-nfsd-case.patch readahead-turn-on-by-default.patch readahead-debug-radix-tree-new-functions.patch readahead-debug-traces-showing-accessed-file-names.patch readahead-debug-traces-showing-read-patterns.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html