From: Andreas Dilger Date: Tue, 14 Dec 2010 06:54:49 +0000 (-0700) Subject: b=23072 avoid duplicate cfs_size_round declarations X-Git-Tag: 2.0.59.0~6 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=0a6e5c9a3060d0145e516f40457a26bd2a3c25db b=23072 avoid duplicate cfs_size_round declarations Use HAVE_CFS_SIZE_ROUND to determine if libcfs_private.h or lustre_user.h has declared the cfs_size_round() helper function. This avoids conflicts if both of these headers are included in different orders. --- diff --git a/libcfs/include/libcfs/libcfs_private.h b/libcfs/include/libcfs/libcfs_private.h index 92f9854..9e33e26 100644 --- a/libcfs/include/libcfs/libcfs_private.h +++ b/libcfs/include/libcfs/libcfs_private.h @@ -469,10 +469,13 @@ static inline int cfs_size_round4 (int val) return (val + 3) & (~0x3); } +#ifndef HAVE_CFS_SIZE_ROUND static inline int cfs_size_round (int val) { return (val + 7) & (~0x7); } +#define HAVE_CFS_SIZE_ROUND +#endif static inline int cfs_size_round16(int val) { diff --git a/lustre/include/lustre/lustre_user.h b/lustre/include/lustre/lustre_user.h index 4ea95a9..14dff87 100644 --- a/lustre/include/lustre/lustre_user.h +++ b/lustre/include/lustre/lustre_user.h @@ -828,22 +828,30 @@ struct hsm_action_list { boundaries. See hai_zero */ } __attribute__((packed)); +#ifndef HAVE_CFS_SIZE_ROUND +static inline int cfs_size_round (int val) +{ + return (val + 7) & (~0x7); +} +#define HAVE_CFS_SIZE_ROUND +#endif + /* Return pointer to first hai in action list */ -static __inline__ struct hsm_action_item * hai_zero(struct hsm_action_list *hal) +static inline struct hsm_action_item * hai_zero(struct hsm_action_list *hal) { return (struct hsm_action_item *)(hal->hal_fsname + cfs_size_round(strlen(hal-> \ hal_fsname))); } /* Return pointer to next hai */ -static __inline__ struct hsm_action_item * hai_next(struct hsm_action_item *hai) +static inline struct hsm_action_item * hai_next(struct hsm_action_item *hai) { return (struct hsm_action_item *)((char *)hai + cfs_size_round(hai->hai_len)); } /* Return size of an hsm_action_list */ -static __inline__ int hal_size(struct hsm_action_list *hal) +static inline int hal_size(struct hsm_action_list *hal) { int i, sz; struct hsm_action_item *hai;