From a393fd545fa2f800dc51cc8cd1a1538808ee5d20 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 11 Jul 2014 22:47:02 -0700 Subject: [PATCH] staging: lustre: libcfs: include: minor whitespace fixes Found by the checkpatch.pl tool Signed-off-by: Greg Kroah-Hartman --- .../lustre/include/linux/libcfs/curproc.h | 2 +- .../lustre/include/linux/libcfs/libcfs.h | 6 +-- .../include/linux/libcfs/libcfs_debug.h | 8 ++-- .../lustre/include/linux/libcfs/libcfs_fail.h | 2 + .../lustre/include/linux/libcfs/libcfs_hash.h | 18 ++++----- .../include/linux/libcfs/libcfs_ioctl.h | 33 +++++++-------- .../include/linux/libcfs/libcfs_kernelcomm.h | 17 ++++---- .../include/linux/libcfs/libcfs_private.h | 40 ++++++++----------- .../lustre/include/linux/libcfs/libcfs_time.h | 5 +-- .../lustre/include/linux/libcfs/linux/kp30.h | 1 - .../include/linux/libcfs/linux/libcfs.h | 9 ++--- .../include/linux/libcfs/linux/linux-cpu.h | 1 - .../include/linux/libcfs/linux/linux-lock.h | 8 ---- .../include/linux/libcfs/linux/linux-mem.h | 3 +- .../include/linux/libcfs/linux/linux-prim.h | 1 - .../include/linux/libcfs/linux/linux-tcpip.h | 1 - .../include/linux/libcfs/linux/linux-time.h | 6 +-- .../linux/libcfs/linux/portals_compat25.h | 4 +- .../lustre/include/linux/libcfs/lucache.h | 10 ++--- .../lustre/include/linux/libcfs/params_tree.h | 20 +++++----- 20 files changed, 82 insertions(+), 113 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/curproc.h b/drivers/staging/lustre/include/linux/libcfs/curproc.h index b314f34d2e68..1edfca58c1c6 100644 --- a/drivers/staging/lustre/include/linux/libcfs/curproc.h +++ b/drivers/staging/lustre/include/linux/libcfs/curproc.h @@ -73,7 +73,7 @@ typedef __u32 cfs_cap_t; (1 << CFS_CAP_DAC_OVERRIDE) | \ (1 << CFS_CAP_DAC_READ_SEARCH) | \ (1 << CFS_CAP_FOWNER) | \ - (1 << CFS_CAP_FSETID ) | \ + (1 << CFS_CAP_FSETID) | \ (1 << CFS_CAP_LINUX_IMMUTABLE) | \ (1 << CFS_CAP_SYS_ADMIN) | \ (1 << CFS_CAP_SYS_BOOT) | \ diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h index a8b84ff4ee06..42e453cbd1d4 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h @@ -47,15 +47,15 @@ #include "curproc.h" #ifndef offsetof -# define offsetof(typ,memb) ((long)(long_ptr_t)((char *)&(((typ *)0)->memb))) +# define offsetof(typ, memb) ((long)(long_ptr_t)((char *)&(((typ *)0)->memb))) #endif #ifndef ARRAY_SIZE -#define ARRAY_SIZE(a) ((sizeof (a)) / (sizeof ((a)[0]))) +#define ARRAY_SIZE(a) ((sizeof(a)) / (sizeof((a)[0]))) #endif #if !defined(swap) -#define swap(x,y) do { typeof(x) z = x; x = y; y = z; } while (0) +#define swap(x, y) do { typeof(x) z = x; x = y; y = z; } while (0) #endif #if !defined(container_of) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h index b270d84def98..b43c9ad8fd15 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h @@ -254,19 +254,19 @@ do { \ goto label; \ } while (0) -extern int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata, +int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata, const char *format1, ...) __attribute__ ((format (printf, 2, 3))); -extern int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata, +int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata, const char *format1, va_list args, const char *format2, ...) __attribute__ ((format (printf, 4, 5))); /* other external symbols that tracefile provides: */ -extern int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob, +int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob, const char *usr_buffer, int usr_buffer_nob); -extern int cfs_trace_copyout_string(char *usr_buffer, int usr_buffer_nob, +int cfs_trace_copyout_string(char *usr_buffer, int usr_buffer_nob, const char *knl_buffer, char *append); #define LIBCFS_DEBUG_FILE_PATH_DEFAULT "/tmp/lustre-log" diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h index 8393c2703ce6..1934ec20e536 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h @@ -153,6 +153,7 @@ static inline void cfs_race(__u32 id) if (CFS_FAIL_PRECHECK(id)) { if (unlikely(__cfs_fail_check_set(id, 0, CFS_FAIL_LOC_NOSET))) { int rc; + cfs_race_state = 0; CERROR("cfs_race id %x sleeping\n", id); cfs_wait_event_interruptible(cfs_race_waitq, @@ -165,6 +166,7 @@ static inline void cfs_race(__u32 id) } } } + #define CFS_RACE(id) cfs_race(id) #endif /* _LIBCFS_FAIL_H */ diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h index 954164361ca4..375586bf7312 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h @@ -628,21 +628,21 @@ static inline int cfs_hash_bd_dec_and_lock(struct cfs_hash *hs, struct cfs_hash_ } static inline struct hlist_head *cfs_hash_bd_hhead(struct cfs_hash *hs, - struct cfs_hash_bd *bd) + struct cfs_hash_bd *bd) { return hs->hs_hops->hop_hhead(hs, bd); } struct hlist_node *cfs_hash_bd_lookup_locked(struct cfs_hash *hs, - struct cfs_hash_bd *bd, const void *key); + struct cfs_hash_bd *bd, const void *key); struct hlist_node *cfs_hash_bd_peek_locked(struct cfs_hash *hs, - struct cfs_hash_bd *bd, const void *key); + struct cfs_hash_bd *bd, const void *key); struct hlist_node *cfs_hash_bd_findadd_locked(struct cfs_hash *hs, - struct cfs_hash_bd *bd, const void *key, + struct cfs_hash_bd *bd, const void *key, struct hlist_node *hnode, int insist_add); struct hlist_node *cfs_hash_bd_finddel_locked(struct cfs_hash *hs, - struct cfs_hash_bd *bd, const void *key, + struct cfs_hash_bd *bd, const void *key, struct hlist_node *hnode); /** @@ -661,21 +661,21 @@ static inline void cfs_hash_dual_bd_get_and_lock(struct cfs_hash *hs, const void } struct hlist_node *cfs_hash_dual_bd_lookup_locked(struct cfs_hash *hs, - struct cfs_hash_bd *bds, + struct cfs_hash_bd *bds, const void *key); struct hlist_node *cfs_hash_dual_bd_findadd_locked(struct cfs_hash *hs, - struct cfs_hash_bd *bds, + struct cfs_hash_bd *bds, const void *key, struct hlist_node *hnode, int insist_add); struct hlist_node *cfs_hash_dual_bd_finddel_locked(struct cfs_hash *hs, - struct cfs_hash_bd *bds, + struct cfs_hash_bd *bds, const void *key, struct hlist_node *hnode); /* Hash init/cleanup functions */ struct cfs_hash *cfs_hash_create(char *name, unsigned cur_bits, unsigned max_bits, - unsigned bkt_bits, unsigned extra_bytes, + unsigned bkt_bits, unsigned extra_bytes, unsigned min_theta, unsigned max_theta, cfs_hash_ops_t *ops, unsigned flags); diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h index 49ba62a4daa8..87f2d901c7c1 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h @@ -41,7 +41,6 @@ #ifndef __LIBCFS_IOCTL_H__ #define __LIBCFS_IOCTL_H__ - #define LIBCFS_IOCTL_VERSION 0x0001000a struct libcfs_ioctl_data { @@ -90,7 +89,6 @@ do { \ data.ioc_len = sizeof(data); \ } while (0) - struct libcfs_ioctl_handler { struct list_head item; int (*handle_ioctl)(unsigned int cmd, struct libcfs_ioctl_data *data); @@ -102,11 +100,9 @@ struct libcfs_ioctl_handler { /* .handle_ioctl = */ func \ } - /* FIXME check conflict with lustre_lib.h */ #define LIBCFS_IOC_DEBUG_MASK _IOWR('f', 250, long) - /* ioctls for manipulating snapshots 30- */ #define IOC_LIBCFS_TYPE 'e' #define IOC_LIBCFS_MIN_NR 30 @@ -149,6 +145,7 @@ struct libcfs_ioctl_handler { static inline int libcfs_ioctl_packlen(struct libcfs_ioctl_data *data) { int len = sizeof(*data); + len += cfs_size_round(data->ioc_inllen1); len += cfs_size_round(data->ioc_inllen2); return len; @@ -157,64 +154,62 @@ static inline int libcfs_ioctl_packlen(struct libcfs_ioctl_data *data) static inline int libcfs_ioctl_is_invalid(struct libcfs_ioctl_data *data) { if (data->ioc_len > (1<<30)) { - CERROR ("LIBCFS ioctl: ioc_len larger than 1<<30\n"); + CERROR("LIBCFS ioctl: ioc_len larger than 1<<30\n"); return 1; } if (data->ioc_inllen1 > (1<<30)) { - CERROR ("LIBCFS ioctl: ioc_inllen1 larger than 1<<30\n"); + CERROR("LIBCFS ioctl: ioc_inllen1 larger than 1<<30\n"); return 1; } if (data->ioc_inllen2 > (1<<30)) { - CERROR ("LIBCFS ioctl: ioc_inllen2 larger than 1<<30\n"); + CERROR("LIBCFS ioctl: ioc_inllen2 larger than 1<<30\n"); return 1; } if (data->ioc_inlbuf1 && !data->ioc_inllen1) { - CERROR ("LIBCFS ioctl: inlbuf1 pointer but 0 length\n"); + CERROR("LIBCFS ioctl: inlbuf1 pointer but 0 length\n"); return 1; } if (data->ioc_inlbuf2 && !data->ioc_inllen2) { - CERROR ("LIBCFS ioctl: inlbuf2 pointer but 0 length\n"); + CERROR("LIBCFS ioctl: inlbuf2 pointer but 0 length\n"); return 1; } if (data->ioc_pbuf1 && !data->ioc_plen1) { - CERROR ("LIBCFS ioctl: pbuf1 pointer but 0 length\n"); + CERROR("LIBCFS ioctl: pbuf1 pointer but 0 length\n"); return 1; } if (data->ioc_pbuf2 && !data->ioc_plen2) { - CERROR ("LIBCFS ioctl: pbuf2 pointer but 0 length\n"); + CERROR("LIBCFS ioctl: pbuf2 pointer but 0 length\n"); return 1; } if (data->ioc_plen1 && !data->ioc_pbuf1) { - CERROR ("LIBCFS ioctl: plen1 nonzero but no pbuf1 pointer\n"); + CERROR("LIBCFS ioctl: plen1 nonzero but no pbuf1 pointer\n"); return 1; } if (data->ioc_plen2 && !data->ioc_pbuf2) { - CERROR ("LIBCFS ioctl: plen2 nonzero but no pbuf2 pointer\n"); + CERROR("LIBCFS ioctl: plen2 nonzero but no pbuf2 pointer\n"); return 1; } - if ((__u32)libcfs_ioctl_packlen(data) != data->ioc_len ) { - CERROR ("LIBCFS ioctl: packlen != ioc_len\n"); + if ((__u32)libcfs_ioctl_packlen(data) != data->ioc_len) { + CERROR("LIBCFS ioctl: packlen != ioc_len\n"); return 1; } if (data->ioc_inllen1 && data->ioc_bulk[data->ioc_inllen1 - 1] != '\0') { - CERROR ("LIBCFS ioctl: inlbuf1 not 0 terminated\n"); + CERROR("LIBCFS ioctl: inlbuf1 not 0 terminated\n"); return 1; } if (data->ioc_inllen2 && data->ioc_bulk[cfs_size_round(data->ioc_inllen1) + data->ioc_inllen2 - 1] != '\0') { - CERROR ("LIBCFS ioctl: inlbuf2 not 0 terminated\n"); + CERROR("LIBCFS ioctl: inlbuf2 not 0 terminated\n"); return 1; } return 0; } - int libcfs_register_ioctl(struct libcfs_ioctl_handler *hand); int libcfs_deregister_ioctl(struct libcfs_ioctl_handler *hand); int libcfs_ioctl_getdata(char *buf, char *end, void *arg); int libcfs_ioctl_popdata(void *arg, void *buf, int size); - #endif /* __LIBCFS_IOCTL_H__ */ diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h index 037ae8a6d531..f19a121a37cd 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h @@ -47,7 +47,6 @@ #error Do not #include this file directly. #include instead #endif - /* KUC message header. * All current and future KUC messages should use this header. * To avoid having to include Lustre headers from libcfs, define this here. @@ -90,12 +89,12 @@ typedef int (*libcfs_kkuc_cb_t)(__u32 data, void *cb_arg); #define KUC_GRP_MAX KUC_GRP_HSM /* Kernel methods */ -extern int libcfs_kkuc_msg_put(struct file *fp, void *payload); -extern int libcfs_kkuc_group_put(int group, void *payload); -extern int libcfs_kkuc_group_add(struct file *fp, int uid, int group, +int libcfs_kkuc_msg_put(struct file *fp, void *payload); +int libcfs_kkuc_group_put(int group, void *payload); +int libcfs_kkuc_group_add(struct file *fp, int uid, int group, __u32 data); -extern int libcfs_kkuc_group_rem(int uid, int group); -extern int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func, +int libcfs_kkuc_group_rem(int uid, int group); +int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func, void *cb_arg); #define LK_FLG_STOP 0x01 @@ -111,9 +110,9 @@ typedef struct lustre_kernelcomm { } __attribute__((packed)) lustre_kernelcomm; /* Userspace methods */ -extern int libcfs_ukuc_start(lustre_kernelcomm *l, int groups); -extern int libcfs_ukuc_stop(lustre_kernelcomm *l); -extern int libcfs_ukuc_msg_get(lustre_kernelcomm *l, char *buf, int maxsize, +int libcfs_ukuc_start(lustre_kernelcomm *l, int groups); +int libcfs_ukuc_stop(lustre_kernelcomm *l); +int libcfs_ukuc_msg_get(lustre_kernelcomm *l, char *buf, int maxsize, int transport); #endif /* __LIBCFS_KERNELCOMM_H__ */ diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h index c184746cee4c..de64f1dc790c 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h @@ -50,7 +50,6 @@ #endif - /* * When this is on, LASSERT macro includes check for assignment used instead * of equality check, but doesn't have unlikely(). Turn this on from time to @@ -58,7 +57,6 @@ */ #define LASSERT_CHECKED (0) - #define LASSERTF(cond, fmt, ...) \ do { \ if (unlikely(!(cond))) { \ @@ -80,18 +78,18 @@ do { \ */ # define LINVRNT(exp) LASSERT(exp) #else -# define LINVRNT(exp) ((void)sizeof!!(exp)) +# define LINVRNT(exp) ((void)sizeof !!(exp)) #endif #define KLASSERT(e) LASSERT(e) -void lbug_with_loc(struct libcfs_debug_msg_data *) __attribute__((noreturn)); +void lbug_with_loc(struct libcfs_debug_msg_data *)__attribute__((noreturn)); #define LBUG() \ do { \ LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_EMERG, NULL); \ lbug_with_loc(&msgdata); \ -} while(0) +} while (0) extern atomic_t libcfs_kmemory; /* @@ -111,7 +109,6 @@ do { \ # define libcfs_kmem_read() \ atomic_read(&libcfs_kmemory) - #ifndef LIBCFS_VMALLOC_SIZE #define LIBCFS_VMALLOC_SIZE (2 << PAGE_CACHE_SHIFT) /* 2 pages */ #endif @@ -220,7 +217,6 @@ int libcfs_debug_mark_buffer(const char *text); void libcfs_debug_set_level(unsigned int debug_level); - /* * allocate per-cpu-partition data, returned value is an array of pointers, * variable can be indexed by CPU ID. @@ -339,8 +335,8 @@ do { \ #define LASSERT_ATOMIC_ZERO(a) LASSERT_ATOMIC_EQ(a, 0) #define LASSERT_ATOMIC_POS(a) LASSERT_ATOMIC_GT(a, 0) -#define CFS_ALLOC_PTR(ptr) LIBCFS_ALLOC(ptr, sizeof (*(ptr))); -#define CFS_FREE_PTR(ptr) LIBCFS_FREE(ptr, sizeof (*(ptr))); +#define CFS_ALLOC_PTR(ptr) LIBCFS_ALLOC(ptr, sizeof(*(ptr))); +#define CFS_FREE_PTR(ptr) LIBCFS_FREE(ptr, sizeof(*(ptr))); /* * percpu partition lock @@ -363,7 +359,6 @@ enum { CFS_PERCPT_LOCK_EX = -1, /* negative */ }; - struct cfs_percpt_lock { /* cpu-partition-table for this lock */ struct cfs_cpt_table *pcl_cptab; @@ -380,7 +375,6 @@ cfs_percpt_lock_num(struct cfs_percpt_lock *pcl) return cfs_cpt_number(pcl->pcl_cptab); } - /* * create a cpu-partition lock based on CPU partition table \a cptab, * each private lock has extra \a psize bytes padding data @@ -400,7 +394,6 @@ void cfs_percpt_atomic_free(atomic_t **refs); /* return sum of all percpu refs */ int cfs_percpt_atomic_summary(atomic_t **refs); - /** Compile-time assertion. * Check an invariant described by a constant expression at compile time by @@ -415,7 +408,7 @@ int cfs_percpt_atomic_summary(atomic_t **refs); * value after conversion... * */ -#define CLASSERT(cond) do {switch(42) {case (cond): case 0: break;}} while (0) +#define CLASSERT(cond) do {switch (42) {case (cond): case 0: break; } } while (0) /* support decl needed both by kernel and liblustre */ int libcfs_isknown_lnd(int type); @@ -440,11 +433,11 @@ int cfs_match_nid(lnet_nid_t nid, struct list_head *list); /** extract the network part of an lnet_nid_t */ #define LNET_NIDNET(nid) ((__u32)(((nid) >> 32)) & 0xffffffff) /** make an lnet_nid_t from a network part and an address part */ -#define LNET_MKNID(net,addr) ((((__u64)(net))<<32)|((__u64)(addr))) +#define LNET_MKNID(net, addr) ((((__u64)(net))<<32)|((__u64)(addr))) /* how net encodes type:number */ #define LNET_NETNUM(net) ((net) & 0xffff) #define LNET_NETTYP(net) (((net) >> 16) & 0xffff) -#define LNET_MKNET(typ,num) ((((__u32)(typ))<<16)|((__u32)(num))) +#define LNET_MKNET(typ, num) ((((__u32)(typ))<<16)|((__u32)(num))) /** @} lnet_addr */ /* max value for numeric network address */ @@ -469,24 +462,25 @@ struct libcfs_device_userstate /* what used to be in portals_lib.h */ #ifndef MIN -# define MIN(a,b) (((a)<(b)) ? (a): (b)) +# define MIN(a, b) (((a) < (b)) ? (a) : (b)) #endif #ifndef MAX -# define MAX(a,b) (((a)>(b)) ? (a): (b)) +# define MAX(a, b) (((a) > (b)) ? (a) : (b)) #endif -#define MKSTR(ptr) ((ptr))? (ptr) : "" +#define MKSTR(ptr) ((ptr)) ? (ptr) : "" -static inline int cfs_size_round4 (int val) +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) +static inline int cfs_size_round(int val) { return (val + 7) & (~0x7); } + #define HAVE_CFS_SIZE_ROUND #endif @@ -525,21 +519,21 @@ static inline unsigned int cfs_power2_roundup(unsigned int val) return val; } -#define LOGL(var,len,ptr) \ +#define LOGL(var, len, ptr) \ do { \ if (var) \ memcpy((char *)ptr, (const char *)var, len); \ ptr += cfs_size_round(len); \ } while (0) -#define LOGU(var,len,ptr) \ +#define LOGU(var, len, ptr) \ do { \ if (var) \ memcpy((char *)var, (const char *)ptr, len); \ ptr += cfs_size_round(len); \ } while (0) -#define LOGL0(var,len,ptr) \ +#define LOGL0(var, len, ptr) \ do { \ if (!len) \ break; \ diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h index 4bdd77163d5e..bb9e59e41a8c 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h @@ -63,7 +63,6 @@ static inline int cfs_time_aftereq(cfs_time_t t1, cfs_time_t t2) return cfs_time_beforeq(t2, t1); } - static inline cfs_time_t cfs_time_shift(int seconds) { return cfs_time_add(cfs_time_current(), cfs_time_seconds(seconds)); @@ -72,7 +71,7 @@ static inline cfs_time_t cfs_time_shift(int seconds) static inline long cfs_timeval_sub(struct timeval *large, struct timeval *small, struct timeval *result) { - long r = (long) ( + long r = (long)( (large->tv_sec - small->tv_sec) * ONE_MILLION + (large->tv_usec - small->tv_usec)); if (result != NULL) { @@ -87,7 +86,7 @@ static inline void cfs_slow_warning(cfs_time_t now, int seconds, char *msg) if (cfs_time_after(cfs_time_current(), cfs_time_add(now, cfs_time_seconds(15)))) CERROR("slow %s "CFS_TIME_T" sec\n", msg, - cfs_duration_sec(cfs_time_sub(cfs_time_current(),now))); + cfs_duration_sec(cfs_time_sub(cfs_time_current(), now))); } #define CFS_RATELIMIT(seconds) \ diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/kp30.h b/drivers/staging/lustre/include/linux/libcfs/linux/kp30.h index f7085c402c1e..7b8107b133de 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/kp30.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/kp30.h @@ -37,7 +37,6 @@ #ifndef __LIBCFS_LINUX_KP30_H__ #define __LIBCFS_LINUX_KP30_H__ - #include #include #include diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h index d2f7c19cfa36..bc7c8a7f0f0f 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h @@ -42,7 +42,6 @@ #endif - #include #include "linux-cpu.h" #include "linux-time.h" @@ -63,7 +62,7 @@ #define LUSTRE_TRACE_SIZE (THREAD_SIZE >> 5) #if !defined(__x86_64__) -# ifdef __ia64__ +# ifdef __ia64__ # define CDEBUG_STACK() (THREAD_SIZE - \ ((unsigned long)__builtin_dwarf_cfa() & \ (THREAD_SIZE - 1))) @@ -89,7 +88,7 @@ do { \ } while (0) #define CFS_CHECK_STACK(msgdata, mask, cdls) __CHECK_STACK(msgdata, mask, cdls) #else /* __x86_64__ */ -#define CFS_CHECK_STACK(msgdata, mask, cdls) do {} while(0) +#define CFS_CHECK_STACK(msgdata, mask, cdls) do {} while (0) #define CDEBUG_STACK() (0L) #endif /* __x86_64__ */ @@ -103,7 +102,7 @@ do { \ * * Implementation is in linux-curproc.c */ -#define CFS_CURPROC_COMM_MAX (sizeof ((struct task_struct *)0)->comm) +#define CFS_CURPROC_COMM_MAX (sizeof((struct task_struct *)0)->comm) #include @@ -116,6 +115,4 @@ typedef long long_ptr_t; #endif - - #endif /* _LINUX_LIBCFS_H */ diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h index 8dd354d51606..fbe1c0b47883 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h @@ -42,7 +42,6 @@ #error Do not #include this file directly. #include instead #endif - #include #include #include diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-lock.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-lock.h index b75e401d9a97..7581a14e884f 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-lock.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-lock.h @@ -45,7 +45,6 @@ #error Do not #include this file directly. #include instead #endif - #include /* @@ -81,8 +80,6 @@ */ - - /* * rw_semaphore "implementation" (use Linux kernel's primitives) * @@ -94,10 +91,8 @@ * - up_write(x) */ - #define fini_rwsem(s) do {} while (0) - /* * rwlock_t "implementation" (use Linux kernel's primitives) * @@ -112,7 +107,6 @@ * - RW_LOCK_UNLOCKED */ - #ifndef DEFINE_RWLOCK #define DEFINE_RWLOCK(lock) rwlock_t lock = __RW_LOCK_UNLOCKED(lock) #endif @@ -170,7 +164,6 @@ struct lock_class_key { /* This has to be a macro, so that `subclass' can be undefined in kernels * that do not support lockdep. */ - static inline void lockdep_off(void) { } @@ -200,5 +193,4 @@ static inline void lockdep_on(void) #endif #endif /* CONFIG_DEBUG_LOCK_ALLOC */ - #endif /* __LIBCFS_LINUX_CFS_LOCK_H__ */ diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-mem.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-mem.h index ccee5c3e4142..b15653f7383a 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-mem.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-mem.h @@ -45,7 +45,6 @@ #error Do not #include this file directly. #include instead #endif - #include #include #include @@ -81,7 +80,7 @@ #define DECL_MMSPACE mm_segment_t __oldfs #define MMSPACE_OPEN \ - do { __oldfs = get_fs(); set_fs(get_ds());} while(0) + do { __oldfs = get_fs(); set_fs(get_ds()); } while (0) #define MMSPACE_CLOSE set_fs(__oldfs) #endif /* __LINUX_CFS_MEM_H__ */ diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-prim.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-prim.h index 261ab80b712c..b24bc6b18839 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-prim.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-prim.h @@ -45,7 +45,6 @@ #error Do not #include this file directly. #include instead #endif - #include #include #include diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-tcpip.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-tcpip.h index 7a8d006903b9..f95e60ef7b54 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-tcpip.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-tcpip.h @@ -45,7 +45,6 @@ #error Do not #include this file directly. #include instead #endif - #include typedef struct socket socket_t; diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h index 201932abcd2b..8d78cb38312d 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h @@ -45,7 +45,6 @@ #error Do not #include this file directly. #include instead #endif - /* Portable time API */ /* @@ -88,7 +87,6 @@ #define ONE_BILLION ((u_int64_t)1000000000) #define ONE_MILLION 1000000 - #include #include #include @@ -123,7 +121,6 @@ static inline unsigned long long __cfs_fs_time_flat(cfs_fs_time_t *t) return (unsigned long long)t->tv_sec * ONE_BILLION + t->tv_nsec; } - /* * Generic kernel stuff */ @@ -179,6 +176,7 @@ static inline cfs_duration_t cfs_duration_build(int64_t nano) /* We cannot use do_div(t, ONE_BILLION), do_div can only process * 64 bits n and 32 bits base */ int64_t t = nano * HZ; + do_div(t, 1000); do_div(t, 1000000); return (cfs_duration_t)t; @@ -252,7 +250,6 @@ static inline int cfs_time_beforeq_64(__u64 t1, __u64 t2) return (__s64)t2 - (__s64)t1 >= 0; } - /* * One jiffy */ @@ -261,7 +258,6 @@ static inline int cfs_time_beforeq_64(__u64 t1, __u64 t2) #define CFS_TIME_T "%lu" #define CFS_DURATION_T "%ld" - #endif /* __LIBCFS_LINUX_LINUX_TIME_H__ */ /* * Local variables: diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/portals_compat25.h b/drivers/staging/lustre/include/linux/libcfs/linux/portals_compat25.h index fe4c63fb40a4..c6fa7ca4c87b 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/portals_compat25.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/portals_compat25.h @@ -37,14 +37,14 @@ #ifndef __LIBCFS_LINUX_PORTALS_COMPAT_H__ #define __LIBCFS_LINUX_PORTALS_COMPAT_H__ -// XXX BUG 1511 -- remove this stanza and all callers when bug 1511 is resolved +/* XXX BUG 1511 -- remove this stanza and all callers when bug 1511 is resolved */ #if defined(SPINLOCK_DEBUG) && SPINLOCK_DEBUG # define SIGNAL_MASK_ASSERT() \ LASSERT(current->sighand->siglock.magic == SPINLOCK_MAGIC) #else # define SIGNAL_MASK_ASSERT() #endif -// XXX BUG 1511 -- remove this stanza and all callers when bug 1511 is resolved +/* XXX BUG 1511 -- remove this stanza and all callers when bug 1511 is resolved */ #define SIGNAL_MASK_LOCK(task, flags) \ spin_lock_irqsave(&task->sighand->siglock, flags) diff --git a/drivers/staging/lustre/include/linux/libcfs/lucache.h b/drivers/staging/lustre/include/linux/libcfs/lucache.h index b5b3c23bf85e..3350dcc0ca2a 100644 --- a/drivers/staging/lustre/include/linux/libcfs/lucache.h +++ b/drivers/staging/lustre/include/linux/libcfs/lucache.h @@ -104,17 +104,17 @@ struct upcall_cache; struct upcall_cache_ops { void (*init_entry)(struct upcall_cache_entry *, void *args); void (*free_entry)(struct upcall_cache *, - struct upcall_cache_entry *); + struct upcall_cache_entry *); int (*upcall_compare)(struct upcall_cache *, - struct upcall_cache_entry *, + struct upcall_cache_entry *, __u64 key, void *args); int (*downcall_compare)(struct upcall_cache *, - struct upcall_cache_entry *, + struct upcall_cache_entry *, __u64 key, void *args); int (*do_upcall)(struct upcall_cache *, - struct upcall_cache_entry *); + struct upcall_cache_entry *); int (*parse_downcall)(struct upcall_cache *, - struct upcall_cache_entry *, void *); + struct upcall_cache_entry *, void *); }; struct upcall_cache { diff --git a/drivers/staging/lustre/include/linux/libcfs/params_tree.h b/drivers/staging/lustre/include/linux/libcfs/params_tree.h index 170d6658299c..7c8d7c7d391c 100644 --- a/drivers/staging/lustre/include/linux/libcfs/params_tree.h +++ b/drivers/staging/lustre/include/linux/libcfs/params_tree.h @@ -108,21 +108,21 @@ typedef struct cfs_seq_file { } cfs_seq_file_t; typedef struct cfs_seq_operations { - void *(*start) (cfs_seq_file_t *m, loff_t *pos); - void (*stop) (cfs_seq_file_t *m, void *v); - void *(*next) (cfs_seq_file_t *m, void *v, loff_t *pos); - int (*show) (cfs_seq_file_t *m, void *v); + void *(*start)(cfs_seq_file_t *m, loff_t *pos); + void (*stop)(cfs_seq_file_t *m, void *v); + void *(*next)(cfs_seq_file_t *m, void *v, loff_t *pos); + int (*show)(cfs_seq_file_t *m, void *v); } cfs_seq_ops_t; typedef void *cfs_poll_table_t; typedef struct cfs_param_file_ops { struct module *owner; - int (*open) (cfs_inode_t *, struct file *); + int (*open)(cfs_inode_t *, struct file *); loff_t (*llseek)(struct file *, loff_t, int); - int (*release) (cfs_inode_t *, cfs_param_file_t *); - unsigned int (*poll) (struct file *, cfs_poll_table_t *); - ssize_t (*write) (struct file *, const char *, size_t, loff_t *); + int (*release)(cfs_inode_t *, cfs_param_file_t *); + unsigned int (*poll)(struct file *, cfs_poll_table_t *); + ssize_t (*write)(struct file *, const char *, size_t, loff_t *); ssize_t (*read)(struct file *, char *, size_t, loff_t *); } cfs_param_file_ops_t; typedef cfs_param_file_ops_t *cfs_lproc_filep_t; @@ -140,7 +140,7 @@ static inline cfs_proc_inode_t *FAKE_PROC_I(const cfs_inode_t *inode) #define cfs_seq_read_common NULL #define cfs_seq_lseek_common NULL #define cfs_seq_private(seq) (seq->private) -#define cfs_seq_read(file, buf, count, ppos, rc) do {} while(0) +#define cfs_seq_read(file, buf, count, ppos, rc) do {} while (0) #define cfs_seq_open(file, ops, rc) \ do { \ cfs_seq_file_t *p = cfs_file_private(file); \ @@ -155,7 +155,7 @@ do { \ memset(p, 0, sizeof(*p)); \ p->op = ops; \ rc = 0; \ -} while(0) +} while (0) #endif /* LPROCFS */ -- 2.34.1