* Use is subject to license terms.
*/
/*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*/
return count;
}
+static int ll_rd_statahead_agl(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);
+
+ return snprintf(page, count, "%u\n",
+ sbi->ll_flags & LL_SBI_AGL_ENABLED ? 1 : 0);
+}
+
+static int ll_wr_statahead_agl(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)
+ sbi->ll_flags |= LL_SBI_AGL_ENABLED;
+ else
+ sbi->ll_flags &= ~LL_SBI_AGL_ENABLED;
+
+ return count;
+}
+
static int ll_rd_statahead_stats(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
return snprintf(page, count,
"statahead total: %u\n"
- "statahead wrong: %u\n",
+ "statahead wrong: %u\n"
+ "agl total: %u\n",
atomic_read(&sbi->ll_sa_total),
- atomic_read(&sbi->ll_sa_wrong));
+ atomic_read(&sbi->ll_sa_wrong),
+ atomic_read(&sbi->ll_agl_total));
}
static int ll_rd_lazystatfs(char *page, char **start, off_t off,
{ "stats_track_ppid", ll_rd_track_ppid, ll_wr_track_ppid, 0 },
{ "stats_track_gid", ll_rd_track_gid, ll_wr_track_gid, 0 },
{ "statahead_max", ll_rd_statahead_max, ll_wr_statahead_max, 0 },
+ { "statahead_agl", ll_rd_statahead_agl, ll_wr_statahead_agl, 0 },
{ "statahead_stats", ll_rd_statahead_stats, 0, 0 },
{ "lazystatfs", ll_rd_lazystatfs, ll_wr_lazystatfs, 0 },
{ 0 }