diff options
author | Peng Tao <bergwolf@gmail.com> | 2013-05-29 21:40:55 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-30 20:49:44 +0900 |
commit | 73bb1da692d0dc3e93b9c9e29084d6a5dcbc37a6 (patch) | |
tree | 51de17fe49f97c340727a975e4041e42870b5168 /drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | |
parent | 2ac428fe8ab9a88c1f5606dfafe5cb25e4183c7b (diff) | |
download | op-kernel-dev-73bb1da692d0dc3e93b9c9e29084d6a5dcbc37a6.zip op-kernel-dev-73bb1da692d0dc3e93b9c9e29084d6a5dcbc37a6.tar.gz |
staging/lustre: adapt proc_dir_entry change
In 3.10 merge window, proc_dir_entry is now private to proc. However,
Lustre lprocfs depends heavily on it and its now-gone read_proc_t and
write_proc_t members.
The patch largely changed the fact, and made lprocfs depend on none of
proc_dir_entry private members. All lprocfs callers are converted to
use the new seq_file scheme.
Also lprocfs_srch is removed so that we can drop lprocfs_lock. All callers
are changed to save created pde in proper place.
See https://jira.hpdd.intel.com/browse/LU-3319 for more details.
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/ldlm/ldlm_internal.h')
-rw-r--r-- | drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h index a08e6d9..141a957 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h @@ -199,41 +199,40 @@ enum ldlm_policy_res { typedef enum ldlm_policy_res ldlm_policy_res_t; -#define LDLM_POOL_PROC_READER(var, type) \ - static int lprocfs_rd_##var(char *page, char **start, off_t off, \ - int count, int *eof, void *data) \ - { \ - struct ldlm_pool *pl = data; \ - type tmp; \ +#define LDLM_POOL_PROC_READER_SEQ_SHOW(var, type) \ + static int lprocfs_##var##_seq_show(struct seq_file *m, void *v) \ + { \ + struct ldlm_pool *pl = m->private; \ + type tmp; \ \ spin_lock(&pl->pl_lock); \ tmp = pl->pl_##var; \ spin_unlock(&pl->pl_lock); \ \ - return lprocfs_rd_uint(page, start, off, count, eof, &tmp); \ - } \ + return lprocfs_rd_uint(m, &tmp); \ + } \ struct __##var##__dummy_read {;} /* semicolon catcher */ #define LDLM_POOL_PROC_WRITER(var, type) \ - int lprocfs_wr_##var(struct file *file, const char *buffer, \ - unsigned long count, void *data) \ - { \ - struct ldlm_pool *pl = data; \ - type tmp; \ - int rc; \ + int lprocfs_wr_##var(struct file *file, const char *buffer, \ + unsigned long count, void *data) \ + { \ + struct ldlm_pool *pl = data; \ + type tmp; \ + int rc; \ \ rc = lprocfs_wr_uint(file, buffer, count, &tmp); \ - if (rc < 0) { \ + if (rc < 0) { \ CERROR("Can't parse user input, rc = %d\n", rc); \ - return rc; \ - } \ + return rc; \ + } \ \ spin_lock(&pl->pl_lock); \ pl->pl_##var = tmp; \ spin_unlock(&pl->pl_lock); \ \ - return rc; \ - } \ + return rc; \ + } \ struct __##var##__dummy_write {;} /* semicolon catcher */ static inline int is_granted_or_cancelled(struct ldlm_lock *lock) |