int dt_global_init(void);
void dt_global_fini(void);
+# ifdef LPROCFS
+int lprocfs_dt_rd_blksize(char *page, char **start, off_t off,
+ int count, int *eof, void *data);
+int lprocfs_dt_rd_kbytestotal(char *page, char **start, off_t off,
+ int count, int *eof, void *data);
+int lprocfs_dt_rd_kbytesfree(char *page, char **start, off_t off,
+ int count, int *eof, void *data);
+int lprocfs_dt_rd_kbytesavail(char *page, char **start, off_t off,
+ int count, int *eof, void *data);
+int lprocfs_dt_rd_filestotal(char *page, char **start, off_t off,
+ int count, int *eof, void *data);
+int lprocfs_dt_rd_filesfree(char *page, char **start, off_t off,
+ int count, int *eof, void *data);
+# endif /* LPROCFS */
+
#endif /* __LUSTRE_DT_OBJECT_H */
int count, int *eof, void *data);
extern int lprocfs_rd_filegroups(char *page, char **start, off_t off,
int count, int *eof, void *data);
-extern int lprocfs_osd_rd_blksize(char *page, char **start, off_t off,
- int count, int *eof, void *data);
-extern int lprocfs_osd_rd_kbytesfree(char *page, char **start, off_t off,
- int count, int *eof, void *data);
-extern int lprocfs_osd_rd_kbytesavail(char *page, char **start, off_t off,
- int count, int *eof, void *data);
-extern int lprocfs_osd_rd_filestotal(char *page, char **start, off_t off,
- int count, int *eof, void *data);
-extern int lprocfs_osd_rd_filesfree(char *page, char **start, off_t off,
- int count, int *eof, void *data);
-extern int lprocfs_osd_rd_kbytestotal(char *page, char **start, off_t off,
- int count, int *eof, void *data);
-
extern int lprocfs_write_helper(const char *buffer, unsigned long count,
int *val);
int lprocfs_obd_wr_recovery_time_hard(struct file *file,
const char *buffer,
unsigned long count, void *data);
-int lprocfs_obd_rd_mntdev(char *page, char **start, off_t off,
- int count, int *eof, void *data);
int lprocfs_obd_rd_max_pages_per_rpc(char *page, char **start, off_t off,
int count, int *eof, void *data);
int lprocfs_obd_wr_max_pages_per_rpc(struct file *file, const char *buffer,
};
static struct lprocfs_vars lprocfs_lod_osd_vars[] = {
- { "blocksize", lprocfs_osd_rd_blksize, 0, 0 },
- { "kbytestotal", lprocfs_osd_rd_kbytestotal, 0, 0 },
- { "kbytesfree", lprocfs_osd_rd_kbytesfree, 0, 0 },
- { "kbytesavail", lprocfs_osd_rd_kbytesavail, 0, 0 },
- { "filestotal", lprocfs_osd_rd_filestotal, 0, 0 },
- { "filesfree", lprocfs_osd_rd_filesfree, 0, 0 },
+ { "blocksize", lprocfs_dt_rd_blksize, 0, 0 },
+ { "kbytestotal", lprocfs_dt_rd_kbytestotal, 0, 0 },
+ { "kbytesfree", lprocfs_dt_rd_kbytesfree, 0, 0 },
+ { "kbytesavail", lprocfs_dt_rd_kbytesavail, 0, 0 },
+ { "filestotal", lprocfs_dt_rd_filestotal, 0, 0 },
+ { "filesfree", lprocfs_dt_rd_filesfree, 0, 0 },
{ 0 }
};
return rc;
}
EXPORT_SYMBOL(dt_index_read);
+
+#ifdef LPROCFS
+
+int lprocfs_dt_rd_blksize(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct dt_device *dt = data;
+ struct obd_statfs osfs;
+
+ int rc = dt_statfs(NULL, dt, &osfs);
+ if (rc != 0) {
+ *eof = 1;
+ rc = snprintf(page, count, "%d\n",
+ (unsigned) osfs.os_bsize);
+ }
+
+ return rc;
+}
+EXPORT_SYMBOL(lprocfs_dt_rd_blksize);
+
+int lprocfs_dt_rd_kbytestotal(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct dt_device *dt = data;
+ struct obd_statfs osfs;
+
+ int rc = dt_statfs(NULL, dt, &osfs);
+ if (rc != 0) {
+ __u32 blk_size = osfs.os_bsize >> 10;
+ __u64 result = osfs.os_blocks;
+
+ while (blk_size >>= 1)
+ result <<= 1;
+
+ *eof = 1;
+ rc = snprintf(page, count, LPU64"\n", result);
+ }
+
+ return rc;
+}
+EXPORT_SYMBOL(lprocfs_dt_rd_kbytestotal);
+
+int lprocfs_dt_rd_kbytesfree(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct dt_device *dt = data;
+ struct obd_statfs osfs;
+
+ int rc = dt_statfs(NULL, dt, &osfs);
+ if (rc != 0) {
+ __u32 blk_size = osfs.os_bsize >> 10;
+ __u64 result = osfs.os_bfree;
+
+ while (blk_size >>= 1)
+ result <<= 1;
+
+ *eof = 1;
+ rc = snprintf(page, count, LPU64"\n", result);
+ }
+
+ return rc;
+}
+EXPORT_SYMBOL(lprocfs_dt_rd_kbytesfree);
+
+int lprocfs_dt_rd_kbytesavail(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct dt_device *dt = data;
+ struct obd_statfs osfs;
+
+ int rc = dt_statfs(NULL, dt, &osfs);
+ if (rc != 0) {
+ __u32 blk_size = osfs.os_bsize >> 10;
+ __u64 result = osfs.os_bavail;
+
+ while (blk_size >>= 1)
+ result <<= 1;
+
+ *eof = 1;
+ rc = snprintf(page, count, LPU64"\n", result);
+ }
+
+ return rc;
+}
+EXPORT_SYMBOL(lprocfs_dt_rd_kbytesavail);
+
+int lprocfs_dt_rd_filestotal(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct dt_device *dt = data;
+ struct obd_statfs osfs;
+
+ int rc = dt_statfs(NULL, dt, &osfs);
+ if (rc != 0) {
+ *eof = 1;
+ rc = snprintf(page, count, LPU64"\n", osfs.os_files);
+ }
+
+ return rc;
+}
+EXPORT_SYMBOL(lprocfs_dt_rd_filestotal);
+
+int lprocfs_dt_rd_filesfree(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct dt_device *dt = data;
+ struct obd_statfs osfs;
+
+ int rc = dt_statfs(NULL, dt, &osfs);
+ if (rc != 0) {
+ *eof = 1;
+ rc = snprintf(page, count, LPU64"\n", osfs.os_ffree);
+ }
+
+ return rc;
+}
+EXPORT_SYMBOL(lprocfs_dt_rd_filesfree);
+
+#endif /* LPROCFS */
#include <obd_class.h>
#include <lprocfs_status.h>
-#include <lustre_fsfilt.h>
-#include <lustre_log.h>
-#include <lustre_disk.h>
#include <lustre/lustre_idl.h>
-#include <dt_object.h>
#if defined(LPROCFS)
}
EXPORT_SYMBOL(lprocfs_rd_blksize);
-int lprocfs_osd_rd_blksize(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- struct dt_device *dt = data;
- struct obd_statfs osfs;
- int rc = dt_statfs(NULL, dt, &osfs);
- if (!rc) {
- *eof = 1;
- rc = snprintf(page, count, "%d\n",
- (unsigned) osfs.os_bsize);
- }
- return rc;
-}
-EXPORT_SYMBOL(lprocfs_osd_rd_blksize);
-
int lprocfs_rd_kbytestotal(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
}
EXPORT_SYMBOL(lprocfs_rd_kbytestotal);
-int lprocfs_osd_rd_kbytestotal(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- struct dt_device *dt = data;
- struct obd_statfs osfs;
- int rc = dt_statfs(NULL, dt, &osfs);
- if (!rc) {
- __u32 blk_size = osfs.os_bsize >> 10;
- __u64 result = osfs.os_blocks;
-
- while (blk_size >>= 1)
- result <<= 1;
-
- *eof = 1;
- rc = snprintf(page, count, LPU64"\n", result);
- }
- return rc;
-}
-EXPORT_SYMBOL(lprocfs_osd_rd_kbytestotal);
-
int lprocfs_rd_kbytesfree(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
}
EXPORT_SYMBOL(lprocfs_rd_kbytesfree);
-int lprocfs_osd_rd_kbytesfree(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- struct dt_device *dt = data;
- struct obd_statfs osfs;
- int rc = dt_statfs(NULL, dt, &osfs);
- if (!rc) {
- __u32 blk_size = osfs.os_bsize >> 10;
- __u64 result = osfs.os_bfree;
-
- while (blk_size >>= 1)
- result <<= 1;
-
- *eof = 1;
- rc = snprintf(page, count, LPU64"\n", result);
- }
- return rc;
-}
-EXPORT_SYMBOL(lprocfs_osd_rd_kbytesfree);
-
int lprocfs_rd_kbytesavail(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
}
EXPORT_SYMBOL(lprocfs_rd_kbytesavail);
-int lprocfs_osd_rd_kbytesavail(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- struct dt_device *dt = data;
- struct obd_statfs osfs;
- int rc = dt_statfs(NULL, dt, &osfs);
- if (!rc) {
- __u32 blk_size = osfs.os_bsize >> 10;
- __u64 result = osfs.os_bavail;
-
- while (blk_size >>= 1)
- result <<= 1;
-
- *eof = 1;
- rc = snprintf(page, count, LPU64"\n", result);
- }
- return rc;
-}
-EXPORT_SYMBOL(lprocfs_osd_rd_kbytesavail);
-
int lprocfs_rd_filestotal(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
}
EXPORT_SYMBOL(lprocfs_rd_filestotal);
-int lprocfs_osd_rd_filestotal(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- struct dt_device *dt = data;
- struct obd_statfs osfs;
- int rc = dt_statfs(NULL, dt, &osfs);
- if (!rc) {
- *eof = 1;
- rc = snprintf(page, count, LPU64"\n", osfs.os_files);
- }
-
- return rc;
-}
-EXPORT_SYMBOL(lprocfs_osd_rd_filestotal);
-
int lprocfs_rd_filesfree(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
}
EXPORT_SYMBOL(lprocfs_rd_filesfree);
-int lprocfs_osd_rd_filesfree(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- struct dt_device *dt = data;
- struct obd_statfs osfs;
- int rc = dt_statfs(NULL, dt, &osfs);
- if (!rc) {
- *eof = 1;
- rc = snprintf(page, count, LPU64"\n", osfs.os_ffree);
- }
- return rc;
-}
-EXPORT_SYMBOL(lprocfs_osd_rd_filesfree);
-
int lprocfs_rd_server_uuid(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
}
EXPORT_SYMBOL(lprocfs_obd_wr_recovery_time_hard);
-#ifdef HAVE_SERVER_SUPPORT
-int lprocfs_obd_rd_mntdev(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- struct obd_device *obd = (struct obd_device *)data;
- struct lustre_mount_info *lmi;
- const char *dev_name;
-
- LASSERT(obd != NULL);
- lmi = server_get_mount_2(obd->obd_name);
- dev_name = get_mntdev_name(lmi->lmi_sb);
- LASSERT(dev_name != NULL);
- *eof = 1;
- server_put_mount_2(obd->obd_name, lmi->lmi_mnt);
- return snprintf(page, count, "%s\n", dev_name);
-}
-EXPORT_SYMBOL(lprocfs_obd_rd_mntdev);
-#endif
-
int lprocfs_obd_rd_max_pages_per_rpc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
}
struct lprocfs_vars lprocfs_osd_obd_vars[] = {
- { "blocksize", lprocfs_osd_rd_blksize, 0, 0 },
- { "kbytestotal", lprocfs_osd_rd_kbytestotal, 0, 0 },
- { "kbytesfree", lprocfs_osd_rd_kbytesfree, 0, 0 },
- { "kbytesavail", lprocfs_osd_rd_kbytesavail, 0, 0 },
- { "filestotal", lprocfs_osd_rd_filestotal, 0, 0 },
- { "filesfree", lprocfs_osd_rd_filesfree, 0, 0 },
+ { "blocksize", lprocfs_dt_rd_blksize, 0, 0 },
+ { "kbytestotal", lprocfs_dt_rd_kbytestotal, 0, 0 },
+ { "kbytesfree", lprocfs_dt_rd_kbytesfree, 0, 0 },
+ { "kbytesavail", lprocfs_dt_rd_kbytesavail, 0, 0 },
+ { "filestotal", lprocfs_dt_rd_filestotal, 0, 0 },
+ { "filesfree", lprocfs_dt_rd_filesfree, 0, 0 },
{ "fstype", lprocfs_osd_rd_fstype, 0, 0 },
{ "mntdev", lprocfs_osd_rd_mntdev, 0, 0 },
{ "force_sync", 0, lprocfs_osd_wr_force_sync },
}
struct lprocfs_vars lprocfs_osd_obd_vars[] = {
- { "blocksize", lprocfs_osd_rd_blksize, 0, 0 },
- { "kbytestotal", lprocfs_osd_rd_kbytestotal, 0, 0 },
- { "kbytesfree", lprocfs_osd_rd_kbytesfree, 0, 0 },
- { "kbytesavail", lprocfs_osd_rd_kbytesavail, 0, 0 },
- { "filestotal", lprocfs_osd_rd_filestotal, 0, 0 },
- { "filesfree", lprocfs_osd_rd_filesfree, 0, 0 },
+ { "blocksize", lprocfs_dt_rd_blksize, 0, 0 },
+ { "kbytestotal", lprocfs_dt_rd_kbytestotal, 0, 0 },
+ { "kbytesfree", lprocfs_dt_rd_kbytesfree, 0, 0 },
+ { "kbytesavail", lprocfs_dt_rd_kbytesavail, 0, 0 },
+ { "filestotal", lprocfs_dt_rd_filestotal, 0, 0 },
+ { "filesfree", lprocfs_dt_rd_filesfree, 0, 0 },
{ "fstype", lprocfs_osd_rd_fstype, 0, 0 },
{ "mntdev", lprocfs_osd_rd_mntdev, 0, 0 },
{ "force_sync", 0, lprocfs_osd_wr_force_sync },
};
static struct lprocfs_vars lprocfs_osp_osd_vars[] = {
- { "blocksize", lprocfs_osd_rd_blksize, 0, 0 },
- { "kbytestotal", lprocfs_osd_rd_kbytestotal, 0, 0 },
- { "kbytesfree", lprocfs_osd_rd_kbytesfree, 0, 0 },
- { "kbytesavail", lprocfs_osd_rd_kbytesavail, 0, 0 },
- { "filestotal", lprocfs_osd_rd_filestotal, 0, 0 },
- { "filesfree", lprocfs_osd_rd_filesfree, 0, 0 },
+ { "blocksize", lprocfs_dt_rd_blksize, 0, 0 },
+ { "kbytestotal", lprocfs_dt_rd_kbytestotal, 0, 0 },
+ { "kbytesfree", lprocfs_dt_rd_kbytesfree, 0, 0 },
+ { "kbytesavail", lprocfs_dt_rd_kbytesavail, 0, 0 },
+ { "filestotal", lprocfs_dt_rd_filestotal, 0, 0 },
+ { "filesfree", lprocfs_dt_rd_filesfree, 0, 0 },
{ 0 }
};