Whamcloud - gitweb
LU-1330 proc: remove osd proc handlers from lprocfs_status.c
authorJohn L. Hammond <john.hammond@intel.com>
Thu, 14 Mar 2013 18:35:36 +0000 (13:35 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 1 May 2013 06:22:39 +0000 (02:22 -0400)
Move lprocfs_osd_rd_{blksize,{files,kbytes}{free,avail} to dt_object.c
and rename them to lprocfs_dt_rd_blksize....  Remove the unused
function lprocfs_obd_rd_mntdev().  Do not include
lustre_{fsfilt,log,disk}.h or dt_object.h in lprocfs_status.c.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Ic54973f8bc6ec1d440fa76aadf0dd13629ce345c
Reviewed-on: http://review.whamcloud.com/5721
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/include/dt_object.h
lustre/include/lprocfs_status.h
lustre/lod/lproc_lod.c
lustre/obdclass/dt_object.c
lustre/obdclass/lprocfs_status.c
lustre/osd-ldiskfs/osd_lproc.c
lustre/osd-zfs/osd_lproc.c
lustre/osp/lproc_osp.c

index 1b8f71b..db982f4 100644 (file)
@@ -1480,4 +1480,19 @@ static inline struct dt_thread_info *dt_info(const struct lu_env *env)
 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 */
index 390a13c..349a62c 100644 (file)
@@ -690,19 +690,6 @@ extern int lprocfs_rd_filesfree(char *page, char **start, off_t off,
                                 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);
@@ -810,8 +797,6 @@ int lprocfs_obd_rd_recovery_time_hard(char *page, char **start, off_t off,
 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,
index d900baa..e168a43 100644 (file)
@@ -446,12 +446,12 @@ static struct lprocfs_vars lprocfs_lod_obd_vars[] = {
 };
 
 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 }
 };
 
index 6389e03..13962cd 100644 (file)
@@ -934,3 +934,122 @@ out:
        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 */
index a966ed3..a95a731 100644 (file)
 
 #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)
 
@@ -611,21 +607,6 @@ int lprocfs_rd_blksize(char *page, char **start, off_t off, int count,
 }
 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)
 {
@@ -648,26 +629,6 @@ int lprocfs_rd_kbytestotal(char *page, char **start, off_t off, int count,
 }
 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)
 {
@@ -690,26 +651,6 @@ int lprocfs_rd_kbytesfree(char *page, char **start, off_t off, int count,
 }
 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)
 {
@@ -732,26 +673,6 @@ int lprocfs_rd_kbytesavail(char *page, char **start, off_t off, int count,
 }
 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)
 {
@@ -769,21 +690,6 @@ int lprocfs_rd_filestotal(char *page, char **start, off_t off, int count,
 }
 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)
 {
@@ -800,20 +706,6 @@ int lprocfs_rd_filesfree(char *page, char **start, off_t off, int count,
 }
 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)
 {
@@ -2681,25 +2573,6 @@ int lprocfs_obd_wr_recovery_time_hard(struct file *file, const char *buffer,
 }
 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)
 {
index 773b3e7..e459411 100644 (file)
@@ -515,12 +515,12 @@ int lprocfs_osd_wr_readcache(struct file *file, const char *buffer,
 }
 
 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     },
index 7befd14..f85accf 100644 (file)
@@ -168,12 +168,12 @@ static int lprocfs_osd_wr_iused_est(struct file *file, const char *buffer,
 }
 
 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     },
index b84b453..422ab57 100644 (file)
@@ -462,12 +462,12 @@ static struct lprocfs_vars lprocfs_osp_obd_vars[] = {
 };
 
 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 }
 };