Whamcloud - gitweb
LU-5275 obdclass: remove lproc_var argument to lprocfs_add_simple 32/11732/2
authorJames Simmons <uja.ornl@gmail.com>
Tue, 2 Sep 2014 15:44:38 +0000 (11:44 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 6 Sep 2014 02:49:51 +0000 (02:49 +0000)
The struct lproc_var argument is no longer used so we can
simplify the lprocfs_add_simple function.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I2099e92c9e93c67843a41fb8e46a481a75fbd004
Reviewed-on: http://review.whamcloud.com/11732
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/lprocfs_status.h
lustre/lod/lod_pool.c
lustre/lov/lov_pool.c
lustre/mdt/mdt_lproc.c
lustre/obdclass/lprocfs_status.c
lustre/obdclass/lprocfs_status_server.c
lustre/ofd/ofd_dev.c

index 1786c45..bec768d 100644 (file)
@@ -599,9 +599,6 @@ static inline int lprocfs_exp_cleanup(struct obd_export *exp)
 #endif
 extern struct proc_dir_entry *
 lprocfs_add_simple(struct proc_dir_entry *root, char *name,
 #endif
 extern struct proc_dir_entry *
 lprocfs_add_simple(struct proc_dir_entry *root, char *name,
-#ifndef HAVE_ONLY_PROCFS_SEQ
-                  read_proc_t *read_proc, write_proc_t *write_proc,
-#endif
                   void *data, const struct file_operations *fops);
 extern struct proc_dir_entry *
 lprocfs_add_symlink(const char *name, struct proc_dir_entry *parent,
                   void *data, const struct file_operations *fops);
 extern struct proc_dir_entry *
 lprocfs_add_symlink(const char *name, struct proc_dir_entry *parent,
@@ -999,9 +996,6 @@ static inline int lprocfs_exp_cleanup(struct obd_export *exp)
 { return 0; }
 static inline struct proc_dir_entry *
 lprocfs_add_simple(struct proc_dir_entry *root, char *name,
 { return 0; }
 static inline struct proc_dir_entry *
 lprocfs_add_simple(struct proc_dir_entry *root, char *name,
-#ifndef HAVE_ONLY_PROCFS_SEQ
-                  read_proc_t *read_proc, write_proc_t *write_proc,
-#endif
                   void *data, const struct file_operations *fops)
 {return 0; }
 static inline struct proc_dir_entry *
                   void *data, const struct file_operations *fops)
 {return 0; }
 static inline struct proc_dir_entry *
index c54f1c8..c9a008f 100644 (file)
@@ -670,11 +670,7 @@ int lod_pool_new(struct obd_device *obd, char *poolname)
 #ifdef LPROCFS
        pool_getref(new_pool);
        new_pool->pool_proc_entry = lprocfs_add_simple(lod->lod_pool_proc_entry,
 #ifdef LPROCFS
        pool_getref(new_pool);
        new_pool->pool_proc_entry = lprocfs_add_simple(lod->lod_pool_proc_entry,
-                                                      poolname,
-#ifndef HAVE_ONLY_PROCFS_SEQ
-                                                      NULL, NULL,
-#endif
-                                                      new_pool,
+                                                      poolname, new_pool,
                                                       &pool_proc_operations);
        if (IS_ERR(new_pool->pool_proc_entry)) {
                CDEBUG(D_CONFIG, "%s: cannot add proc entry "LOV_POOLNAMEF"\n",
                                                       &pool_proc_operations);
        if (IS_ERR(new_pool->pool_proc_entry)) {
                CDEBUG(D_CONFIG, "%s: cannot add proc entry "LOV_POOLNAMEF"\n",
index a3c3283..37be01e 100644 (file)
@@ -462,11 +462,7 @@ int lov_pool_new(struct obd_device *obd, char *poolname)
         /* get ref for /proc file */
         lov_pool_getref(new_pool);
         new_pool->pool_proc_entry = lprocfs_add_simple(lov->lov_pool_proc_entry,
         /* get ref for /proc file */
         lov_pool_getref(new_pool);
         new_pool->pool_proc_entry = lprocfs_add_simple(lov->lov_pool_proc_entry,
-                                                       poolname,
-#ifndef HAVE_ONLY_PROCFS_SEQ
-                                                       NULL, NULL,
-#endif
-                                                       new_pool,
+                                                       poolname, new_pool,
                                                        &pool_proc_operations);
         if (IS_ERR(new_pool->pool_proc_entry)) {
                 CWARN("Cannot add proc pool entry "LOV_POOLNAMEF"\n", poolname);
                                                        &pool_proc_operations);
         if (IS_ERR(new_pool->pool_proc_entry)) {
                 CWARN("Cannot add proc pool entry "LOV_POOLNAMEF"\n", poolname);
index 535e70b..7a5936c 100644 (file)
@@ -993,9 +993,6 @@ int mdt_procfs_init(struct mdt_device *mdt, const char *name)
                                                 obd->obd_proc_entry);
        if (obd->obd_proc_exports_entry)
                lprocfs_add_simple(obd->obd_proc_exports_entry, "clear",
                                                 obd->obd_proc_entry);
        if (obd->obd_proc_exports_entry)
                lprocfs_add_simple(obd->obd_proc_exports_entry, "clear",
-#ifndef HAVE_ONLY_PROCFS_SEQ
-                                  NULL, NULL,
-#endif
                                   obd, &mdt_nid_stats_clear_fops);
        rc = lprocfs_alloc_md_stats(obd, LPROC_MDT_LAST);
        if (rc)
                                   obd, &mdt_nid_stats_clear_fops);
        rc = lprocfs_alloc_md_stats(obd, LPROC_MDT_LAST);
        if (rc)
index 10f8052..a4b8013 100644 (file)
@@ -67,50 +67,23 @@ EXPORT_SYMBOL(lprocfs_seq_release);
 
 struct proc_dir_entry *
 lprocfs_add_simple(struct proc_dir_entry *root, char *name,
 
 struct proc_dir_entry *
 lprocfs_add_simple(struct proc_dir_entry *root, char *name,
-#ifndef HAVE_ONLY_PROCFS_SEQ
-                  read_proc_t *read_proc, write_proc_t *write_proc,
-#endif
                   void *data, const struct file_operations *fops)
 {
        struct proc_dir_entry *proc;
        mode_t mode = 0;
 
                   void *data, const struct file_operations *fops)
 {
        struct proc_dir_entry *proc;
        mode_t mode = 0;
 
-        if (root == NULL || name == NULL)
+       if (root == NULL || name == NULL || fops == NULL)
                 return ERR_PTR(-EINVAL);
 
                 return ERR_PTR(-EINVAL);
 
-       if (!fops) {
-#ifndef HAVE_ONLY_PROCFS_SEQ
-               if (read_proc)
-                       mode = 0444;
-               if (write_proc)
-                       mode |= 0200;
-
-               LPROCFS_WRITE_ENTRY();
-               proc = create_proc_entry(name, mode, root);
-               if (!proc) {
-                       CERROR("LprocFS: No memory to create /proc entry %s\n",
-                              name);
-                       LPROCFS_WRITE_EXIT();
-                       return ERR_PTR(-ENOMEM);
-               }
-               proc->read_proc = read_proc;
-               proc->write_proc = write_proc;
-               proc->data = data;
-               LPROCFS_WRITE_EXIT();
-#else
-               return ERR_PTR(-EINVAL);
-#endif
-       } else {
-               if (fops->read)
-                       mode = 0444;
-               if (fops->write)
-                       mode |= 0200;
-               proc = proc_create_data(name, mode, root, fops, data);
-               if (!proc) {
-                       CERROR("LprocFS: No memory to create /proc entry %s\n",
-                              name);
-                       return ERR_PTR(-ENOMEM);
-               }
+       if (fops->read)
+               mode = 0444;
+       if (fops->write)
+               mode |= 0200;
+       proc = proc_create_data(name, mode, root, fops, data);
+       if (!proc) {
+               CERROR("LprocFS: No memory to create /proc entry %s\n",
+                      name);
+               return ERR_PTR(-ENOMEM);
        }
         return proc;
 }
        }
         return proc;
 }
index 3acf811..c603bff 100644 (file)
@@ -342,22 +342,16 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid)
                GOTO(destroy_new_ns, rc);
        }
 
                GOTO(destroy_new_ns, rc);
        }
 
-       entry = lprocfs_add_simple(new_stat->nid_proc, "uuid",
-#ifndef HAVE_ONLY_PROCFS_SEQ
-                                  NULL, NULL,
-#endif
-                                  new_stat, &lprocfs_exp_uuid_fops);
+       entry = lprocfs_add_simple(new_stat->nid_proc, "uuid", new_stat,
+                                  &lprocfs_exp_uuid_fops);
        if (IS_ERR(entry)) {
                CWARN("Error adding the NID stats file\n");
                rc = PTR_ERR(entry);
                GOTO(destroy_new_ns, rc);
        }
 
        if (IS_ERR(entry)) {
                CWARN("Error adding the NID stats file\n");
                rc = PTR_ERR(entry);
                GOTO(destroy_new_ns, rc);
        }
 
-       entry = lprocfs_add_simple(new_stat->nid_proc, "hash",
-#ifndef HAVE_ONLY_PROCFS_SEQ
-                                  NULL, NULL,
-#endif
-                                  new_stat, &lprocfs_exp_hash_fops);
+       entry = lprocfs_add_simple(new_stat->nid_proc, "hash", new_stat,
+                                  &lprocfs_exp_hash_fops);
        if (IS_ERR(entry)) {
                CWARN("Error adding the hash file\n");
                rc = PTR_ERR(entry);
        if (IS_ERR(entry)) {
                CWARN("Error adding the hash file\n");
                rc = PTR_ERR(entry);
index 51ffc75..bcc442c 100644 (file)
@@ -552,9 +552,6 @@ static int ofd_procfs_init(struct ofd_device *ofd)
        obd->obd_proc_exports_entry = entry;
 
        entry = lprocfs_add_simple(obd->obd_proc_exports_entry, "clear",
        obd->obd_proc_exports_entry = entry;
 
        entry = lprocfs_add_simple(obd->obd_proc_exports_entry, "clear",
-#ifndef HAVE_ONLY_PROCFS_SEQ
-                                  NULL, NULL,
-#endif
                                   obd, &lprocfs_nid_stats_clear_fops);
        if (IS_ERR(entry)) {
                rc = PTR_ERR(entry);
                                   obd, &lprocfs_nid_stats_clear_fops);
        if (IS_ERR(entry)) {
                rc = PTR_ERR(entry);