-static int ll_rd_max_read_ahead_mb(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);
- unsigned val;
-
- spin_lock(&sbi->ll_lock);
- val = (sbi->ll_max_read_ahead_pages << PAGE_CACHE_SHIFT) >> 20;
- spin_unlock(&sbi->ll_lock);
-
- return snprintf(page, count, "%u\n", val);
-}
-
-static int ll_wr_max_read_ahead_mb(struct file *file, const char *buffer,
- unsigned long count, void *data)
-{
- struct super_block *sb = data;
- struct ll_sb_info *sbi = ll_s2sbi(sb);
- int val, rc;
-
- rc = lprocfs_write_helper(buffer, count, &val);
- if (rc)
- return rc;
-
- if (val < 0 || val > (num_physpages << PAGE_SHIFT) >> 20)
- return -ERANGE;
-
- spin_lock(&sbi->ll_lock);
- sbi->ll_max_read_ahead_pages = (val << 20) >> PAGE_CACHE_SHIFT;
- spin_unlock(&sbi->ll_lock);
-
- return count;
-}
-