diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index 2007a74fb632e9e16ed8171da6a47e2fb8454034..5bbac966bcec6a0a0b2a7181d15b83ddd72c7066 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -383,6 +383,17 @@ int ll_unregister_blkdev(unsigned int dev, const char *name) #define ll_inode_blksize(a) (1<<(a)->i_blkbits) #endif +#ifndef HAVE_EXPORT_NR_FREE_BUFFER_PAGES +static inline unsigned int ll_nr_free_buffer_pages(void) +{ + struct sysinfo si; + + si_meminfo(&si); + return (unsigned int)(si.freeram - si.freehigh); +} +#else +#define ll_nr_free_buffer_pages() nr_free_buffer_pages() +#endif #ifdef FS_ODD_RENAME #define FS_RENAME_DOES_D_MOVE FS_ODD_RENAME diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c index ee55b41788b5980b89792b0f85f42b0e81ce3747..9850941484b0841e8eafac094eb7fcc373225c6d 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -553,7 +553,7 @@ static int lu_htable_order(void) * * Size of lu_object is (arbitrary) taken as 1K (together with inode). */ - cache_size = nr_free_buffer_pages() / 100 * + cache_size = ll_nr_free_buffer_pages() / 100 * LU_CACHE_PERCENT * (CFS_PAGE_SIZE / 1024); for (bits = 1; (1 << bits) < cache_size; ++bits) {