Lustre cleanups
cover Lustre cleanups
From: Oleg Drokin <[email protected]>
This bunch of patches removes significant chunks of Lustre specific allocators which is possible thanks to prior patches from Julia Lawall.
Also removed are some server-only bits of code that make no sense to retain in a client.
Please consider.
Oleg Drokin (19):
staging/lustre: Remove OBD_CPT_ALLOC_LARGE staging/lustre: Remove unused OBD_VMALLOC staging/lustre: Remove unused OBD_CPT_ALLOC* macros staging/lustre: Remove users of OBD_ALLOC/FREE_PTR lu_object.h staging/lustre/llite: Get rid of OBD_ALLOC/FREE_PTR staging/lustre/obdclass: replace OBD_ALLOC_GFP with kzalloc staging/lustre: Remove references to OBD_ALLOC/FREE* in comments staging/lustre/fld: Replace OBD_ALLOC_GFP with kzalloc staging/lustre: Convert lustre_cfg_new/free to use kzalloc/kfree staging/lustre/ptlrpc: Replace OBD_FREE_PTR with kfree staging/lustre: Replace last users of OBD_ALLOC/FREE_LARGE staging/lustre: Remove stray bit of userland utils code staging/lustre: Remove unused OBD_ALLOC* and OBD_FREE macros staging/lustre: Remove memory allocation fault injection framework staging/lustre: Remove lustre used memory tracking framework staging/lustre: remove obd_memory stats counter staging/lustre: Remove IS_SERVER and all users staging/lustre: remove IS_MDS|IS_OST|IS_MGS defines and users staging/lustre: Remove server defines from lustre_disk.h
drivers/staging/lustre/lustre/fld/fld_cache.c | 2 +- drivers/staging/lustre/lustre/include/lu_object.h | 4 +- drivers/staging/lustre/lustre/include/lustre_cfg.h | 6 +- .../staging/lustre/lustre/include/lustre_disk.h | 142 --------------- drivers/staging/lustre/lustre/include/lustre_lib.h | 4 +- drivers/staging/lustre/lustre/include/lustre_net.h | 2 +- drivers/staging/lustre/lustre/include/obd.h | 12 +- .../staging/lustre/lustre/include/obd_support.h | 198 +-------------------- drivers/staging/lustre/lustre/llite/file.c | 2 +- drivers/staging/lustre/lustre/llite/llite_lib.c | 2 +- drivers/staging/lustre/lustre/mgc/mgc_request.c | 44 +---- drivers/staging/lustre/lustre/obdclass/cl_page.c | 3 +- drivers/staging/lustre/lustre/obdclass/class_obd.c | 103 ----------- .../staging/lustre/lustre/obdclass/llog_internal.h | 8 - .../lustre/lustre/obdclass/lprocfs_counters.c | 9 - .../lustre/lustre/obdclass/lprocfs_status.c | 2 +- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 91 ++-------- .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 2 - .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h | 2 +- drivers/staging/lustre/lustre/ptlrpc/service.c | 6 +- 21 files changed, 46 insertions(+), 600 deletions(-)
Signature · 1 line
2.1.0
PATCH 1/19 staging/lustre: Remove OBD_CPT_ALLOC_LARGE
From: Oleg Drokin <[email protected]>
Remove OBD_CPT_ALLOC_LARGE define and convert the only user to libcfs_kvzalloc_cpt.
--- drivers/staging/lustre/lustre/include/obd_support.h | 5 ----- drivers/staging/lustre/lustre/ptlrpc/service.c | 6 ++++-- 2 files changed, 4 insertions(+), 7 deletions(-)
drivers/staging/lustre/lustre/include/obd_support.h +0 -5
@@ -634,11 +634,6 @@ do { \ ptr =libcfs_kvzalloc (size,GFP_NOFS ); \ } while (0) -#define OBD_CPT_ALLOC_LARGE (ptr, cptab, cpt, size) \ -do { \ - ptr = libcfs_kvzalloc_cpt(cptab, cpt, size, GFP_NOFS); \ -} while (0) -#define OBD_FREE_LARGE (ptr, size) \ do { \ (void)(size); \
drivers/staging/lustre/lustre/ptlrpc/service.c +4 -2
@@ -86,8 +86,10 @@ ptlrpc_alloc_rqbd(struct ptlrpc_service_part *svcpt) rqbd->rqbd_cbid.cbid_fn = request_in_callback; rqbd->rqbd_cbid.cbid_arg = rqbd;INIT_LIST_HEAD (&rqbd->rqbd_reqs); -OBD_CPT_ALLOC_LARGE (rqbd->rqbd_buffer, svc->srv_cptable, - svcpt->scp_cpt, svc->srv_buf_size); + rqbd->rqbd_buffer =libcfs_kvzalloc_cpt (svc->srv_cptable, + svcpt->scp_cpt, + svc->srv_buf_size, +GFP_KERNEL );if (rqbd->rqbd_buffer ==NULL ) {kfree (rqbd);return NULL ;
Signature · 1 line
2.1.0
PATCH 2/19 staging/lustre: Remove unused OBD_VMALLOC
In reply to [email protected]From: Oleg Drokin <[email protected]>
These macros are not used anymore, so let's remove them, also __OBD_VMALLOC_VEROBSE and OBD_CPT_VMALLOC
--- .../staging/lustre/lustre/include/obd_support.h | 29 ---------------------- 1 file changed, 29 deletions(-)
drivers/staging/lustre/lustre/include/obd_support.h +0 -29
@@ -608,27 +608,6 @@ do { \#define OBD_CPT_ALLOC_PTR (ptr, cptab, cpt) \ OBD_CPT_ALLOC(ptr, cptab, cpt, sizeof(*(ptr))) -# define __OBD_VMALLOC_VEROBSE (ptr, cptab, cpt, size) \ -do { \ - (ptr) = cptab == NULL ? \ - vzalloc(size) : \ - vzalloc_node(size, cfs_cpt_spread_node(cptab, cpt)); \ - if (unlikely((ptr) == NULL)) { \ - CERROR("vmalloc of '" #ptr "' (%d bytes) failed\n", \ - (int)(size)); \ - CERROR("%llu total bytes allocated by Lustre\n", \ - obd_memory_sum()); \ - } else { \ - OBD_ALLOC_POST(ptr, size, "vmalloced"); \ - } \ -} while (0) - -# define OBD_VMALLOC (ptr, size) \ - __OBD_VMALLOC_VEROBSE(ptr, NULL, 0, size) -# define OBD_CPT_VMALLOC (ptr, cptab, cpt, size) \ - __OBD_VMALLOC_VEROBSE(ptr, cptab, cpt, size) - -#define OBD_ALLOC_LARGE (ptr, size) \ do { \ ptr = libcfs_kvzalloc(size, GFP_NOFS); \
@@ -677,14 +656,6 @@ do { \POISON_PTR (ptr); \ }while (0 ) - -#define OBD_VFREE (ptr, size) \ - do { \ - OBD_FREE_PRE(ptr, size, "vfreed"); \ - vfree(ptr); \ - POISON_PTR(ptr); \ - } while (0) -/* we memset() the slab object to 0 when allocation succeeds, so DO NOT * HAVE A CTOR THAT DOES ANYTHING. its work will be cleared here. we'd * love to assert on that, but slab.c keeps kmem_cache_s all to itself. */
Signature · 1 line
2.1.0
PATCH 3/19 staging/lustre: Remove unused OBD_CPT_ALLOC* macros
In reply to [email protected]From: Oleg Drokin <[email protected]>
OBD_CPT_ALLOC and friends are no longer used, so remove them.
--- drivers/staging/lustre/lustre/include/obd_support.h | 9 --------- 1 file changed, 9 deletions(-)
drivers/staging/lustre/lustre/include/obd_support.h +0 -9
@@ -599,15 +599,6 @@ do { \#define OBD_ALLOC_PTR (ptr) OBD_ALLOC(ptr, sizeof(*(ptr)))#define OBD_ALLOC_PTR_WAIT (ptr) OBD_ALLOC_WAIT(ptr, sizeof(*(ptr))) -#define OBD_CPT_ALLOC_GFP (ptr, cptab, cpt, size, gfp_mask) \ - __OBD_MALLOC_VERBOSE(ptr, cptab, cpt, size, gfp_mask) - -#define OBD_CPT_ALLOC (ptr, cptab, cpt, size) \ - OBD_CPT_ALLOC_GFP(ptr, cptab, cpt, size, GFP_NOFS) - -#define OBD_CPT_ALLOC_PTR (ptr, cptab, cpt) \ - OBD_CPT_ALLOC(ptr, cptab, cpt, sizeof(*(ptr))) -#define OBD_ALLOC_LARGE (ptr, size) \ do { \ ptr = libcfs_kvzalloc(size, GFP_NOFS); \
Signature · 1 line
2.1.0
PATCH 4/19 staging/lustre: Remove users of OBD_ALLOC/FREE_PTR lu_object.h
In reply to [email protected]From: Oleg Drokin <[email protected]>
These are converted to regular kzalloc/kfree calls.
--- drivers/staging/lustre/lustre/include/lu_object.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/lustre/lustre/include/lu_object.h +2 -2
@@ -1126,7 +1126,7 @@ struct lu_context_key { \CLASSERT (PAGE_CACHE_SIZE >=sizeof (*value)); \ \ -OBD_ALLOC_PTR (value); \ + value =kzalloc (sizeof (*value),GFP_NOFS ); \if (value ==NULL ) \ value =ERR_PTR (-ENOMEM ); \ \
@@ -1140,7 +1140,7 @@ struct lu_context_key { { \type *info = data; \ \ -OBD_FREE_PTR (info); \ +kfree (info); \ } \ struct __##mod##__dummy_fini {; } /* semicolon catcher */
Signature · 1 line
2.1.0
PATCH 5/19 staging/lustre/llite: Get rid of OBD_ALLOC/FREE_PTR
In reply to [email protected]From: Oleg Drokin <[email protected]>
The remaining users in ll_open_cleanup and obd_mod_alloc are converted to regular kzalloc/kfree.
--- drivers/staging/lustre/lustre/include/obd.h | 4 ++-- drivers/staging/lustre/lustre/llite/llite_lib.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/lustre/lustre/include/obd.h +2 -2
@@ -1408,7 +1408,7 @@ static inline struct md_open_data *obd_mod_alloc(void) {struct md_open_data *mod; -OBD_ALLOC_PTR (mod); + mod =kzalloc (sizeof (*mod),GFP_NOFS );if (mod ==NULL )return NULL ;atomic_set (&mod->mod_refcount,1 );
@@ -1421,7 +1421,7 @@ static inline struct md_open_data *obd_mod_alloc(void)if (atomic_dec_and_test (&(mod)->mod_refcount)) { \if ((mod)->mod_open_req) \ptlrpc_req_finished ((mod)->mod_open_req); \ -OBD_FREE_PTR (mod); \ +kfree (mod); \ } \ })
drivers/staging/lustre/lustre/llite/llite_lib.c +1 -1
@@ -1996,7 +1996,7 @@ void ll_open_cleanup(struct super_block *sb, struct ptlrpc_request *open_req)struct obd_export *exp =ll_s2sbi (sb)->ll_md_exp; body =req_capsule_server_get (&open_req->rq_pill, &RMF_MDT_BODY ); -OBD_ALLOC_PTR (op_data); + op_data =kzalloc (sizeof (*op_data),GFP_NOFS );if (!op_data) { CWARN("%s: cannot allocate op_data to release open handle for " DFID "\n",
Signature · 1 line
2.1.0
PATCH 6/19 staging/lustre/obdclass: replace OBD_ALLOC_GFP with kzalloc
In reply to [email protected]From: Oleg Drokin <[email protected]>
Part of getting rid of custom Lustre allocation macros.
--- drivers/staging/lustre/lustre/obdclass/cl_page.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/lustre/lustre/obdclass/cl_page.c +1 -2
@@ -283,8 +283,7 @@ static struct cl_page *cl_page_alloc(const struct lu_env *env,struct cl_page *page;struct lu_object_header *head; -OBD_ALLOC_GFP (page,cl_object_header (o)->coh_page_bufsize, -GFP_NOFS ); + page =kzalloc (cl_object_header (o)->coh_page_bufsize,GFP_NOFS );if (page !=NULL ) {int result =0 ;
Signature · 1 line
2.1.0
PATCH 7/19 staging/lustre: Remove references to OBD_ALLOC/FREE* in comments
In reply to [email protected]From: Oleg Drokin <[email protected]>
Since everything is now supposed to use regular kernel alloc and free functions.
--- drivers/staging/lustre/lustre/include/lustre_lib.h | 2 +- drivers/staging/lustre/lustre/include/lustre_net.h | 2 +- drivers/staging/lustre/lustre/llite/file.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/lustre/lustre/include/lustre_lib.h +1 -1
@@ -453,7 +453,7 @@ static inline void obd_ioctl_freedata(char *buf, int len)* __wake_up_common(q, ...); (2.2) * spin_unlock(&q->lock, flags); (2.3) * -* OBD_FREE_PTR(obj); (3) +* kfree(obj); (3) * * As l_wait_event() may "short-cut" execution and return without taking * wait-queue spin-lock, some additional synchronization is necessary to
drivers/staging/lustre/lustre/include/lustre_net.h +1 -1
@@ -306,7 +306,7 @@ union ptlrpc_async_args {/** * Scratchpad for passing args to completion interpreter. Users * cast to the struct of their choosing, and CLASSERT that this is -* big enough. For _tons_ of context, OBD_ALLOC a struct and store +* big enough. For _tons_ of context, kmalloc a struct and store * a pointer to it here. The pointer_arg ensures this struct is at * least big enough for that. */
drivers/staging/lustre/lustre/llite/file.c +1 -1
@@ -694,7 +694,7 @@ out_och_free:if (rc) {if (och_p && *och_p) {kfree (*och_p); - *och_p =NULL ;/* OBD_FREE writes some magic there */ + *och_p =NULL ; (*och_usecount)--; }mutex_unlock (&lli->lli_och_mutex);
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +1 -1
@@ -1223,7 +1223,7 @@ int lprocfs_wr_evict_client(struct file *file, const char __user *buffer,return -ENOMEM ;/* -* OBD_ALLOC() will zero kbuf, but we only copy BUFLEN - 1 +* kzalloc() will zero kbuf, but we only copy BUFLEN - 1 * bytes into kbuf, to ensure that the string is NUL-terminated. * UUID_MAX should include a trailing NUL already. */
Signature · 1 line
2.1.0
PATCH 8/19 staging/lustre/fld: Replace OBD_ALLOC_GFP with kzalloc
In reply to [email protected]From: Oleg Drokin <[email protected]>
Part of effort to get rid of custom Lustre allocation macros.
--- drivers/staging/lustre/lustre/fld/fld_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/fld/fld_cache.c +1 -1
@@ -266,7 +266,7 @@ static void fld_cache_punch_hole(struct fld_cache *cache,const u64 new_end = range->lsr_end;struct fld_cache_entry *fldt; -OBD_ALLOC_GFP (fldt,sizeof (*fldt),GFP_ATOMIC ); + fldt =kzalloc (sizeof (*fldt),GFP_ATOMIC );if (!fldt) {kfree (f_new);/* overlap is not allowed, so dont mess up list. */
Signature · 1 line
2.1.0
PATCH 9/19 staging/lustre: Convert lustre_cfg_new/free to use kzalloc/kfree
In reply to [email protected]From: Oleg Drokin <[email protected]>
Part of effort of getting rid of custom Lustre allocation macros
--- drivers/staging/lustre/lustre/include/lustre_cfg.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/lustre/lustre/include/lustre_cfg.h +3 -3
@@ -231,8 +231,8 @@ static inline struct lustre_cfg *lustre_cfg_new(int cmd,char *ptr;int i; -OBD_ALLOC (lcfg,lustre_cfg_len (bufs->lcfg_bufcount, - bufs->lcfg_buflen)); + lcfg =kzalloc (lustre_cfg_len (bufs->lcfg_bufcount, bufs->lcfg_buflen), +GFP_NOFS );if (!lcfg)return ERR_PTR (-ENOMEM );
@@ -254,7 +254,7 @@ static inline void lustre_cfg_free(struct lustre_cfg *lcfg) len =lustre_cfg_len (lcfg->lcfg_bufcount, lcfg->lcfg_buflens); -OBD_FREE (lcfg, len); +kfree (lcfg);return ; }
Signature · 1 line
2.1.0
PATCH 10/19 staging/lustre/ptlrpc: Replace OBD_FREE_PTR with kfree
In reply to [email protected]From: Oleg Drokin <[email protected]>
Part of effort of getting rid of custom Lustre alloc/free macros
--- drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +1 -1
@@ -298,6 +298,6 @@ static inline void tgt_mod_exit(void)static inline void ptlrpc_reqset_put (struct ptlrpc_request_set *set) {if (atomic_dec_and_test (&set->set_refcount)) -OBD_FREE_PTR (set); +kfree (set); }#endif /* PTLRPC_INTERNAL_H */
Signature · 1 line
2.1.0
PATCH 11/19 staging/lustre: Replace last users of OBD_ALLOC/FREE_LARGE
In reply to [email protected]From: Oleg Drokin <[email protected]>
OBD_ALLOC_LARGE is now replaced with libcfs_kvzalloc and OBD_FREE_LARGE is now replaced with kvfree.
--- drivers/staging/lustre/lustre/include/lustre_lib.h | 2 +- drivers/staging/lustre/lustre/include/obd.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/staging/lustre/lustre/include/lustre_lib.h +1 -1
@@ -258,7 +258,7 @@ int obd_ioctl_popdata(void *arg, void *data, int len);static inline void obd_ioctl_freedata (char *buf,int len) { -OBD_FREE_LARGE (buf, len); +kvfree (buf);return ; }
drivers/staging/lustre/lustre/include/obd.h +4 -4
@@ -728,8 +728,8 @@ static inline void oti_alloc_cookies(struct obd_trans_info *oti,if (num_cookies ==1 ) oti->oti_logcookies = &oti->oti_onecookie;else -OBD_ALLOC_LARGE (oti->oti_logcookies, - num_cookies *sizeof (oti->oti_onecookie)); + oti->oti_logcookies =libcfs_kvzalloc (num_cookies *sizeof (oti->oti_onecookie), +GFP_NOFS ); oti->oti_numcookies = num_cookies; }
@@ -742,8 +742,8 @@ static inline void oti_free_cookies(struct obd_trans_info *oti)if (oti->oti_logcookies == &oti->oti_onecookie)LASSERT (oti->oti_numcookies ==1 );else -OBD_FREE_LARGE (oti->oti_logcookies, - oti->oti_numcookies*sizeof (oti->oti_onecookie)); +kvfree (oti->oti_logcookies); + oti->oti_logcookies =NULL ; oti->oti_numcookies =0 ; }
Signature · 1 line
2.1.0
PATCH 12/19 staging/lustre: Remove stray bit of userland utils code
In reply to [email protected]From: Oleg Drokin <[email protected]>
The UTILS are userland and I see it's causing confusion with things being already converted to kmalloc, so just remove it.
--- drivers/staging/lustre/lustre/include/obd_support.h | 18 ------------------ 1 file changed, 18 deletions(-)
drivers/staging/lustre/lustre/include/obd_support.h +0 -18
@@ -551,23 +551,6 @@ __u64 obd_pages_max(void);#define OBD_ALLOC_FAIL_MASK ((1 << OBD_ALLOC_FAIL_BITS) - 1)#define OBD_ALLOC_FAIL_MULT (OBD_ALLOC_FAIL_MASK / 100) -#if defined(LUSTRE_UTILS )/* this version is for utils only */ -#define __OBD_MALLOC_VERBOSE (ptr, cptab, cpt, size, flags) \ -do { \ - (ptr) = (cptab) == NULL ? \ - kmalloc(size, flags) : \ - kmalloc_node(size, flags, cfs_cpt_spread_node(cptab, cpt)); \ - if (unlikely((ptr) == NULL)) { \ - CERROR("kmalloc of '" #ptr "' (%d bytes) failed at %s:%d\n", \ - (int)(size), __FILE__, __LINE__); \ - } else { \ - memset(ptr, 0, size); \ - CDEBUG(D_MALLOC, "kmalloced '" #ptr "': %d at %p\n", \ - (int)(size), ptr); \ - } \ -} while (0) - -#else /* this version is for the kernel and liblustre */ #define OBD_FREE_RTN0 (ptr) \ ({ \ kfree(ptr); \
@@ -589,7 +572,6 @@ do { \OBD_ALLOC_POST (ptr, size,"kmalloced" ); \ } \ } while (0) -#endif #define OBD_ALLOC_GFP (ptr, size, gfp_mask) \ __OBD_MALLOC_VERBOSE(ptr, NULL, 0, size, gfp_mask)
Signature · 1 line
2.1.0
PATCH 13/19 staging/lustre: Remove unused OBD_ALLOC* and OBD_FREE macros
In reply to [email protected]From: Oleg Drokin <[email protected]>
This removes now unused OBD_ALLOC, OBD_ALLOC_GFP, OBD_ALLOC_PTR, OBD_ALLOC_LARGE and supporting infrastructure.
Also OBD_FREE, OBD_FREE_PTR, OBD_FREE_LARGE and supporting infrastructure.
--- .../staging/lustre/lustre/include/obd_support.h | 52 ---------------------- 1 file changed, 52 deletions(-)
drivers/staging/lustre/lustre/include/obd_support.h +0 -52
@@ -551,48 +551,6 @@ __u64 obd_pages_max(void);#define OBD_ALLOC_FAIL_MASK ((1 << OBD_ALLOC_FAIL_BITS) - 1)#define OBD_ALLOC_FAIL_MULT (OBD_ALLOC_FAIL_MASK / 100) -#define OBD_FREE_RTN0 (ptr) \ -({ \ - kfree(ptr); \ - (ptr) = NULL; \ - 0; \ -}) - -#define __OBD_MALLOC_VERBOSE (ptr, cptab, cpt, size, flags) \ -do { \ - (ptr) = (cptab) == NULL ? \ - kmalloc(size, flags | __GFP_ZERO) : \ - kmalloc_node(size, flags | __GFP_ZERO, \ - cfs_cpt_spread_node(cptab, cpt)); \ - if (likely((ptr) != NULL && \ - (!HAS_FAIL_ALLOC_FLAG || obd_alloc_fail_rate == 0 || \ - !obd_alloc_fail(ptr, #ptr, "km", size, \ - __FILE__, __LINE__) || \ - OBD_FREE_RTN0(ptr)))) { \ - OBD_ALLOC_POST(ptr, size, "kmalloced"); \ - } \ -} while (0) - -#define OBD_ALLOC_GFP (ptr, size, gfp_mask) \ - __OBD_MALLOC_VERBOSE(ptr, NULL, 0, size, gfp_mask) - -#define OBD_ALLOC (ptr, size) OBD_ALLOC_GFP(ptr, size, GFP_NOFS) -#define OBD_ALLOC_WAIT (ptr, size) OBD_ALLOC_GFP(ptr, size, GFP_KERNEL) -#define OBD_ALLOC_PTR (ptr) OBD_ALLOC(ptr, sizeof(*(ptr))) -#define OBD_ALLOC_PTR_WAIT (ptr) OBD_ALLOC_WAIT(ptr, sizeof(*(ptr))) - -#define OBD_ALLOC_LARGE (ptr, size) \ -do { \ - ptr = libcfs_kvzalloc(size, GFP_NOFS); \ -} while (0) - -#define OBD_FREE_LARGE (ptr, size) \ -do { \ - (void)(size); \ - kvfree(ptr); \ -} while (0) - -#ifdef CONFIG_DEBUG_SLAB #define POISON (ptr, c, s) do {} while (0)#define POISON_PTR (ptr) ((void)0)
@@ -610,14 +568,6 @@ do { \#define POISON_PAGE (page, val) do { } while (0)#endif -#define OBD_FREE (ptr, size) \ -do { \ - OBD_FREE_PRE(ptr, size, "kfreed"); \ - kfree(ptr); \ - POISON_PTR(ptr); \ -} while (0) - -#define OBD_FREE_RCU (ptr, size, handle) \ do { \ struct portals_handle *__h = (handle); \
@@ -660,8 +610,6 @@ do { \#define OBD_SLAB_CPT_ALLOC_GFP (ptr, slab, cptab, cpt, size, flags) \ __OBD_SLAB_ALLOC_VERBOSE(ptr, slab, cptab, cpt, size, flags) -#define OBD_FREE_PTR (ptr) OBD_FREE(ptr, sizeof(*(ptr))) -#define OBD_SLAB_FREE (ptr, slab, size) \ do { \ OBD_FREE_PRE(ptr, size, "slab-freed"); \
Signature · 1 line
2.1.0
PATCH 14/19 staging/lustre: Remove memory allocation fault injection framework
In reply to [email protected]From: Oleg Drokin <[email protected]>
Lustre memory allocation wrappers also included a fault injection framework that's totally redundant, since in-kernel offering is actually superior to what we had.
So let's remove it.
--- drivers/staging/lustre/lustre/include/obd_support.h | 20 +------------------- drivers/staging/lustre/lustre/obdclass/class_obd.c | 21 --------------------- 2 files changed, 1 insertion(+), 40 deletions(-)
drivers/staging/lustre/lustre/include/obd_support.h +1 -19
@@ -66,13 +66,8 @@ extern unsigned int obd_sync_filter;extern unsigned int obd_max_dirty_pages;extern atomic_t obd_dirty_pages;extern atomic_t obd_dirty_transit_pages; -extern unsigned int obd_alloc_fail_rate;extern char obd_jobid_var[]; -/* lvfs.c */ -int obd_alloc_fail (const void *ptr,const char *name,const char *type, -size_t size,const char *file,int line); -/* Some hash init argument constants */ #define HASH_POOLS_BKT_BITS 3#define HASH_POOLS_CUR_BITS 3
@@ -428,8 +423,6 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type,#define OBD_FAIL_LPROC_REMOVE 0xB00 -#define OBD_FAIL_GENERAL_ALLOC 0xC00 -#define OBD_FAIL_SEQ 0x1000#define OBD_FAIL_SEQ_QUERY_NET 0x1001#define OBD_FAIL_SEQ_EXHAUST 0x1002
@@ -545,12 +538,6 @@ __u64 obd_pages_max(void);#endif /* !OBD_DEBUG_MEMUSAGE */ -#define HAS_FAIL_ALLOC_FLAG OBD_FAIL_CHECK(OBD_FAIL_GENERAL_ALLOC) - -#define OBD_ALLOC_FAIL_BITS 24 -#define OBD_ALLOC_FAIL_MASK ((1 << OBD_ALLOC_FAIL_BITS) - 1) -#define OBD_ALLOC_FAIL_MULT (OBD_ALLOC_FAIL_MASK / 100) -#ifdef CONFIG_DEBUG_SLAB #define POISON (ptr, c, s) do {} while (0)#define POISON_PTR (ptr) ((void)0)
@@ -596,13 +583,8 @@ do { \ kmem_cache_alloc(slab, type | __GFP_ZERO) : \kmem_cache_alloc_node (slab, type | __GFP_ZERO, \cfs_cpt_spread_node (cptab, cpt)); \ -if (likely ((ptr) !=NULL && \ - (!HAS_FAIL_ALLOC_FLAG || obd_alloc_fail_rate ==0 || \ - !obd_alloc_fail(ptr, #ptr, "slab-", size, \ - __FILE__, __LINE__) || \ -OBD_SLAB_FREE_RTN0 (ptr, slab)))) { \ +if (likely (ptr)) \OBD_ALLOC_POST (ptr, size,"slab-alloced" ); \ - } \ }while (0 ) #define OBD_SLAB_ALLOC_GFP(ptr, slab, size, flags) \
drivers/staging/lustre/lustre/obdclass/class_obd.c +0 -21
@@ -64,8 +64,6 @@ EXPORT_SYMBOL(obd_pages);static DEFINE_SPINLOCK (obd_updatemax_lock);/* The following are visible and mutable through /proc/sys/lustre/. */ -unsigned int obd_alloc_fail_rate; -EXPORT_SYMBOL (obd_alloc_fail_rate);unsigned int obd_debug_peer_on_timeout;EXPORT_SYMBOL (obd_debug_peer_on_timeout);unsigned int obd_dump_on_timeout;
@@ -132,25 +130,6 @@ int lustre_get_jobid(char *jobid) }EXPORT_SYMBOL (lustre_get_jobid); -int obd_alloc_fail (const void *ptr,const char *name,const char *type, -size_t size,const char *file,int line) -{ -if (ptr ==NULL || - (cfs_rand () &OBD_ALLOC_FAIL_MASK ) < obd_alloc_fail_rate) { -CERROR ("%s%salloc of %s (%llu bytes) failed at %s:%d\n" , - ptr ?"force " :"" , type, name, (__u64 )size, file, - line); -CERROR ("%llu total bytes and %llu total pages" -" (%llu bytes) allocated by Lustre\n" , -obd_memory_sum (), -obd_pages_sum () <<PAGE_CACHE_SHIFT , -obd_pages_sum ()); -return 1 ; - } -return 0 ; -} -EXPORT_SYMBOL (obd_alloc_fail); -static inline void obd_data2conn (struct lustre_handle *conn,struct obd_ioctl_data *data) {
Signature · 1 line
2.1.0
PATCH 15/19 staging/lustre: Remove lustre used memory tracking framework
In reply to [email protected]From: Oleg Drokin <[email protected]>
Lustre memory allocation framework has a feature to track amount of allocated memory, but since it's not being used consistently anymore and is on the way out in general, just remove it.
--- .../staging/lustre/lustre/include/obd_support.h | 60 +------------------- drivers/staging/lustre/lustre/obdclass/class_obd.c | 64 ---------------------- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 2 - 3 files changed, 1 insertion(+), 125 deletions(-)
drivers/staging/lustre/lustre/include/obd_support.h +1 -59
@@ -494,50 +494,6 @@ extern char obd_jobid_var[];#define OBD_FAIL_ONCE CFS_FAIL_ONCE#define OBD_FAILED CFS_FAILED -void obd_update_maxusage (void ); - -#define obd_memory_add (size) \ - lprocfs_counter_add(obd_memory, OBD_MEMORY_STAT, (long)(size)) -#define obd_memory_sub (size) \ - lprocfs_counter_sub(obd_memory, OBD_MEMORY_STAT, (long)(size)) -#define obd_memory_sum () \ - lprocfs_stats_collector(obd_memory, OBD_MEMORY_STAT, \ - LPROCFS_FIELDS_FLAGS_SUM) -#define obd_pages_add (order) \ - lprocfs_counter_add(obd_memory, OBD_MEMORY_PAGES_STAT, \ - (long)(1 << (order))) -#define obd_pages_sub (order) \ - lprocfs_counter_sub(obd_memory, OBD_MEMORY_PAGES_STAT, \ - (long)(1 << (order))) -#define obd_pages_sum () \ - lprocfs_stats_collector(obd_memory, OBD_MEMORY_PAGES_STAT, \ - LPROCFS_FIELDS_FLAGS_SUM) - -__u64 obd_memory_max (void ); -__u64 obd_pages_max (void ); - -#define OBD_DEBUG_MEMUSAGE (1) - -#if OBD_DEBUG_MEMUSAGE -#define OBD_ALLOC_POST (ptr, size, name) \ - obd_memory_add(size); \ - CDEBUG(D_MALLOC, name " '" #ptr "': %d at %p.\n", \ - (int)(size), ptr) - -#define OBD_FREE_PRE (ptr, size, name) \ - LASSERT(ptr); \ - obd_memory_sub(size); \ - CDEBUG(D_MALLOC, name " '" #ptr "': %d at %p.\n", \ - (int)(size), ptr); \ - POISON(ptr, 0x5a, size) - -#else /* !OBD_DEBUG_MEMUSAGE */ - -#define OBD_ALLOC_POST (ptr, size, name) ((void)0) -#define OBD_FREE_PRE (ptr, size, name) ((void)0) - -#endif /* !OBD_DEBUG_MEMUSAGE */ -#ifdef CONFIG_DEBUG_SLAB #define POISON (ptr, c, s) do {} while (0)#define POISON_PTR (ptr) ((void)0)
@@ -583,8 +539,6 @@ do { \ kmem_cache_alloc(slab, type | __GFP_ZERO) : \kmem_cache_alloc_node (slab, type | __GFP_ZERO, \cfs_cpt_spread_node (cptab, cpt)); \ -if (likely (ptr)) \ -OBD_ALLOC_POST (ptr, size,"slab-alloced" ); \ }while (0 ) #define OBD_SLAB_ALLOC_GFP(ptr, slab, size, flags) \
@@ -594,7 +548,6 @@ do { \#define OBD_SLAB_FREE (ptr, slab, size) \ do { \ - OBD_FREE_PRE(ptr, size, "slab-freed"); \ kmem_cache_free(slab, ptr); \ POISON_PTR(ptr); \ } while (0)
@@ -629,17 +582,7 @@ do { \ (ptr) = (cptab) ==NULL ? \alloc_page (gfp_mask) : \alloc_pages_node (cfs_cpt_spread_node (cptab, cpt), gfp_mask,0 );\ -if (unlikely ((ptr) ==NULL )) { \ - CERROR("alloc_pages of '" #ptr "' %d page(s) / %llu bytes "\ - "failed\n", (int)1, \ - (__u64)(1 << PAGE_CACHE_SHIFT)); \ - CERROR("%llu total bytes and %llu total pages " \ - "(%llu bytes) allocated by Lustre\n", \ - obd_memory_sum(), \ - obd_pages_sum() << PAGE_CACHE_SHIFT, \ - obd_pages_sum()); \ - } else { \ - obd_pages_add(0); \ +if (ptr) { \ CDEBUG(D_MALLOC, "alloc_pages '" #ptr "': %d page(s) / " \ "%llu bytes at %p.\n", \ (int)1, \
@@ -655,7 +598,6 @@ do { \#define OBD_PAGE_FREE (ptr) \ do { \ LASSERT(ptr); \ - obd_pages_sub(0); \ CDEBUG(D_MALLOC, "free_pages '" #ptr "': %d page(s) / %llu bytes " \ "at %p.\n", \ (int)1, (__u64)(1 << PAGE_CACHE_SHIFT), \
drivers/staging/lustre/lustre/obdclass/class_obd.c +0 -64
89 lines not on this page · raw message
drivers/staging/lustre/lustre/ptlrpc/pinger.c +0 -2
@@ -266,8 +266,6 @@ static int ptlrpc_pinger_main(void *arg)ptlrpc_update_next_ping (imp,0 ); }mutex_unlock (&pinger_mutex); -/* update memory usage info */ -obd_update_maxusage ();/* Wait until the next ping time, or until we're stopped. */ time_to_next_wake =pinger_check_timeout (this_ping);
Signature · 1 line
2.1.0
PATCH 16/19 staging/lustre: remove obd_memory stats counter
In reply to [email protected]From: Oleg Drokin <[email protected]>
Now that we no longer track allocated memory, remove obd_memory statistics counter and all references to it everywhere
--- drivers/staging/lustre/lustre/include/obd_support.h | 7 ------- drivers/staging/lustre/lustre/obdclass/class_obd.c | 18 ------------------ .../staging/lustre/lustre/obdclass/lprocfs_counters.c | 9 --------- .../staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +- 4 files changed, 1 insertion(+), 35 deletions(-)
drivers/staging/lustre/lustre/include/obd_support.h +0 -7
@@ -43,13 +43,6 @@#include "lprocfs_status.h" /* global variables */ -extern struct lprocfs_stats *obd_memory; -enum { -OBD_MEMORY_STAT =0 , -OBD_MEMORY_PAGES_STAT =1 , -OBD_STATS_NUM , -}; -extern unsigned int obd_debug_peer_on_timeout;extern unsigned int obd_dump_on_timeout;extern unsigned int obd_dump_on_eviction;
drivers/staging/lustre/lustre/obdclass/class_obd.c +0 -18
@@ -487,22 +487,6 @@ static int __init init_obdclass(void)spin_lock_init (&obd_types_lock);obd_zombie_impexp_init (); - obd_memory =lprocfs_alloc_stats (OBD_STATS_NUM , -LPROCFS_STATS_FLAG_NONE | -LPROCFS_STATS_FLAG_IRQ_SAFE ); - -if (obd_memory ==NULL ) { -CERROR ("kmalloc of 'obd_memory' failed\n" ); -return -ENOMEM ; - } - -lprocfs_counter_init (obd_memory,OBD_MEMORY_STAT , -LPROCFS_CNTR_AVGMINMAX , -"memused" ,"bytes" ); -lprocfs_counter_init (obd_memory,OBD_MEMORY_PAGES_STAT , -LPROCFS_CNTR_AVGMINMAX , -"pagesused" ,"pages" ); - err =obd_init_checks ();if (err == -EOVERFLOW )return err;
@@ -592,8 +576,6 @@ static void cleanup_obdclass(void)class_handle_cleanup ();class_exit_uuidlist ();obd_zombie_impexp_stop (); - -lprocfs_free_stats (&obd_memory); }MODULE_AUTHOR ("Sun Microsystems, Inc. <http://www.lustre.org/>" );
drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c +0 -9
@@ -41,9 +41,6 @@#include "../include/lprocfs_status.h" #include "../include/obd_support.h" -struct lprocfs_stats *obd_memory; -EXPORT_SYMBOL (obd_memory); -void lprocfs_counter_add (struct lprocfs_stats *stats,int idx,long amount) {struct lprocfs_counter *percpu_cntr;
@@ -74,9 +71,6 @@ void lprocfs_counter_add(struct lprocfs_stats *stats, int idx, long amount)* ldlm_pool_shrink(), which calls lprocfs_counter_add(). * LU-1727. * -* Only obd_memory uses LPROCFS_STATS_FLAG_IRQ_SAFE -* flag, because it needs accurate counting lest memory leak -* check reports error. */ if (in_interrupt () && (stats->ls_flags &LPROCFS_STATS_FLAG_IRQ_SAFE ) !=0 )
@@ -124,9 +118,6 @@ void lprocfs_counter_sub(struct lprocfs_stats *stats, int idx, long amount)* softirq context here, use separate counter for that. * bz20650. * -* Only obd_memory uses LPROCFS_STATS_FLAG_IRQ_SAFE -* flag, because it needs accurate counting lest memory leak -* check reports error. */ if (in_interrupt () && (stats->ls_flags &LPROCFS_STATS_FLAG_IRQ_SAFE ) !=0 )
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +1 -1
@@ -1082,7 +1082,7 @@ struct lprocfs_stats *lprocfs_alloc_stats(unsigned int num, goto fail; stats->ls_biggest_alloc_num =1 ; }else if ((flags &LPROCFS_STATS_FLAG_IRQ_SAFE ) !=0 ) { -/* alloc all percpu data, currently only obd_memory use this */ +/* alloc all percpu data */ for (i =0 ; i < num_entry; ++i)if (lprocfs_stats_alloc_one (stats, i) <0 ) goto fail;
Signature · 1 line
2.1.0
PATCH 17/19 staging/lustre: Remove IS_SERVER and all users
In reply to [email protected]From: Oleg Drokin <[email protected]>
Since the client can never be server, this is all dead code.
--- .../staging/lustre/lustre/include/lustre_disk.h | 2 - drivers/staging/lustre/lustre/mgc/mgc_request.c | 37 ++-------- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 85 ++++------------------ 3 files changed, 20 insertions(+), 104 deletions(-)
drivers/staging/lustre/lustre/include/lustre_disk.h +0 -2
@@ -180,8 +180,6 @@ struct lustre_disk_data {#define IS_MDT (data) ((data)->lsi_flags & LDD_F_SV_TYPE_MDT)#define IS_OST (data) ((data)->lsi_flags & LDD_F_SV_TYPE_OST)#define IS_MGS (data) ((data)->lsi_flags & LDD_F_SV_TYPE_MGS) -#define IS_SERVER (data) ((data)->lsi_flags & (LDD_F_SV_TYPE_MGS | \ - LDD_F_SV_TYPE_MDT | LDD_F_SV_TYPE_OST))#define MT_STR (data) mt_str((data)->ldd_mount_type)/* Make the mdt/ost server obd name based on the filesystem name */
drivers/staging/lustre/lustre/mgc/mgc_request.c +6 -31
@@ -248,7 +248,6 @@ static struct config_llog_data *config_recover_log_add(struct obd_device *obd, struct super_block *sb) {struct config_llog_instance lcfg = *cfg; -struct lustre_sb_info *lsi =s2lsi (sb);struct config_llog_data *cld;char logname[32 ];
@@ -263,14 +262,8 @@ static struct config_llog_data *config_recover_log_add(struct obd_device *obd,* where only clients are notified if one of cmd server restarts */ LASSERT (strlen (fsname) <sizeof (logname) /2 );strcpy (logname, fsname); -if (IS_SERVER (lsi)) {/* mdt */ -LASSERT (lcfg.cfg_instance ==NULL ); - lcfg.cfg_instance = sb; -strcat (logname,"-mdtir" ); - }else { -LASSERT (lcfg.cfg_instance !=NULL ); -strcat (logname,"-cliir" ); - } +LASSERT (lcfg.cfg_instance); +strcat (logname,"-cliir" ); cld =do_config_log_add (obd, logname,CONFIG_T_RECOVER , &lcfg, sb);return cld;
@@ -899,12 +892,6 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm,req_capsule_set_size (&req->rq_pill, &RMF_DLM_LVB ,RCL_SERVER ,0 );ptlrpc_request_set_replen (req); -/* check if this is server or client */ -if (cld->cld_cfg.cfg_sb) { -struct lustre_sb_info *lsi =s2lsi (cld->cld_cfg.cfg_sb); -if (lsi &&IS_SERVER (lsi)) - short_limit =1 ; - }/* Limit how long we will wait for the enqueue to complete */ req->rq_delay_limit = short_limit ?5 :MGC_ENQUEUE_LIMIT ; rc = ldlm_cli_enqueue(exp, &req, &einfo, &cld->cld_resid, NULL, flags,
@@ -1112,7 +1099,6 @@ static int mgc_apply_recover_logs(struct obd_device *mgc, void *data, int datalen, bool mne_swab) { struct config_llog_instance *cfg = &cld->cld_cfg; -struct lustre_sb_info *lsi =s2lsi (cfg->cfg_sb);struct mgs_nidtbl_entry *entry;struct lustre_cfg *lcfg;struct lustre_cfg_bufs bufs;
@@ -1131,21 +1117,10 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,if (!inst)return -ENOMEM ; -if (!IS_SERVER (lsi)) { - pos =snprintf (inst,PAGE_CACHE_SIZE ,"%p" , cfg->cfg_instance); -if (pos >=PAGE_CACHE_SIZE ) { -kfree (inst); -return -E2BIG ; - } - }else { -LASSERT (IS_MDT (lsi)); - rc =server_name2svname (lsi->lsi_svname, inst,NULL , -PAGE_CACHE_SIZE ); -if (rc) { -kfree (inst); -return -EINVAL ; - } - pos =strlen (inst); + pos =snprintf (inst,PAGE_CACHE_SIZE ,"%p" , cfg->cfg_instance); +if (pos >=PAGE_CACHE_SIZE ) { +kfree (inst); +return -E2BIG ; } ++pos;
drivers/staging/lustre/lustre/obdclass/obd_mount.c +14 -71
109 lines not on this page · raw message
Signature · 1 line
2.1.0
Re: [PATCH 17/19] staging/lustre: Remove IS_SERVER and all users
Quoted 6 lines · On Tue, Sep 15, 2015 at 08:30:41PM -0400, [email protected] wrote:
From: Oleg Drokin <[email protected]>
Since the client can never be server, this is all dead code.
Signed-off-by Oleg Drokin <[email protected]>---
OOPS.. build fails with error:
error: ‘lsi’ undeclared (first use in this function)
reegards
sudip
Re: [PATCH 17/19] staging/lustre: Remove IS_SERVER and all users
Quoted 9 lines · Sudip Mukherjee
Quoted 6 lines · On Tue, Sep 15, 2015 at 08:30:41PM -0400, [email protected] wrote:
From: Oleg Drokin <[email protected]>
Since the client can never be server, this is all dead code.
Signed-off-by Oleg Drokin <[email protected]>---
OOPS.. build fails with error:
error: ‘lsi’ undeclared (first use in this function)
Ah, you are right.
Fused the fix in the frong commit. :(
Thanks, I'll resend.
Bye,
Oleg
PATCH 18/19 staging/lustre: remove IS_MDS|IS_OST|IS_MGS defines and users
In reply to [email protected]From: Oleg Drokin <[email protected]>
These could only happen on the server, so they make no sense on the client.
--- drivers/staging/lustre/lustre/include/lustre_disk.h | 3 --- drivers/staging/lustre/lustre/mgc/mgc_request.c | 7 ------- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 6 ------ 3 files changed, 16 deletions(-)
drivers/staging/lustre/lustre/include/lustre_disk.h +0 -3
@@ -177,9 +177,6 @@ struct lustre_disk_data { }; -#define IS_MDT (data) ((data)->lsi_flags & LDD_F_SV_TYPE_MDT) -#define IS_OST (data) ((data)->lsi_flags & LDD_F_SV_TYPE_OST) -#define IS_MGS (data) ((data)->lsi_flags & LDD_F_SV_TYPE_MGS)#define MT_STR (data) mt_str((data)->ldd_mount_type)/* Make the mdt/ost server obd name based on the filesystem name */
drivers/staging/lustre/lustre/mgc/mgc_request.c +0 -7
@@ -251,13 +251,6 @@ static struct config_llog_data *config_recover_log_add(struct obd_device *obd,struct config_llog_data *cld;char logname[32 ]; -if (IS_OST (lsi)) -return NULL ; - -/* for osp-on-ost, see lustre_start_osp() */ -if (IS_MDT (lsi) && lcfg.cfg_instance) -return NULL ; -/* we have to use different llog for clients and mdts for cmd * where only clients are notified if one of cmd server restarts */ LASSERT (strlen (fsname) <sizeof (logname) /2 );
drivers/staging/lustre/lustre/obdclass/obd_mount.c +0 -6
@@ -281,12 +281,6 @@ int lustre_start_mgc(struct super_block *sb) } recov_bk =0 ; -/* If we are restarting the MGS, don't try to keep the MGC's -old connection, or registration will fail. */ -if (IS_MGS (lsi)) { -CDEBUG (D_MOUNT ,"New MGS with live MGC\n" ); - recov_bk =1 ; - }/* Try all connections, but only once (again). We don't want to block another target from starting
Signature · 1 line
2.1.0
PATCH 19/19 staging/lustre: Remove server defines from lustre_disk.h
In reply to [email protected]From: Oleg Drokin <[email protected]>
Take initial stab at removing server-disk related defines that client does not need.
--- .../staging/lustre/lustre/include/lustre_disk.h | 137 --------------------- .../staging/lustre/lustre/obdclass/llog_internal.h | 8 -- 2 files changed, 145 deletions(-)
drivers/staging/lustre/lustre/include/lustre_disk.h +0 -137
@@ -52,24 +52,6 @@#include "../../include/linux/lnet/types.h" #include <linux/backing-dev.h> -/****************** on-disk files *********************/ - -#define MDT_LOGS_DIR "LOGS"/* COMPAT_146 */ -#define MOUNT_CONFIGS_DIR "CONFIGS" -#define CONFIGS_FILE "mountdata" -/** Persistent mount data are stored on the disk in this file. */ -#define MOUNT_DATA_FILE MOUNT_CONFIGS_DIR"/"CONFIGS_FILE -#define LAST_RCVD "last_rcvd" -#define LOV_OBJID "lov_objid" -#define LOV_OBJSEQ "lov_objseq" -#define HEALTH_CHECK "health_check" -#define CAPA_KEYS "capa_keys" -#define CHANGELOG_USERS "changelog_users" -#define MGS_NIDTBL_DIR "NIDTBL_VERSIONS" -#define QMT_DIR "quota_master" -#define QSD_DIR "quota_slave" -#define HSM_ACTIONS "hsm_actions" -/****************** persistent mount data *********************/ #define LDD_F_SV_TYPE_MDT 0x0001
@@ -79,125 +61,6 @@ LDD_F_SV_TYPE_OST | \ LDD_F_SV_TYPE_MGS)#define LDD_F_SV_ALL 0x0008 -/** need an index assignment */ -#define LDD_F_NEED_INDEX 0x0010 -/** never registered */ -#define LDD_F_VIRGIN 0x0020 -/** update the config logs for this server */ -#define LDD_F_UPDATE 0x0040 -/** rewrite the LDD */ -#define LDD_F_REWRITE_LDD 0x0080 -/** regenerate config logs for this fs or server */ -#define LDD_F_WRITECONF 0x0100 -/** COMPAT_14 */ -#define LDD_F_UPGRADE14 0x0200 -/** process as lctl conf_param */ -#define LDD_F_PARAM 0x0400 -/** all nodes are specified as service nodes */ -#define LDD_F_NO_PRIMNODE 0x1000 -/** IR enable flag */ -#define LDD_F_IR_CAPABLE 0x2000 -/** the MGS refused to register the target. */ -#define LDD_F_ERROR 0x4000 -/** process at lctl conf_param */ -#define LDD_F_PARAM2 0x8000 - -/* opc for target register */ -#define LDD_F_OPC_REG 0x10000000 -#define LDD_F_OPC_UNREG 0x20000000 -#define LDD_F_OPC_READY 0x40000000 -#define LDD_F_OPC_MASK 0xf0000000 - -#define LDD_F_ONDISK_MASK (LDD_F_SV_TYPE_MASK) - -#define LDD_F_MASK 0xFFFF - -enum ldd_mount_type { -LDD_MT_EXT3 =0 , -LDD_MT_LDISKFS , -LDD_MT_SMFS , -LDD_MT_REISERFS , -LDD_MT_LDISKFS2 , -LDD_MT_ZFS , -LDD_MT_LAST -}; - -static inline char *mt_str (enum ldd_mount_type mt) -{ -static char *mount_type_string[] = { -"ext3" , -"ldiskfs" , -"smfs" , -"reiserfs" , -"ldiskfs2" , -"zfs" , - }; -return mount_type_string[mt]; -} - -static inline char *mt_type (enum ldd_mount_type mt) -{ -static char *mount_type_string[] = { -"osd-ldiskfs" , -"osd-ldiskfs" , -"osd-smfs" , -"osd-reiserfs" , -"osd-ldiskfs" , -"osd-zfs" , - }; -return mount_type_string[mt]; -} - -#define LDD_INCOMPAT_SUPP 0 -#define LDD_ROCOMPAT_SUPP 0 - -#define LDD_MAGIC 0x1dd00001 - -/* On-disk configuration file. In host-endian order. */ -struct lustre_disk_data { -__u32 ldd_magic; -__u32 ldd_feature_compat;/* compatible feature flags */ -__u32 ldd_feature_rocompat;/* read-only compatible feature flags */ -__u32 ldd_feature_incompat;/* incompatible feature flags */ - -__u32 ldd_config_ver;/* config rewrite count - not used */ -__u32 ldd_flags;/* LDD_SV_TYPE */ -__u32 ldd_svindex;/* server index (0001), must match -svname */ -__u32 ldd_mount_type;/* target fs type LDD_MT_* */ -char ldd_fsname[64 ];/* filesystem this server is part of, -MTI_NAME_MAXLEN */ -char ldd_svname[64 ];/* this server's name (lustre-mdt0001)*/ -__u8 ldd_uuid[40 ];/* server UUID (COMPAT_146) */ - -/*200*/ char ldd_userdata[1024 -200 ];/* arbitrary user string */ -/*1024*/ __u8 ldd_padding[4096 -1024 ]; -/*4096*/ char ldd_mount_opts[4096 ];/* target fs mount opts */ -/*8192*/ char ldd_params[4096 ];/* key=value pairs */ -}; - - -#define MT_STR (data) mt_str((data)->ldd_mount_type) - -/* Make the mdt/ost server obd name based on the filesystem name */ -static inline int server_make_name (__u32 flags,__u16 index,char *fs, -char *name) -{ -if (flags & (LDD_F_SV_TYPE_MDT |LDD_F_SV_TYPE_OST )) { -if (!(flags &LDD_F_SV_ALL )) -sprintf (name,"%.8s%c%s%04x" , fs, - (flags &LDD_F_VIRGIN ) ?':' : - ((flags &LDD_F_WRITECONF ) ?'=' :'-' ), - (flags &LDD_F_SV_TYPE_MDT ) ?"MDT" :"OST" , - index); - }else if (flags &LDD_F_SV_TYPE_MGS ) { -sprintf (name,"MGS" ); - }else { -CERROR ("unknown server type %#x\n" , flags); -return 1 ; - } -return 0 ; -}/****************** mount command *********************/
drivers/staging/lustre/lustre/obdclass/llog_internal.h +0 -8
@@ -71,14 +71,6 @@ static inline struct llog_thread_info *llog_info(const struct lu_env *env)return lgi; } -static inline void -lustre_build_llog_lvfs_oid (struct llog_logid *logid,__u64 ino,__u32 gen) -{ -ostid_set_seq_llog (&logid->lgl_oi); -ostid_set_id (&logid->lgl_oi, ino); - logid->lgl_ogen = gen; -} -int llog_info_init (void );void llog_info_fini (void );
Signature · 1 line
2.1.0