From: Andreas Dilger Date: Mon, 16 May 2011 06:07:54 +0000 (-0600) Subject: LU-113: make lustre_{idl,user}.h nice to userspace X-Git-Tag: 2.0.66.0~19 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=5351a1ba03e3464f26271216cd266d2cb77b5625 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 --- 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++) {