Whamcloud - gitweb
LU-113: make lustre_{idl,user}.h nice to userspace
authorAndreas Dilger <adilger@whamcloud.com>
Mon, 16 May 2011 06:07:54 +0000 (00:07 -0600)
committerOleg Drokin <green@whamcloud.com>
Thu, 14 Jul 2011 23:51:23 +0000 (16:51 -0700)
Remove uses of LASSERT() inside lustre_user.h, since it should be
directly usable by userspace (e.g. lfsck).

Don't include <libcfs/libcfs.h> 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 <adilger@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/909
Tested-by: Hudson
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Brian J. Murrell <brian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre/lustre_idl.h
lustre/include/lustre/lustre_user.h

index 54e915c..709204c 100644 (file)
@@ -91,7 +91,9 @@
 #ifndef _LUSTRE_IDL_H_
 #define _LUSTRE_IDL_H_
 
 #ifndef _LUSTRE_IDL_H_
 #define _LUSTRE_IDL_H_
 
+#if !defined(LASSERT) && !defined(LPU64)
 #include <libcfs/libcfs.h> /* for LASSERT, LPUX64, etc */
 #include <libcfs/libcfs.h> /* for LASSERT, LPUX64, etc */
+#endif
 
 /* Defn's shared with user-space. */
 #include <lustre/lustre_user.h>
 
 /* Defn's shared with user-space. */
 #include <lustre/lustre_user.h>
index b127ead..736254b 100644 (file)
@@ -797,8 +797,6 @@ static inline char *hai_dump_data_field(struct hsm_action_item *hai,
         int i, sz, data_len;
         char *ptr;
 
         int i, sz, data_len;
         char *ptr;
 
-        LASSERT(len > 0);
-
         ptr = buffer;
         sz = len;
         data_len = hai->hai_len - sizeof(*hai);
         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;
 
         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++) {
         sz = sizeof(*hal) + cfs_size_round(strlen(hal->hal_fsname));
         hai = hai_zero(hal);
         for (i = 0 ; i < hal->hal_count ; i++) {