Skip to content
Snippets Groups Projects
Commit 3f14fe67 authored by Yang Sheng's avatar Yang Sheng
Browse files

Branch HEAD

b=14576
i=shadow, nikita

Add own nr_free_buffer_pages() function when it wasn't exported.
parent 0bf4bc1e
No related branches found
No related tags found
No related merge requests found
...@@ -383,6 +383,17 @@ int ll_unregister_blkdev(unsigned int dev, const char *name) ...@@ -383,6 +383,17 @@ int ll_unregister_blkdev(unsigned int dev, const char *name)
#define ll_inode_blksize(a) (1<<(a)->i_blkbits) #define ll_inode_blksize(a) (1<<(a)->i_blkbits)
#endif #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 #ifdef FS_ODD_RENAME
#define FS_RENAME_DOES_D_MOVE FS_ODD_RENAME #define FS_RENAME_DOES_D_MOVE FS_ODD_RENAME
......
...@@ -553,7 +553,7 @@ static int lu_htable_order(void) ...@@ -553,7 +553,7 @@ static int lu_htable_order(void)
* *
* Size of lu_object is (arbitrary) taken as 1K (together with inode). * 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); LU_CACHE_PERCENT * (CFS_PAGE_SIZE / 1024);
for (bits = 1; (1 << bits) < cache_size; ++bits) { for (bits = 1; (1 << bits) < cache_size; ++bits) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment