From: James Simmons Date: Tue, 2 Sep 2014 15:44:38 +0000 (-0400) Subject: LU-5275 obdclass: remove lproc_var argument to lprocfs_add_simple X-Git-Tag: 2.6.53~83 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=3b5fc14da24a5c78346c2f42ea61b51c1d8c6191 LU-5275 obdclass: remove lproc_var argument to lprocfs_add_simple The struct lproc_var argument is no longer used so we can simplify the lprocfs_add_simple function. Signed-off-by: James Simmons Change-Id: I2099e92c9e93c67843a41fb8e46a481a75fbd004 Reviewed-on: http://review.whamcloud.com/11732 Tested-by: Jenkins Reviewed-by: Bob Glossman Tested-by: Maloo Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/lprocfs_status.h b/lustre/include/lprocfs_status.h index 1786c45..bec768d 100644 --- a/lustre/include/lprocfs_status.h +++ b/lustre/include/lprocfs_status.h @@ -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, -#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, @@ -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, -#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 * diff --git a/lustre/lod/lod_pool.c b/lustre/lod/lod_pool.c index c54f1c8..c9a008f 100644 --- a/lustre/lod/lod_pool.c +++ b/lustre/lod/lod_pool.c @@ -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, - 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", diff --git a/lustre/lov/lov_pool.c b/lustre/lov/lov_pool.c index a3c3283..37be01e 100644 --- a/lustre/lov/lov_pool.c +++ b/lustre/lov/lov_pool.c @@ -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, - 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); diff --git a/lustre/mdt/mdt_lproc.c b/lustre/mdt/mdt_lproc.c index 535e70b..7a5936c 100644 --- a/lustre/mdt/mdt_lproc.c +++ b/lustre/mdt/mdt_lproc.c @@ -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", -#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) diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 10f8052..a4b8013 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -67,50 +67,23 @@ EXPORT_SYMBOL(lprocfs_seq_release); 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; - if (root == NULL || name == NULL) + if (root == NULL || name == NULL || fops == NULL) 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; } diff --git a/lustre/obdclass/lprocfs_status_server.c b/lustre/obdclass/lprocfs_status_server.c index 3acf811..c603bff 100644 --- a/lustre/obdclass/lprocfs_status_server.c +++ b/lustre/obdclass/lprocfs_status_server.c @@ -342,22 +342,16 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid) 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); } - 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); diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c index 51ffc75..bcc442c 100644 --- a/lustre/ofd/ofd_dev.c +++ b/lustre/ofd/ofd_dev.c @@ -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", -#ifndef HAVE_ONLY_PROCFS_SEQ - NULL, NULL, -#endif obd, &lprocfs_nid_stats_clear_fops); if (IS_ERR(entry)) { rc = PTR_ERR(entry);