From 05ea8d2b4ce1b6794bc12d78bae9cfe1608cb4d3 Mon Sep 17 00:00:00 2001 From: thantry Date: Sat, 2 Nov 2002 02:41:32 +0000 Subject: [PATCH] 1. Fixed cleanup issue where I was *indeed* accesing a zapped pointer. 2. Removed typedef 3. lproc-snmp back in. --- lustre/include/linux/lprocfs.h | 10 ++------- lustre/include/linux/lprocfs_status.h | 39 ++++++++++++++++++++++------------- lustre/include/linux/obd_class.h | 3 ++- lustre/llite/lproc_llite.c | 13 ++++++------ lustre/llite/super.c | 28 +++++++++++++++---------- lustre/lov/lov_obd.c | 9 ++++---- lustre/lov/lproc_lov.c | 4 ++-- lustre/mdc/lproc_mdc.c | 4 ++-- lustre/mdc/mdc_request.c | 9 ++++---- lustre/mds/handler.c | 10 +++++---- lustre/mds/lproc_mds.c | 4 ++-- lustre/obdclass/genops.c | 2 +- lustre/obdclass/lprocfs_status.c | 29 +++++++++----------------- lustre/obdecho/echo.c | 13 ++++++------ lustre/obdecho/lproc_echo.c | 4 ++-- lustre/obdfilter/filter.c | 9 ++++---- lustre/obdfilter/lproc_obdfilter.c | 4 ++-- lustre/osc/lproc_osc.c | 4 ++-- lustre/osc/osc_request.c | 9 ++++---- lustre/ost/lproc_ost.c | 4 ++-- lustre/ost/ost_handler.c | 9 ++++---- lustre/ptlrpc/lproc_ptlrpc.c | 4 ++-- lustre/ptlrpc/rpc.c | 9 ++++---- 23 files changed, 122 insertions(+), 111 deletions(-) diff --git a/lustre/include/linux/lprocfs.h b/lustre/include/linux/lprocfs.h index 34a9b15..2fdfe6a 100644 --- a/lustre/include/linux/lprocfs.h +++ b/lustre/include/linux/lprocfs.h @@ -35,15 +35,9 @@ typedef enum lprofilers { e_specific } lprofilers_e; -typedef struct lprocfs_vars{ - char* name; - read_proc_t* read_fptr; - write_proc_t* write_fptr; -} lprocfs_vars_t; - typedef struct lprocfs_group { char** dir_namespace; - lprocfs_vars_t* count_func_namespace; + struct lprocfs_vars* count_func_namespace; lprofilers_e prof_type; } lprocfs_group_t; @@ -575,7 +569,7 @@ struct proc_dir_entry* lprocfs_mkinitdir(struct obd_device* device); int lprocfs_get_idx(struct namespace_index* class, const char* dir_name); unsigned int lprocfs_add_var(struct obd_device* device, struct proc_dir_entry* root, - lprocfs_vars_t* variable, + struct lprocfs_vars* variable, int dir_arr_index, int cnt_arr_index, unsigned int cnt_arr_size, diff --git a/lustre/include/linux/lprocfs_status.h b/lustre/include/linux/lprocfs_status.h index 64c7b92..a194947 100644 --- a/lustre/include/linux/lprocfs_status.h +++ b/lustre/include/linux/lprocfs_status.h @@ -23,20 +23,20 @@ #ifndef _LPROCFS_SNMP_H #define _LPROCFS_SNMP_H -/* + #ifndef LPROC_SNMP #define LPROC_SNMP #endif -*/ + #include -typedef struct lprocfs_vars{ +struct lprocfs_vars{ char* name; read_proc_t* read_fptr; write_proc_t* write_fptr; -} lprocfs_vars_t; +}; #ifdef LPROC_SNMP @@ -46,17 +46,23 @@ struct proc_dir_entry* lprocfs_srch(struct proc_dir_entry* head, const char* name); void lprocfs_remove_all(struct proc_dir_entry* root); struct proc_dir_entry* lprocfs_new_dir(struct proc_dir_entry* root, - const char* string, const char* tok); -int lprocfs_new_vars(struct proc_dir_entry* root, lprocfs_vars_t* list, - const char* tok, void* data); -int lprocfs_add_vars(struct proc_dir_entry* root, lprocfs_vars_t* var, + const char* string, + const char* tok); +int lprocfs_new_vars(struct proc_dir_entry* root, + struct lprocfs_vars* list, const char* tok, void* data); + +int lprocfs_add_vars(struct proc_dir_entry* root, + struct lprocfs_vars* var, void* data); -int lprocfs_reg_obd(struct obd_device* device, lprocfs_vars_t* list, +int lprocfs_reg_obd(struct obd_device* device, + struct lprocfs_vars* list, void* data); int lprocfs_dereg_obd(struct obd_device* device); struct proc_dir_entry* lprocfs_reg_mnt(char *mnt_name); int lprocfs_dereg_mnt(struct proc_dir_entry* root); -int lprocfs_reg_class(struct obd_type* type, lprocfs_vars_t* list, void* data); + +int lprocfs_reg_class(struct obd_type* type, struct lprocfs_vars* list, + void* data); int lprocfs_dereg_class(struct obd_type* class); int lprocfs_reg_main(void); int lprocfs_dereg_main(void); @@ -66,13 +72,16 @@ int lprocfs_ll_rd(char *page, char **start, off_t off, int count, int *eof, static inline int lprocfs_add_vars(struct proc_dir_entry* root, - lprocfs_vars_t* var, void* data) + struct lprocfs_vars* var, + void* data) + { return 0; } -static inline int lprocfs_reg_obd(struct obd_device* device, - lprocfs_vars_t* list, + +static inline int lprocfs_reg_obd(struct obd_device* device, + struct lprocfs_vars* list, void* data) { return 0; @@ -94,7 +103,9 @@ static inline int lprocfs_dereg_mnt(struct proc_dir_entry* root) } static inline int lprocfs_reg_class(struct obd_type* type, - lprocfs_vars_t* list, void* data) + struct lprocfs_vars* list, + void* data) + { return 0; } diff --git a/lustre/include/linux/obd_class.h b/lustre/include/linux/obd_class.h index 71a16bf..2ef75aa 100644 --- a/lustre/include/linux/obd_class.h +++ b/lustre/include/linux/obd_class.h @@ -746,7 +746,8 @@ static inline int obdo_cmp_md(struct obdo *dst, struct obdo *src, * // XXX if this were any uglier, I'd get my own show on MTV */ extern int (*ptlrpc_put_connection_superhack)(struct ptlrpc_connection *c); -int class_register_type(struct obd_ops *ops, lprocfs_vars_t* vars, char *nm); +int class_register_type(struct obd_ops *ops, struct lprocfs_vars* vars, + char *nm); int class_unregister_type(char *nm); int class_name2dev(char *name); int class_uuid2dev(char *uuid); diff --git a/lustre/llite/lproc_llite.c b/lustre/llite/lproc_llite.c index 428bd43..0c34215 100644 --- a/lustre/llite/lproc_llite.c +++ b/lustre/llite/lproc_llite.c @@ -53,7 +53,7 @@ int rd_blksize(char* page, char **start, off_t off, return len; } -int rd_blktotal(char* page, char **start, off_t off, +int rd_kbytestotal(char* page, char **start, off_t off, int count, int *eof, void *data) { int len=0; @@ -78,8 +78,8 @@ int rd_blkfree(char* page, char **start, off_t off, } -int rd_kbfree(char* page, char **start, off_t off, - int count, int *eof, void *data) +int rd_kbytesfree(char* page, char **start, off_t off, + int count, int *eof, void *data) { int len=0; struct super_block *sb=(struct super_block*)data; @@ -161,14 +161,13 @@ int rd_dev_uuid(char* page, char **start, off_t off, } -lprocfs_vars_t status_var_nm_1[]={ +struct lprocfs_vars status_var_nm_1[]={ {"status/uuid", rd_uuid, 0}, {"status/mntpt_path", rd_path, 0}, {"status/fs_type", rd_fstype, 0}, {"status/blocksize",rd_blksize, 0}, - {"status/blockstotal",rd_blktotal, 0}, - {"status/blocksfree",rd_blkfree, 0}, - {"status/kbytesfree", rd_kbfree, 0}, + {"status/kbytestotal",rd_kbytestotal, 0}, + {"status/kbytesfree", rd_kbytesfree, 0}, {"status/filestotal", rd_filestotal, 0}, {"status/filesfree", rd_filesfree, 0}, {"status/filegroups", rd_filegroups, 0}, diff --git a/lustre/llite/super.c b/lustre/llite/super.c index a687d80..cf6e39b 100644 --- a/lustre/llite/super.c +++ b/lustre/llite/super.c @@ -40,7 +40,7 @@ extern int rd_dev_name(char* page, char **start, off_t off, int count, int *eof, void *data); -extern lprocfs_vars_t status_var_nm_1[]; +extern struct lprocfs_vars status_var_nm_1[]; static char *ll_read_opt(const char *opt, char *data) { @@ -124,7 +124,7 @@ static struct super_block * ll_read_super(struct super_block *sb, /* Lprocfs variables */ char mnt_name[100]; char uuid_name[100]; - lprocfs_vars_t d_vars[3]; + struct lprocfs_vars d_vars[3]; @@ -247,10 +247,12 @@ static struct super_block * ll_read_super(struct super_block *sb, goto out_dev; /* Add the static configuration info */ - lprocfs_add_vars(sbi->ll_mnt_root, (lprocfs_vars_t*)status_var_nm_1, + lprocfs_add_vars(sbi->ll_mnt_root, + (struct lprocfs_vars*)status_var_nm_1, (void*)sb); /* Add the dynamic configuration stuff */ + /* MDC */ obd = class_uuid2obd(mdc); @@ -263,36 +265,40 @@ static struct super_block * ll_read_super(struct super_block *sb, d_vars[0].write_fptr=0; d_vars[0].name=(char*)mnt_name; - memset(uuid_name, '\0', strlen(uuid_name)); - sprintf(uuid_name, "status/%s/uuid", obd->obd_type->typ_name); + + snprintf(uuid_name, strlen(uuid_name), "status/%s/uuid", + obd->obd_type->typ_name); d_vars[1].read_fptr=rd_dev_uuid; d_vars[1].write_fptr=0; d_vars[1].name=(char*)uuid_name; - err=lprocfs_add_vars(sbi->ll_mnt_root, (lprocfs_vars_t*)d_vars, + err=lprocfs_add_vars(sbi->ll_mnt_root, (struct lprocfs_vars* )d_vars, (void*)obd); if (err) { CDEBUG(D_OTHER, "Unable to add fs proc dynamic variables"); } + /* OSC or LOV*/ obd = class_uuid2obd(osc); /* Reuse mnt_name */ - memset(mnt_name, '\0', strlen(mnt_name)); - sprintf(mnt_name, "status/%s/common_name", obd->obd_type->typ_name); + + snprintf(mnt_name, strlen(mnt_name), "status/%s/common_name", + obd->obd_type->typ_name); memset(d_vars, 0, sizeof(d_vars)); d_vars[0].read_fptr=rd_dev_name; d_vars[0].write_fptr=0; d_vars[0].name=(char*)mnt_name; - memset(uuid_name, '\0', strlen(uuid_name)); - sprintf(uuid_name, "status/%s/uuid", obd->obd_type->typ_name); + + snprintf(uuid_name, strlen(uuid_name), "status/%s/uuid", + obd->obd_type->typ_name); d_vars[1].read_fptr=rd_dev_uuid; d_vars[1].write_fptr=0; d_vars[1].name=(char*)uuid_name; - err=lprocfs_add_vars(sbi->ll_mnt_root, (lprocfs_vars_t*)d_vars, + err=lprocfs_add_vars(sbi->ll_mnt_root, (struct lprocfs_vars* )d_vars, (void*)obd); if (err) { CDEBUG(D_OTHER, "Unable to add fs proc dynamic variables"); diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 97429ee..9d57f0e 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -29,8 +29,8 @@ #include #include -extern lprocfs_vars_t status_var_nm_1[]; -extern lprocfs_vars_t status_class_var[]; +extern struct lprocfs_vars status_var_nm_1[]; +extern struct lprocfs_vars status_class_var[]; static kmem_cache_t *lov_file_cache; @@ -1324,7 +1324,8 @@ int lov_attach(struct obd_device *dev, obd_count len, void *data) { int rc; - rc = lprocfs_reg_obd(dev, (lprocfs_vars_t*)status_var_nm_1, (void*)dev); + rc = lprocfs_reg_obd(dev, (struct lprocfs_vars*)status_var_nm_1, + (void*)dev); return rc; } @@ -1373,7 +1374,7 @@ static int __init lov_init(void) RETURN(-ENOMEM); rc = class_register_type(&lov_obd_ops, - (lprocfs_vars_t*)status_class_var, + (struct lprocfs_vars*)status_class_var, OBD_LOV_DEVICENAME); if (rc) RETURN(rc); diff --git a/lustre/lov/lproc_lov.c b/lustre/lov/lproc_lov.c index 8198dc6..8ad5a5b 100644 --- a/lustre/lov/lproc_lov.c +++ b/lustre/lov/lproc_lov.c @@ -176,7 +176,7 @@ int rd_mdc(char* page, char **start, off_t off, return len; } -lprocfs_vars_t status_var_nm_1[]={ +struct lprocfs_vars status_var_nm_1[]={ {"status/uuid", rd_uuid, 0}, {"status/stripesize",rd_stripesize, 0}, {"status/stripeoffset",rd_stripeoffset, 0}, @@ -205,7 +205,7 @@ int rd_numdevices(char* page, char **start, off_t off, return len; } -lprocfs_vars_t status_class_var[]={ +struct lprocfs_vars status_class_var[]={ {"status/num_devices", rd_numdevices, 0}, {0} }; diff --git a/lustre/mdc/lproc_mdc.c b/lustre/mdc/lproc_mdc.c index 54d1d4c..8fc9fa6 100644 --- a/lustre/mdc/lproc_mdc.c +++ b/lustre/mdc/lproc_mdc.c @@ -101,7 +101,7 @@ int rd_server_name(char* page, char **start, off_t off, } -lprocfs_vars_t status_var_nm_1[]={ +struct lprocfs_vars status_var_nm_1[]={ {"status/uuid", rd_uuid, 0}, {"status/blocksize",rd_blksize, 0}, {"status/kbytestotal",rd_kbtotal, 0}, @@ -122,7 +122,7 @@ int rd_numdevices(char* page, char **start, off_t off, return len; } -lprocfs_vars_t status_class_var[]={ +struct lprocfs_vars status_class_var[]={ {"status/num_devices", rd_numdevices, 0}, {0} }; diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 4362ed1..27c0808 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -37,8 +37,8 @@ #define REQUEST_MINOR 244 extern int mds_queue_req(struct ptlrpc_request *); -extern lprocfs_vars_t status_var_nm_1[]; -extern lprocfs_vars_t status_class_var[]; +extern struct lprocfs_vars status_var_nm_1[]; +extern struct lprocfs_vars status_class_var[]; /* should become mdc_getinfo() */ int mdc_getstatus(struct lustre_handle *conn, struct ll_fid *rootfid) @@ -774,7 +774,8 @@ int mdc_attach(struct obd_device *dev, obd_count len, void *data) { int rc; - rc = lprocfs_reg_obd(dev, (lprocfs_vars_t*)status_var_nm_1, (void*)dev); + rc = lprocfs_reg_obd(dev, (struct lprocfs_vars*)status_var_nm_1, + (void*)dev); return rc; } @@ -799,7 +800,7 @@ static int __init ptlrpc_request_init(void) { int rc; rc = class_register_type(&mdc_obd_ops, - (lprocfs_vars_t*)status_class_var, + (struct lprocfs_vars*)status_class_var, LUSTRE_MDC_NAME); if(rc) RETURN(rc); diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index f4e601c..7b6da6b 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -49,8 +49,8 @@ extern int mds_update_last_rcvd(struct mds_obd *mds, void *handle, struct ptlrpc_request *req); static int mds_cleanup(struct obd_device * obddev); -extern lprocfs_vars_t status_var_nm_1[]; -extern lprocfs_vars_t status_class_var[]; +extern struct lprocfs_vars status_var_nm_1[]; +extern struct lprocfs_vars status_class_var[]; inline struct mds_obd *mds_req2mds(struct ptlrpc_request *req) { @@ -1461,7 +1461,8 @@ int mds_attach(struct obd_device *dev, obd_count len, void *data) { int rc; - rc = lprocfs_reg_obd(dev, (lprocfs_vars_t*)status_var_nm_1, (void*)dev); + rc = lprocfs_reg_obd(dev, (struct lprocfs_vars*)status_var_nm_1, + (void*)dev); return rc; } @@ -1555,7 +1556,8 @@ static int __init mds_init(void) if (mds_file_cache == NULL) return -ENOMEM; - class_register_type(&mds_obd_ops, (lprocfs_vars_t*)status_class_var, + class_register_type(&mds_obd_ops, + (struct lprocfs_vars*)status_class_var, LUSTRE_MDS_NAME); class_register_type(&mdt_obd_ops, 0, LUSTRE_MDT_NAME); diff --git a/lustre/mds/lproc_mds.c b/lustre/mds/lproc_mds.c index a65816f..80db1c7 100644 --- a/lustre/mds/lproc_mds.c +++ b/lustre/mds/lproc_mds.c @@ -160,7 +160,7 @@ int rd_filesets(char* page, char **start, off_t off, { return 0; } -lprocfs_vars_t status_var_nm_1[]={ +struct lprocfs_vars status_var_nm_1[]={ {"status/uuid", rd_uuid, 0}, {"status/f_blocksize",rd_blksize, 0}, {"status/f_blockstotal",rd_blktotal, 0}, @@ -181,7 +181,7 @@ int rd_numdevices(char* page, char **start, off_t off, return len; } -lprocfs_vars_t status_class_var[]={ +struct lprocfs_vars status_class_var[]={ {"status/num_devices", rd_numdevices, 0}, {0} }; diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index fcc57a5..91943a9 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -173,7 +173,7 @@ int class_register_type(struct obd_ops *ops, struct lprocfs_vars* vars, char *nm list_add(&type->typ_chain, &obd_types); memcpy(type->typ_ops, ops, sizeof(*type->typ_ops)); strcpy(type->typ_name, nm); - rc = lprocfs_reg_class(type, (lprocfs_vars_t *)vars, (void*)type); + rc = lprocfs_reg_class(type, (struct lprocfs_vars*)vars, (void*)type); if(rc) RETURN(rc); diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index ea2b9c4..6e6ebfb 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -43,8 +43,6 @@ */ char tok[] = {'/', (char)0}; - - /* * Externs */ @@ -92,16 +90,17 @@ void lprocfs_remove_all(struct proc_dir_entry* root) struct proc_dir_entry *temp=root; struct proc_dir_entry* rm_entry; + struct proc_dir_entry* parent=root->parent; while(1){ while(temp->subdir){ temp=temp->subdir; - } + } rm_entry=temp; temp=temp->parent; remove_proc_entry(rm_entry->name, rm_entry->parent); - if(temp==root->parent) break; + if(temp==parent) break; } @@ -119,16 +118,8 @@ struct proc_dir_entry* lprocfs_new_dir(struct proc_dir_entry* root, char* my_str; char* mover_str; - /* - * Remove trailing escaping character - */ - memset(temp_string, 0, MAX_STRING_SIZE); - if (strlen(string) >= MAX_STRING_SIZE) { - CDEBUG(D_OTHER, "Directory namespace too long"); - return 0; - } - strcpy(temp_string, string); + strncpy(temp_string, string, MAX_STRING_SIZE-1); temp_string[strlen(string) + 1] = '\0'; new_root=root; @@ -156,7 +147,7 @@ struct proc_dir_entry* lprocfs_new_dir(struct proc_dir_entry* root, } int lprocfs_new_vars(struct proc_dir_entry* root, - lprocfs_vars_t* list, + struct lprocfs_vars* list, const char* tok, void* data) { @@ -176,8 +167,8 @@ int lprocfs_new_vars(struct proc_dir_entry* root, return -EINVAL; } /* Convert the last element into a leaf-node */ - memset(temp_string, 0, MAX_STRING_SIZE); - strcpy(temp_string, temp_root->name); + + strncpy(temp_string, temp_root->name, MAX_STRING_SIZE-1); temp_string[strlen(temp_root->name) + 1] = '\0'; new_parent=temp_root->parent; if (new_parent != 0){ @@ -201,7 +192,7 @@ int lprocfs_new_vars(struct proc_dir_entry* root, */ int lprocfs_add_vars(struct proc_dir_entry* root, - lprocfs_vars_t* var, + struct lprocfs_vars* var, void* data) { @@ -212,7 +203,7 @@ int lprocfs_add_vars(struct proc_dir_entry* root, } int lprocfs_reg_obd(struct obd_device* device, - lprocfs_vars_t* list, + struct lprocfs_vars* list, void* data) { @@ -262,7 +253,7 @@ int lprocfs_dereg_mnt(struct proc_dir_entry* root) } int lprocfs_reg_class(struct obd_type* type, - lprocfs_vars_t* list, + struct lprocfs_vars* list, void* data) { struct proc_dir_entry* root; diff --git a/lustre/obdecho/echo.c b/lustre/obdecho/echo.c index 8b3d638..9d7800e 100644 --- a/lustre/obdecho/echo.c +++ b/lustre/obdecho/echo.c @@ -12,8 +12,8 @@ * and Andreas Dilger */ -static char rcsid[] __attribute ((unused)) = "$Id: echo.c,v 1.43 2002/11/02 01:09:28 braam Exp $"; -#define OBDECHO_VERSION "$Revision: 1.43 $" +static char rcsid[] __attribute ((unused)) = "$Id: echo.c,v 1.44 2002/11/02 02:41:31 thantry Exp $"; +#define OBDECHO_VERSION "$Revision: 1.44 $" #define EXPORT_SYMTAB @@ -46,8 +46,8 @@ static atomic_t echo_getattrs; #define ECHO_PROC_STAT "sys/obdecho" #define ECHO_INIT_OBJID 0x1000000000000000ULL -extern lprocfs_vars_t status_var_nm_1[]; -extern lprocfs_vars_t status_class_var[]; +extern struct lprocfs_vars status_var_nm_1[]; +extern struct lprocfs_vars status_class_var[]; int echo_proc_read(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -433,7 +433,8 @@ int echo_attach(struct obd_device *dev, obd_count len, void *data) { int rc; - rc = lprocfs_reg_obd(dev, (lprocfs_vars_t*)status_var_nm_1, (void*)dev); + rc = lprocfs_reg_obd(dev, (struct lprocfs_vars*)status_var_nm_1, + (void*)dev); return rc; } @@ -473,7 +474,7 @@ static int __init obdecho_init(void) echo_proc_init(); rc = class_register_type(&echo_obd_ops, - (lprocfs_vars_t*)status_class_var, + (struct lprocfs_vars*)status_class_var, OBD_ECHO_DEVICENAME); if (rc) RETURN(rc); diff --git a/lustre/obdecho/lproc_echo.c b/lustre/obdecho/lproc_echo.c index 4592f6b..f949610 100644 --- a/lustre/obdecho/lproc_echo.c +++ b/lustre/obdecho/lproc_echo.c @@ -46,7 +46,7 @@ int rd_fstype(char* page, char **start, off_t off, } -lprocfs_vars_t status_var_nm_1[]={ +struct lprocfs_vars status_var_nm_1[]={ {"status/uuid", rd_uuid, 0}, {"status/fstype", rd_fstype, 0}, {0} @@ -61,7 +61,7 @@ int rd_numdevices(char* page, char **start, off_t off, return len; } -lprocfs_vars_t status_class_var[]={ +struct lprocfs_vars status_class_var[]={ {"status/num_devices", rd_numdevices, 0}, {0} }; diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index b4f9692..d0d4b72 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -32,8 +32,8 @@ #include #include -extern lprocfs_vars_t status_class_var[]; -extern lprocfs_vars_t status_var_nm_1[]; +extern struct lprocfs_vars status_class_var[]; +extern struct lprocfs_vars status_var_nm_1[]; static kmem_cache_t *filter_open_cache; static kmem_cache_t *filter_dentry_cache; @@ -1762,7 +1762,8 @@ int filter_attach(struct obd_device *dev, { int rc; - rc = lprocfs_reg_obd(dev, (lprocfs_vars_t*)status_var_nm_1, (void*)dev); + rc = lprocfs_reg_obd(dev, (struct lprocfs_vars*)status_var_nm_1, + (void*)dev); return rc; } @@ -1819,7 +1820,7 @@ static int __init obdfilter_init(void) } return class_register_type(&filter_obd_ops, - (lprocfs_vars_t*)status_class_var, + (struct lprocfs_vars*)status_class_var, OBD_FILTER_DEVICENAME); } diff --git a/lustre/obdfilter/lproc_obdfilter.c b/lustre/obdfilter/lproc_obdfilter.c index ab37589..a559466 100644 --- a/lustre/obdfilter/lproc_obdfilter.c +++ b/lustre/obdfilter/lproc_obdfilter.c @@ -126,7 +126,7 @@ int rd_filesfree(char* page, char **start, off_t off, } -lprocfs_vars_t status_var_nm_1[]={ +struct lprocfs_vars status_var_nm_1[]={ {"status/uuid", rd_uuid, 0}, {"status/blocksize",rd_blksize, 0}, {"status/kbytestotal",rd_kbtotal, 0}, @@ -145,7 +145,7 @@ int rd_numdevices(char* page, char **start, off_t off, return len; } -lprocfs_vars_t status_class_var[]={ +struct lprocfs_vars status_class_var[]={ {"status/num_devices", rd_numdevices, 0}, {0} }; diff --git a/lustre/osc/lproc_osc.c b/lustre/osc/lproc_osc.c index 0ee8873..d67bbb0 100644 --- a/lustre/osc/lproc_osc.c +++ b/lustre/osc/lproc_osc.c @@ -98,7 +98,7 @@ int rd_conn_uuid(char* page, char **start, off_t off, } -lprocfs_vars_t status_var_nm_1[]={ +struct lprocfs_vars status_var_nm_1[]={ {"status/uuid", rd_uuid, 0}, {"status/f_blocksize",rd_blksize, 0}, {"status/f_blockstotal",rd_blktotal, 0}, @@ -120,7 +120,7 @@ int rd_numdevices(char* page, char **start, off_t off, return len; } -lprocfs_vars_t status_class_var[]={ +struct lprocfs_vars status_class_var[]={ {"status/num_devices", rd_numdevices, 0}, {0} }; diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 5700797..a28de1f 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -39,8 +39,8 @@ #include /* for PTL_MD_MAX_IOV */ #include -extern lprocfs_vars_t status_var_nm_1[]; -extern lprocfs_vars_t status_class_var[]; +extern struct lprocfs_vars status_var_nm_1[]; +extern struct lprocfs_vars status_class_var[]; static int osc_getattr(struct lustre_handle *conn, struct obdo *oa, struct lov_stripe_md *md) @@ -823,7 +823,8 @@ int osc_attach(struct obd_device *dev, obd_count len, void *data) { int rc; - rc = lprocfs_reg_obd(dev, (lprocfs_vars_t*)status_var_nm_1, (void*)dev); + rc = lprocfs_reg_obd(dev, (struct lprocfs_vars*)status_var_nm_1, + (void*)dev); return rc; } @@ -861,7 +862,7 @@ static int __init osc_init(void) int rc; rc = class_register_type(&osc_obd_ops, - (lprocfs_vars_t*)status_class_var, + (struct lprocfs_vars*)status_class_var, LUSTRE_OSC_NAME); if (rc) RETURN(rc); diff --git a/lustre/ost/lproc_ost.c b/lustre/ost/lproc_ost.c index 8878ad0..a22c95c 100644 --- a/lustre/ost/lproc_ost.c +++ b/lustre/ost/lproc_ost.c @@ -148,7 +148,7 @@ int rd_objgroups(char* page, char **start, off_t off, return 0; } -lprocfs_vars_t status_var_nm_1[]={ +struct lprocfs_vars status_var_nm_1[]={ {"status/uuid", rd_uuid, 0}, {"status/blocksize",rd_blksize, 0}, {"status/kbytesfree", rd_kbfree, 0}, @@ -168,7 +168,7 @@ int rd_numdevices(char* page, char **start, off_t off, return len; } -lprocfs_vars_t status_class_var[]={ +struct lprocfs_vars status_class_var[]={ {"status/num_devices", rd_numdevices, 0}, {0} }; diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index 9282752..19dad2f 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -40,8 +40,8 @@ #include #include -extern lprocfs_vars_t status_var_nm_1[]; -extern lprocfs_vars_t status_class_var[]; +extern struct lprocfs_vars status_var_nm_1[]; +extern struct lprocfs_vars status_class_var[]; static int ost_destroy(struct ptlrpc_request *req) { @@ -675,7 +675,8 @@ int ost_attach(struct obd_device *dev, /* lprocfs_reg_dev(dev, (lprocfs_group_t*)lprocfs_ptlrpc_nm, sizeof(struct lprofiler_ptlrpc)); */ - lprocfs_reg_obd(dev, (lprocfs_vars_t*)status_var_nm_1, (void*)dev); + lprocfs_reg_obd(dev, (struct lprocfs_vars*)status_var_nm_1, + (void*)dev); return 0; } @@ -702,7 +703,7 @@ static int __init ost_init(void) int rc; rc = class_register_type(&ost_obd_ops, - (lprocfs_vars_t*)status_class_var, + (struct lprocfs_vars*)status_class_var, LUSTRE_OST_NAME); if (rc) RETURN(rc); diff --git a/lustre/ptlrpc/lproc_ptlrpc.c b/lustre/ptlrpc/lproc_ptlrpc.c index 48a8401..36e9254 100644 --- a/lustre/ptlrpc/lproc_ptlrpc.c +++ b/lustre/ptlrpc/lproc_ptlrpc.c @@ -34,7 +34,7 @@ int rd_uuid(char* page, char **start, off_t off, } -lprocfs_vars_t status_var_nm_1[]={ +struct lprocfs_vars status_var_nm_1[]={ {"status/uuid", rd_uuid, 0}, {0} }; @@ -47,7 +47,7 @@ int rd_numdevices(char* page, char **start, off_t off, return len; } -lprocfs_vars_t status_class_var[]={ +struct lprocfs_vars status_class_var[]={ {"status/num_devices", rd_numdevices, 0}, {0} }; diff --git a/lustre/ptlrpc/rpc.c b/lustre/ptlrpc/rpc.c index 7cdd2a6..cacb98e 100644 --- a/lustre/ptlrpc/rpc.c +++ b/lustre/ptlrpc/rpc.c @@ -37,8 +37,8 @@ extern int ptlrpc_init_portals(void); extern void ptlrpc_exit_portals(void); -extern lprocfs_vars_t status_var_nm_1[]; -extern lprocfs_vars_t status_class_var[]; +extern struct lprocfs_vars status_var_nm_1[]; +extern struct lprocfs_vars status_class_var[]; int connmgr_setup(struct obd_device *obddev, obd_count len, void *buf) { @@ -170,7 +170,8 @@ int connmgr_attach(struct obd_device *dev, obd_count len, void *data) { int rc; - rc = lprocfs_reg_obd(dev, (lprocfs_vars_t*)status_var_nm_1, (void*)dev); + rc = lprocfs_reg_obd(dev, (struct lprocfs_vars*)status_var_nm_1, + (void*)dev); return rc; } @@ -200,7 +201,7 @@ static int __init ptlrpc_init(void) RETURN(rc); ptlrpc_init_connection(); rc = class_register_type(&recovd_obd_ops, - (lprocfs_vars_t*)status_class_var, + (struct lprocfs_vars*)status_class_var, LUSTRE_HA_NAME); if (rc) RETURN(rc); -- 1.8.3.1