if (rc)
return rc;
- if (pages_number < 0 || pages_number > num_physpages / 2) {
+ if (pages_number < 0 || pages_number > totalram_pages / 2) {
/* 1/2 of RAM */
CERROR("can't set file readahead more than %lu MB\n",
- num_physpages >> (20 - PAGE_CACHE_SHIFT + 1));
+ totalram_pages >> (20 - PAGE_CACHE_SHIFT + 1));
return -ERANGE;
}
if (rc)
RETURN(rc);
- if (pages_number < 0 || pages_number > num_physpages) {
+ if (pages_number < 0 || pages_number > totalram_pages) {
CERROR("%s: can't set max cache more than %lu MB\n",
ll_get_fsname(sb, NULL, 0),
- num_physpages >> (20 - PAGE_CACHE_SHIFT));
+ totalram_pages >> (20 - PAGE_CACHE_SHIFT));
RETURN(-ERANGE);
}
return rc;
}
+static int ll_rd_unstable_stats(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct super_block *sb = data;
+ struct ll_sb_info *sbi = ll_s2sbi(sb);
+ struct cl_client_cache *cache = &sbi->ll_cache;
+ int pages, mb, rc;
+
+ pages = cfs_atomic_read(&cache->ccc_unstable_nr);
+ mb = (pages * PAGE_CACHE_SIZE) >> 20;
+
+ rc = snprintf(page, count, "unstable_pages: %8d\n"
+ "unstable_mb: %8d\n", pages, mb);
+
+ return rc;
+}
+
static struct lprocfs_vars lprocfs_llite_obd_vars[] = {
{ "uuid", ll_rd_sb_uuid, 0, 0 },
//{ "mntpt_path", ll_rd_path, 0, 0 },
{ "max_easize", ll_rd_maxea_size, 0, 0 },
{ "sbi_flags", ll_rd_sbi_flags, 0, 0 },
{ "xattr_cache", ll_rd_xattr_cache, ll_wr_xattr_cache, 0 },
+ { "unstable_stats", ll_rd_unstable_stats, 0, 0},
{ 0 }
};