* GPL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
#include "osd_internal.h"
#ifdef LPROCFS
-enum {
- LPROC_OSD_NR
-};
static const char *osd_counter_names[LPROC_OSD_NR] = {
+#if OSD_THANDLE_STATS
+ [LPROC_OSD_THANDLE_STARTING] = "thandle starting",
+ [LPROC_OSD_THANDLE_OPEN] = "thandle open",
+ [LPROC_OSD_THANDLE_CLOSING] = "thandle closing"
+#endif
};
int osd_procfs_init(struct osd_device *osd, const char *name)
osd->od_mount->lmi_mnt->mnt_devname);
}
+#ifdef HAVE_LDISKFS_PDO
+static int lprocfs_osd_rd_pdo(char *page, char **start, off_t off, int count,
+ int *eof, void *data)
+{
+ *eof = 1;
+
+ return snprintf(page, count, "%s\n", ldiskfs_pdo ? "ON" : "OFF");
+}
+
+static int lprocfs_osd_wr_pdo(struct file *file, const char *buffer,
+ unsigned long count, void *data)
+{
+ int pdo;
+ int rc;
+
+ rc = lprocfs_write_helper(buffer, count, &pdo);
+ if (rc != 0)
+ return rc;
+
+ ldiskfs_pdo = !!pdo;
+
+ return count;
+}
+#endif
+
struct lprocfs_vars lprocfs_osd_obd_vars[] = {
{ "blocksize", lprocfs_osd_rd_blksize, 0, 0 },
{ "kbytestotal", lprocfs_osd_rd_kbytestotal, 0, 0 },
{ "filesfree", lprocfs_osd_rd_filesfree, 0, 0 },
{ "fstype", lprocfs_osd_rd_fstype, 0, 0 },
{ "mntdev", lprocfs_osd_rd_mntdev, 0, 0 },
+#ifdef HAVE_LDISKFS_PDO
+ { "pdo", lprocfs_osd_rd_pdo, lprocfs_osd_wr_pdo, 0 },
+#endif
{ 0 }
};