From 5351a1ba03e3464f26271216cd266d2cb77b5625 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Mon, 16 May 2011 00:07:54 -0600 Subject: [PATCH] LU-113: make lustre_{idl,user}.h nice to userspace Remove uses of LASSERT() inside lustre_user.h, since it should be directly usable by userspace (e.g. lfsck). Don't include into lustre_idl.h if the needed helper macros are already availables, so that lustre_idl.h can be more userspace friendly. Change-Id: I4da00758ec8625f3040f5dc0d78c423a9f59793d Signed-off-by: Andreas Dilger Reviewed-on: http://review.whamcloud.com/909 Tested-by: Hudson Reviewed-by: Yu Jian Tested-by: Maloo Reviewed-by: Brian J. Murrell Reviewed-by: Oleg Drokin --- lustre/include/lustre/lustre_idl.h | 2 ++ lustre/include/lustre/lustre_user.h | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index 54e915c..709204c 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -91,7 +91,9 @@ #ifndef _LUSTRE_IDL_H_ #define _LUSTRE_IDL_H_ +#if !defined(LASSERT) && !defined(LPU64) #include /* for LASSERT, LPUX64, etc */ +#endif /* Defn's shared with user-space. */ #include diff --git a/lustre/include/lustre/lustre_user.h b/lustre/include/lustre/lustre_user.h index b127ead..736254b 100644 --- a/lustre/include/lustre/lustre_user.h +++ b/lustre/include/lustre/lustre_user.h @@ -797,8 +797,6 @@ static inline char *hai_dump_data_field(struct hsm_action_item *hai, int i, sz, data_len; char *ptr; - LASSERT(len > 0); - ptr = buffer; sz = len; data_len = hai->hai_len - sizeof(*hai); @@ -857,7 +855,6 @@ static inline int hal_size(struct hsm_action_list *hal) int i, sz; struct hsm_action_item *hai; - LASSERT(hal->hal_version == HAL_VERSION); sz = sizeof(*hal) + cfs_size_round(strlen(hal->hal_fsname)); hai = hai_zero(hal); for (i = 0 ; i < hal->hal_count ; i++) { -- 1.8.3.1