X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Finclude%2Flprocfs_status.h;h=319f3b9ddc898df1dcfd62fd5eab15b0d4db98c9;hp=2080592a8bbe5f57ac24bd7c5ca316c493b69dd0;hb=8701e7e4b5ec1b34700c95b9b6588f4745730b72;hpb=3270bfc2370884933628f95122da00d430db6072 diff --git a/lustre/include/lprocfs_status.h b/lustre/include/lprocfs_status.h index 2080592..319f3b9 100644 --- a/lustre/include/lprocfs_status.h +++ b/lustre/include/lprocfs_status.h @@ -302,9 +302,23 @@ static inline int opcode_offset(__u32 opc) { OPC_RANGE(LDLM) + OPC_RANGE(MDS) + OPC_RANGE(OST)); - } else if (opc < UPDATE_LAST_OPC) { + } else if (opc < OUT_UPDATE_LAST_OPC) { /* update opcode */ - return (opc - UPDATE_FIRST_OPC + + return (opc - OUT_UPDATE_FIRST_OPC + + OPC_RANGE(FLD) + + OPC_RANGE(SEC) + + OPC_RANGE(SEQ) + + OPC_RANGE(QUOTA) + + OPC_RANGE(LLOG) + + OPC_RANGE(OBD) + + OPC_RANGE(MGS) + + OPC_RANGE(LDLM) + + OPC_RANGE(MDS) + + OPC_RANGE(OST)); + } else if (opc < LFSCK_LAST_OPC) { + /* LFSCK opcode */ + return (opc - LFSCK_FIRST_OPC + + OPC_RANGE(OUT_UPDATE) + OPC_RANGE(FLD) + OPC_RANGE(SEC) + OPC_RANGE(SEQ) + @@ -316,9 +330,9 @@ static inline int opcode_offset(__u32 opc) { OPC_RANGE(MDS) + OPC_RANGE(OST)); } else { - /* Unknown Opcode */ - return -1; - } + /* Unknown Opcode */ + return -1; + } } @@ -332,7 +346,8 @@ static inline int opcode_offset(__u32 opc) { OPC_RANGE(SEQ) + \ OPC_RANGE(SEC) + \ OPC_RANGE(FLD) + \ - OPC_RANGE(UPDATE)) + OPC_RANGE(OUT_UPDATE) + \ + OPC_RANGE(LFSCK)) #define EXTRA_MAX_OPCODES ((PTLRPC_LAST_CNTR - PTLRPC_FIRST_CNTR) + \ OPC_RANGE(EXTRA)) @@ -396,13 +411,13 @@ static inline void s2dhms(struct dhms *ts, time_t secs) typedef void (*cntr_init_callback)(struct lprocfs_stats *stats); struct obd_job_stats { - cfs_hash_t *ojs_hash; - cfs_list_t ojs_list; - rwlock_t ojs_lock; /* protect the obj_list */ - cntr_init_callback ojs_cntr_init_fn; - int ojs_cntr_num; - int ojs_cleanup_interval; - time_t ojs_last_cleanup; + cfs_hash_t *ojs_hash; + struct list_head ojs_list; + rwlock_t ojs_lock; /* protect the obj_list */ + cntr_init_callback ojs_cntr_init_fn; + int ojs_cntr_num; + int ojs_cleanup_interval; + time_t ojs_last_cleanup; }; #ifdef LPROCFS @@ -589,26 +604,34 @@ extern int lprocfs_add_clear_entry(struct obd_device * obd, #ifdef HAVE_SERVER_SUPPORT extern int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *peer_nid, int *newnid); -#endif extern int lprocfs_exp_cleanup(struct obd_export *exp); -extern cfs_proc_dir_entry_t *lprocfs_add_simple(struct proc_dir_entry *root, - char *name, +#else +static inline int lprocfs_exp_cleanup(struct obd_export *exp) +{ return 0; } +#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, + read_proc_t *read_proc, write_proc_t *write_proc, #endif - void *data, - struct file_operations *fops); + void *data, const struct file_operations *fops); extern struct proc_dir_entry * lprocfs_add_symlink(const char *name, struct proc_dir_entry *parent, const char *format, ...); extern void lprocfs_free_per_client_stats(struct obd_device *obd); +#ifdef HAVE_SERVER_SUPPORT +#ifndef HAVE_ONLY_PROCFS_SEQ extern int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer, unsigned long count, void *data); extern int lprocfs_nid_stats_clear_read(char *page, char **start, off_t off, int count, int *eof, void *data); - +#endif +extern ssize_t +lprocfs_nid_stats_clear_seq_write(struct file *file, const char *buffer, + size_t count, loff_t *off); +extern int lprocfs_nid_stats_clear_seq_show(struct seq_file *file, void *data); +#endif extern int lprocfs_register_stats(cfs_proc_dir_entry_t *root, const char *name, struct lprocfs_stats *stats); @@ -644,9 +667,9 @@ extern int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list); extern int lprocfs_seq_obd_setup(struct obd_device *dev); extern int lprocfs_obd_cleanup(struct obd_device *obd); #ifdef HAVE_SERVER_SUPPORT -extern struct file_operations lprocfs_evict_client_fops; +extern const struct file_operations lprocfs_evict_client_fops; #endif -extern int lprocfs_seq_create(cfs_proc_dir_entry_t *parent, const char *name, +extern int lprocfs_seq_create(struct proc_dir_entry *parent, const char *name, mode_t mode, const struct file_operations *seq_fops, void *data); @@ -700,6 +723,9 @@ extern int lprocfs_conn_uuid_seq_show(struct seq_file *m, void *data); extern int lprocfs_import_seq_show(struct seq_file *m, void *data); extern int lprocfs_state_seq_show(struct seq_file *m, void *data); extern int lprocfs_connect_flags_seq_show(struct seq_file *m, void *data); +#ifdef HAVE_SERVER_SUPPORT +extern int lprocfs_num_exports_seq_show(struct seq_file *m, void *data); +#endif struct adaptive_timeout; #ifndef HAVE_ONLY_PROCFS_SEQ extern int lprocfs_at_hist_helper(char *page, int count, int rc, @@ -715,9 +741,15 @@ extern int lprocfs_timeouts_seq_show(struct seq_file *m, void *data); extern ssize_t lprocfs_timeouts_seq_write(struct file *file, const char *buffer, size_t count, loff_t *off); +#ifndef HAVE_ONLY_PROCFS_SEQ +#ifdef HAVE_SERVER_SUPPORT +extern ssize_t lprocfs_fops_read(struct file *f, char __user *buf, + size_t size, loff_t *ppos); +extern ssize_t lprocfs_fops_write(struct file *f, const char __user *buf, + size_t size, loff_t *ppos); extern int lprocfs_wr_evict_client(struct file *file, const char *buffer, unsigned long count, void *data); -#ifndef HAVE_ONLY_PROCFS_SEQ +#endif extern int lprocfs_wr_ping(struct file *file, const char *buffer, unsigned long count, void *data); extern int lprocfs_wr_import(struct file *file, const char *buffer, @@ -727,6 +759,11 @@ extern int lprocfs_rd_pinger_recov(char *page, char **start, off_t off, extern int lprocfs_wr_pinger_recov(struct file *file, const char *buffer, unsigned long count, void *data); #endif +#ifdef HAVE_SERVER_SUPPORT +extern ssize_t +lprocfs_evict_client_seq_write(struct file *file, const char *buffer, + size_t count, loff_t *off); +#endif extern ssize_t lprocfs_ping_seq_write(struct file *file, const char *buffer, size_t count, loff_t *off); @@ -785,10 +822,10 @@ void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx, struct lprocfs_counter *cnt); #ifdef HAVE_SERVER_SUPPORT +#ifndef HAVE_ONLY_PROCFS_SEQ /* lprocfs_status.c: recovery status */ int lprocfs_obd_rd_recovery_status(char *page, char **start, off_t off, int count, int *eof, void *data); -#endif /* lprocfs_statuc.c: hash statistics */ int lprocfs_obd_rd_hash(char *page, char **start, off_t off, int count, int *eof, void *data); @@ -798,7 +835,19 @@ int lprocfs_obd_rd_ir_factor(char *page, char **start, off_t off, int count, int *eof, void *data); int lprocfs_obd_wr_ir_factor(struct file *file, const char *buffer, unsigned long count, void *data); +#endif +/* lprocfs_status.c: recovery status */ +int lprocfs_recovery_status_seq_show(struct seq_file *m, void *data); + +/* lprocfs_status.c: hash statistics */ +int lprocfs_hash_seq_show(struct seq_file *m, void *data); +/* lprocfs_status.c: IR factor */ +int lprocfs_ir_factor_seq_show(struct seq_file *m, void *data); +ssize_t +lprocfs_ir_factor_seq_write(struct file *file, const char *buffer, + size_t count, loff_t *off); +#endif extern int lprocfs_single_release(cfs_inode_t *, struct file *); extern int lprocfs_seq_release(cfs_inode_t *, struct file *); @@ -874,21 +923,23 @@ struct file_operations name##_fops = { \ .release = lprocfs_single_release, \ }; +/* lproc_ptlrpc.c */ +struct ptlrpc_request; +extern void target_print_req(void *seq_file, struct ptlrpc_request *req); + +#ifdef HAVE_SERVER_SUPPORT /* lprocfs_jobstats.c */ int lprocfs_job_stats_log(struct obd_device *obd, char *jobid, int event, long amount); void lprocfs_job_stats_fini(struct obd_device *obd); int lprocfs_job_stats_init(struct obd_device *obd, int cntr_num, cntr_init_callback fn); +#ifndef HAVE_ONLY_PROCFS_SEQ int lprocfs_rd_job_interval(char *page, char **start, off_t off, int count, int *eof, void *data); int lprocfs_wr_job_interval(struct file *file, const char *buffer, unsigned long count, void *data); -/* lproc_ptlrpc.c */ -struct ptlrpc_request; -extern void target_print_req(void *seq_file, struct ptlrpc_request *req); - /* lproc_status.c */ int lprocfs_obd_rd_recovery_time_soft(char *page, char **start, off_t off, int count, int *eof, void *data); @@ -900,6 +951,24 @@ 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_target_rd_instance(char *page, char **start, off_t off, + int count, int *eof, void *data); +#endif +int lprocfs_job_interval_seq_show(struct seq_file *m, void *data); +ssize_t +lprocfs_job_interval_seq_write(struct file *file, const char *buffer, + size_t count, loff_t *off); +/* lproc_status.c */ +int lprocfs_recovery_time_soft_seq_show(struct seq_file *m, void *data); +ssize_t lprocfs_recovery_time_soft_seq_write(struct file *file, + const char *buffer, + size_t count, loff_t *off); +int lprocfs_recovery_time_hard_seq_show(struct seq_file *m, void *data); +ssize_t +lprocfs_recovery_time_hard_seq_write(struct file *file, const char *buffer, + size_t count, loff_t *off); +int lprocfs_target_instance_seq_show(struct seq_file *m, void *data); +#endif #ifndef HAVE_ONLY_PROCFS_SEQ int lprocfs_obd_rd_max_pages_per_rpc(char *page, char **start, off_t off, int count, int *eof, void *data); @@ -910,8 +979,12 @@ int lprocfs_obd_max_pages_per_rpc_seq_show(struct seq_file *m, void *data); ssize_t lprocfs_obd_max_pages_per_rpc_seq_write(struct file *file, const char *buffer, size_t count, loff_t *off); -int lprocfs_target_rd_instance(char *page, char **start, off_t off, - int count, int *eof, void *data); + +struct root_squash_info; +int lprocfs_wr_root_squash(const char *buffer, unsigned long count, + struct root_squash_info *squash, char *name); +int lprocfs_wr_nosquash_nids(const char *buffer, unsigned long count, + struct root_squash_info *squash, char *name); /* all quota proc functions */ extern int lprocfs_quota_rd_bunit(char *page, char **start, @@ -1032,35 +1105,43 @@ static inline void lprocfs_free_md_stats(struct obd_device *obddev) struct obd_export; static inline int lprocfs_add_clear_entry(struct obd_export *exp) { return 0; } +static inline void lprocfs_free_per_client_stats(struct obd_device *obd) +{ return; } #ifdef HAVE_SERVER_SUPPORT +#ifndef HAVE_ONLY_PROCFS_SEQ +static inline +int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer, + unsigned long count, void *data) +{return count;} +static inline +int lprocfs_nid_stats_clear_read(char *page, char **start, off_t off, + int count, int *eof, void *data) +{return count;} +#endif +static inline +ssize_t lprocfs_nid_stats_seq_write(struct file *file, const char *buffer, + size_t count, loff_t *off) +{return 0;} +static inline +int lprocfs_nid_stats_clear_seq_show(struct seq_file *m, void *data) +{return 0;} static inline int lprocfs_exp_setup(struct obd_export *exp,lnet_nid_t *peer_nid, int *newnid) { return 0; } #endif static inline int lprocfs_exp_cleanup(struct obd_export *exp) { return 0; } -static inline cfs_proc_dir_entry_t * +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, struct file_operations *fops) + void *data, const struct file_operations *fops) {return 0; } static inline struct proc_dir_entry * lprocfs_add_symlink(const char *name, struct proc_dir_entry *parent, const char *format, ...) {return NULL; } -static inline void lprocfs_free_per_client_stats(struct obd_device *obd) -{ return; } -static inline -int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer, - unsigned long count, void *data) -{return count;} -static inline -int lprocfs_nid_stats_clear_read(char *page, char **start, off_t off, - int count, int *eof, void *data) -{return count;} - #ifndef HAVE_ONLY_PROCFS_SEQ static inline cfs_proc_dir_entry_t * lprocfs_register(const char *name, cfs_proc_dir_entry_t *parent, @@ -1075,12 +1156,10 @@ static inline int lprocfs_seq_add_vars(cfs_proc_dir_entry_t *root, struct lprocfs_seq_vars *var, void *data) { return 0; } -#ifndef HAVE_ONLY_PROCFS_SEQ static inline cfs_proc_dir_entry_t * lprocfs_seq_register(const char *name, cfs_proc_dir_entry_t *parent, - struct lprocfs_vars *list, void *data) + struct lprocfs_seq_vars *list, void *data) { return NULL; } -#endif static inline void lprocfs_remove(cfs_proc_dir_entry_t **root) { return; } static inline void lprocfs_remove_proc_entry(const char *name, @@ -1145,10 +1224,12 @@ static inline int lprocfs_wr_timeouts(struct file *file, const char *buffer, unsigned long count, void *data) { return 0; } +#ifdef HAVE_SERVER_SUPPORT static inline int lprocfs_wr_evict_client(struct file *file, const char *buffer, unsigned long count, void *data) { return 0; } +#endif static inline int lprocfs_wr_ping(struct file *file, const char *buffer, unsigned long count, void *data) { return 0; } @@ -1173,8 +1254,10 @@ static inline int lprocfs_state_seq_show(struct seq_file *m, void *data) { return 0; } static inline int lprocfs_connect_flags_seq_show(struct seq_file *m, void *data) { return 0; } +#ifdef HAVE_SERVER_SUPPORT static inline int lprocfs_num_exports_seq_show(struct seq_file *m, void *data) { return 0; } +#endif struct adaptive_timeout; static inline int lprocfs_seq_at_hist_helper(struct seq_file *m, struct adaptive_timeout *at) @@ -1185,10 +1268,12 @@ static inline ssize_t lprocfs_timeouts_seq_write(struct file *file, const char *buffer, size_t count, loff_t *off) { return 0; } +#ifdef HAVE_SERVER_SUPPORT static inline ssize_t lprocfs_evict_client_seq_write(struct file *file, const char *buffer, size_t count, loff_t *off) { return 0; } +#endif static inline ssize_t lprocfs_ping_seq_write(struct file *file, const char *buffer, size_t count, loff_t *off)