Skip to contentSkip to conversation

lustre: cleanups with no code changes

PATCH New James Simmons 3 participants 30 messages Jan 31, 2019 – Feb 4, 2019 Staging Page 1 of 2

lore
Share & tools
lore
#0 lore raw

cover lustre: cleanups with no code changes

To prepare for lustre to leave staging the code needs to be cleaned up to make it easier for others to examine our code. This patch series does no real code changes but does the following:

1) Replace all the UAPI types in the kernel only code. Once these patches are applied only the UAPI headers will have UAPI types.

2) The lustre code has massive amounts of white spacing. Remove the white spacing for variable declarations. Removing the white spacing in data structures and align the fields to make it easier to read. In a few patches remove access blank lines.

James Simmons (26):
lnet: use kernel types for lnet core kernel code
lnet: use kernel types for lnet klnd kernel code
lnet: use kernel types for lnet selftest kernel code
ptlrpc: use kernel types for kernel code
lustre: use kernel types for lustre internal headers
ldlm: use kernel types for kernel code
obdclass: use kernel types for kernel code
lustre: convert remaining code to kernel types
lustre: cleanup white spaces in fid and fld layer
ldlm: cleanup white spaces
llite: cleanup white spaces
lmv: cleanup white spaces
lov: cleanup white spaces
mdc: cleanup white spaces
mgc: cleanup white spaces
obdclass: cleanup white spaces
obdecho: cleanup white spaces
osc: cleanup white spaces
ptlrpc: cleanup white spaces
lustre: first batch to cleanup white spaces in internal headers
lustre: second batch to cleanup white spaces in internal headers
lustre: last batch to cleanup white spaces in internal headers
libcfs: cleanup white spaces
lnet: cleanup white spaces
socklnd: cleanup white spaces
o2iblnd: cleanup white spaces

 .../lustre/include/linux/libcfs/libcfs_debug.h     |  74 +-
 .../lustre/include/linux/libcfs/libcfs_fail.h      |   8 +-
 .../lustre/include/linux/libcfs/libcfs_private.h   |  56 +-
 .../lustre/include/linux/libcfs/libcfs_string.h    |  10 +-
 drivers/staging/lustre/include/linux/lnet/api.h    |  40 +-
 .../staging/lustre/include/linux/lnet/lib-lnet.h   |  69 +-
 .../staging/lustre/include/linux/lnet/lib-types.h  | 234 +++----
 .../staging/lustre/include/linux/lnet/socklnd.h    |  20 +-
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c    | 107 +--
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h    | 642 +++++++++---------
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 121 ++--
 .../lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c  |  22 +-
 .../staging/lustre/lnet/klnds/socklnd/socklnd.c    | 125 ++--
 .../staging/lustre/lnet/klnds/socklnd/socklnd.h    | 566 ++++++++--------
 .../staging/lustre/lnet/klnds/socklnd/socklnd_cb.c |  56 +-
 .../lustre/lnet/klnds/socklnd/socklnd_lib.c        |  20 +-
 .../lustre/lnet/klnds/socklnd/socklnd_modparams.c  |  54 +-
 .../lustre/lnet/klnds/socklnd/socklnd_proto.c      |  99 ++-
 drivers/staging/lustre/lnet/libcfs/debug.c         |  22 +-
 drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c    |   8 +-
 drivers/staging/lustre/lnet/libcfs/libcfs_string.c |   4 +-
 .../lustre/lnet/libcfs/linux-crypto-adler.c        |   2 +-
 drivers/staging/lustre/lnet/libcfs/linux-crypto.c  |   1 -
 drivers/staging/lustre/lnet/libcfs/module.c        | 128 ++--
 drivers/staging/lustre/lnet/libcfs/tracefile.c     |   5 +-
 drivers/staging/lustre/lnet/libcfs/tracefile.h     |  12 +-
 drivers/staging/lustre/lnet/lnet/acceptor.c        |  30 +-
 drivers/staging/lustre/lnet/lnet/api-ni.c          | 115 ++--
 drivers/staging/lustre/lnet/lnet/config.c          |  86 ++-
 drivers/staging/lustre/lnet/lnet/lib-eq.c          |   2 +-
 drivers/staging/lustre/lnet/lnet/lib-me.c          |   4 +-
 drivers/staging/lustre/lnet/lnet/lib-move.c        | 112 ++--
 drivers/staging/lustre/lnet/lnet/lib-msg.c         |  72 +-
 drivers/staging/lustre/lnet/lnet/lib-ptl.c         |  36 +-
 drivers/staging/lustre/lnet/lnet/lib-socket.c      |  21 +-
 drivers/staging/lustre/lnet/lnet/module.c          |   3 +-
 drivers/staging/lustre/lnet/lnet/net_fault.c       |   1 -
 drivers/staging/lustre/lnet/lnet/nidstrings.c      | 126 ++--
 drivers/staging/lustre/lnet/lnet/peer.c            |  57 +-
 drivers/staging/lustre/lnet/lnet/router.c          |  42 +-
 drivers/staging/lustre/lnet/lnet/router_proc.c     |  65 +-
 drivers/staging/lustre/lnet/selftest/brw_test.c    |  20 +-
 drivers/staging/lustre/lnet/selftest/console.h     |   2 +-
 drivers/staging/lustre/lnet/selftest/rpc.c         |  22 +-
 drivers/staging/lustre/lnet/selftest/rpc.h         | 132 ++--
 drivers/staging/lustre/lustre/fid/fid_lib.c        |   2 +-
 drivers/staging/lustre/lustre/fid/fid_request.c    |  12 +-
 drivers/staging/lustre/lustre/fid/lproc_fid.c      |   4 +-
 drivers/staging/lustre/lustre/fld/fld_cache.c      |  18 +-
 drivers/staging/lustre/lustre/fld/fld_internal.h   |  36 +-
 drivers/staging/lustre/lustre/fld/fld_request.c    |  14 +-
 drivers/staging/lustre/lustre/include/cl_object.h  | 340 +++++-----
 .../staging/lustre/lustre/include/lprocfs_status.h |  95 +--
 drivers/staging/lustre/lustre/include/lu_object.h  | 354 +++++-----
 .../staging/lustre/lustre/include/lustre_debug.h   |   4 +-
 .../staging/lustre/lustre/include/lustre_disk.h    |  48 +-
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 298 ++++-----
 .../lustre/lustre/include/lustre_dlm_flags.h       | 326 ++++-----
 .../staging/lustre/lustre/include/lustre_export.h  |  82 +--
 drivers/staging/lustre/lustre/include/lustre_fid.h |  44 +-
 drivers/staging/lustre/lustre/include/lustre_fld.h |  18 +-
 drivers/staging/lustre/lustre/include/lustre_ha.h  |   2 +-
 .../staging/lustre/lustre/include/lustre_handles.h |   6 +-
 .../staging/lustre/lustre/include/lustre_import.h  | 225 +++----
 .../staging/lustre/lustre/include/lustre_intent.h  |  24 +-
 drivers/staging/lustre/lustre/include/lustre_lib.h |   2 -
 drivers/staging/lustre/lustre/include/lustre_lmv.h |  26 +-
 drivers/staging/lustre/lustre/include/lustre_log.h |  44 +-
 drivers/staging/lustre/lustre/include/lustre_mdc.h |   4 +-
 drivers/staging/lustre/lustre/include/lustre_mds.h |   4 +-
 drivers/staging/lustre/lustre/include/lustre_net.h | 502 +++++++-------
 .../lustre/lustre/include/lustre_nrs_fifo.h        |   6 +-
 .../lustre/lustre/include/lustre_req_layout.h      |  10 +-
 drivers/staging/lustre/lustre/include/lustre_sec.h | 338 +++++-----
 .../staging/lustre/lustre/include/lustre_swab.h    |   6 +-
 drivers/staging/lustre/lustre/include/obd.h        | 539 +++++++--------
 drivers/staging/lustre/lustre/include/obd_cksum.h  |   4 +-
 drivers/staging/lustre/lustre/include/obd_class.h  | 110 +--
 .../staging/lustre/lustre/include/obd_support.h    | 744 ++++++++++-----------
 drivers/staging/lustre/lustre/include/seq_range.h  |   2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_extent.c   |   8 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c    |   6 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h |  12 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c      |  22 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c     |  50 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c    |  28 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c     |  27 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |  60 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c |  90 +--
 drivers/staging/lustre/lustre/llite/dir.c          | 132 ++--
 drivers/staging/lustre/lustre/llite/file.c         | 220 +++---
 drivers/staging/lustre/lustre/llite/glimpse.c      |  18 +-
 drivers/staging/lustre/lustre/llite/lcommon_cl.c   |  24 +-
 drivers/staging/lustre/lustre/llite/lcommon_misc.c |   4 +-
 .../staging/lustre/lustre/llite/llite_internal.h   |  74 +-
 drivers/staging/lustre/lustre/llite/llite_lib.c    |  64 +-
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |  54 +-
 drivers/staging/lustre/lustre/llite/llite_nfs.c    |  54 +-
 drivers/staging/lustre/lustre/llite/lproc_llite.c  |  82 +--
 drivers/staging/lustre/lustre/llite/namei.c        |  65 +-
 drivers/staging/lustre/lustre/llite/range_lock.c   |   4 +-
 drivers/staging/lustre/lustre/llite/range_lock.h   |  10 +-
 drivers/staging/lustre/lustre/llite/rw.c           |  12 +-
 drivers/staging/lustre/lustre/llite/rw26.c         |  57 +-
 drivers/staging/lustre/lustre/llite/statahead.c    | 149 +++--
 drivers/staging/lustre/lustre/llite/super25.c      |  16 +-
 drivers/staging/lustre/lustre/llite/vvp_dev.c      | 104 +--
 drivers/staging/lustre/lustre/llite/vvp_internal.h |  58 +-
 drivers/staging/lustre/lustre/llite/vvp_io.c       | 181 +++--
 drivers/staging/lustre/lustre/llite/vvp_object.c   |  30 +-
 drivers/staging/lustre/lustre/llite/vvp_page.c     |  88 +--
 drivers/staging/lustre/lustre/llite/xattr.c        |  48 +-
 drivers/staging/lustre/lustre/llite/xattr_cache.c  |   6 +-
 drivers/staging/lustre/lustre/lmv/lmv_intent.c     |  46 +-
 drivers/staging/lustre/lustre/lmv/lmv_internal.h   |   2 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c        | 382 +++++------
 drivers/staging/lustre/lustre/lmv/lproc_lmv.c      |  24 +-
 .../staging/lustre/lustre/lov/lov_cl_internal.h    |  50 +-
 drivers/staging/lustre/lustre/lov/lov_dev.c        |  72 +-
 drivers/staging/lustre/lustre/lov/lov_internal.h   |  76 +--
 drivers/staging/lustre/lustre/lov/lov_io.c         | 136 ++--
 drivers/staging/lustre/lustre/lov/lov_lock.c       |  34 +-
 drivers/staging/lustre/lustre/lov/lov_merge.c      |   8 +-
 drivers/staging/lustre/lustre/lov/lov_obd.c        |  63 +-
 drivers/staging/lustre/lustre/lov/lov_object.c     | 154 ++---
 drivers/staging/lustre/lustre/lov/lov_offset.c     |   6 +-
 drivers/staging/lustre/lustre/lov/lov_pack.c       |   6 +-
 drivers/staging/lustre/lustre/lov/lov_page.c       |  18 +-
 drivers/staging/lustre/lustre/lov/lov_pool.c       |  24 +-
 drivers/staging/lustre/lustre/lov/lov_request.c    |  16 +-
 drivers/staging/lustre/lustre/lov/lovsub_dev.c     |  32 +-
 drivers/staging/lustre/lustre/lov/lovsub_lock.c    |   4 +-
 drivers/staging/lustre/lustre/lov/lovsub_object.c  |  29 +-
 drivers/staging/lustre/lustre/lov/lovsub_page.c    |   2 +-
 drivers/staging/lustre/lustre/lov/lproc_lov.c      |  18 +-
 drivers/staging/lustre/lustre/mdc/mdc_internal.h   |  24 +-
 drivers/staging/lustre/lustre/mdc/mdc_lib.c        | 146 ++--
 drivers/staging/lustre/lustre/mdc/mdc_locks.c      |  96 +--
 drivers/staging/lustre/lustre/mdc/mdc_reint.c      |   8 +-
 drivers/staging/lustre/lustre/mdc/mdc_request.c    | 266 ++++----
 drivers/staging/lustre/lustre/mgc/mgc_request.c    | 101 +--
 .../staging/lustre/lustre/obdclass/cl_internal.h   |   2 +-
 drivers/staging/lustre/lustre/obdclass/cl_io.c     |  30 +-
 drivers/staging/lustre/lustre/obdclass/cl_lock.c   |   4 +-
 drivers/staging/lustre/lustre/obdclass/cl_object.c |  42 +-
 drivers/staging/lustre/lustre/obdclass/cl_page.c   |  62 +-
 drivers/staging/lustre/lustre/obdclass/class_obd.c |  20 +-
 drivers/staging/lustre/lustre/obdclass/debug.c     |  16 +-
 drivers/staging/lustre/lustre/obdclass/genops.c    |  26 +-
 .../staging/lustre/lustre/obdclass/kernelcomm.c    |   8 +-
 drivers/staging/lustre/lustre/obdclass/linkea.c    |   6 +-
 drivers/staging/lustre/lustre/obdclass/llog.c      |  40 +-
 drivers/staging/lustre/lustre/obdclass/llog_cat.c  |   6 +-
 .../staging/lustre/lustre/obdclass/llog_internal.h |  24 +-
 drivers/staging/lustre/lustre/obdclass/llog_swab.c |  18 +-
 .../lustre/lustre/obdclass/lprocfs_counters.c      |  18 +-
 .../lustre/lustre/obdclass/lprocfs_status.c        | 184 ++---
 drivers/staging/lustre/lustre/obdclass/lu_object.c | 120 ++--
 .../lustre/lustre/obdclass/lustre_handles.c        |   6 +-
 .../staging/lustre/lustre/obdclass/lustre_peer.c   |  12 +-
 .../staging/lustre/lustre/obdclass/obd_config.c    |  39 +-
 drivers/staging/lustre/lustre/obdclass/obd_mount.c |  23 +-
 .../staging/lustre/lustre/obdecho/echo_client.c    | 284 ++++----
 .../staging/lustre/lustre/obdecho/echo_internal.h  |   4 +-
 drivers/staging/lustre/lustre/osc/lproc_osc.c      |   8 +-
 drivers/staging/lustre/lustre/osc/osc_cache.c      |  71 +-
 .../staging/lustre/lustre/osc/osc_cl_internal.h    |   6 +-
 drivers/staging/lustre/lustre/osc/osc_dev.c        |  42 +-
 drivers/staging/lustre/lustre/osc/osc_internal.h   |   6 +-
 drivers/staging/lustre/lustre/osc/osc_io.c         |  42 +-
 drivers/staging/lustre/lustre/osc/osc_lock.c       |  42 +-
 drivers/staging/lustre/lustre/osc/osc_object.c     |  30 +-
 drivers/staging/lustre/lustre/osc/osc_page.c       |   8 +-
 drivers/staging/lustre/lustre/osc/osc_request.c    |  48 +-
 drivers/staging/lustre/lustre/ptlrpc/client.c      |  77 +--
 drivers/staging/lustre/lustre/ptlrpc/events.c      |  10 +-
 drivers/staging/lustre/lustre/ptlrpc/import.c      |  14 +-
 drivers/staging/lustre/lustre/ptlrpc/layout.c      |  21 +-
 drivers/staging/lustre/lustre/ptlrpc/llog_client.c |   2 +-
 .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c    | 304 ++++-----
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c      |  11 +-
 drivers/staging/lustre/lustre/ptlrpc/nrs.c         |   1 -
 .../staging/lustre/lustre/ptlrpc/pack_generic.c    | 112 ++--
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |  18 +-
 drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c     |  22 +-
 drivers/staging/lustre/lustre/ptlrpc/recover.c     |   3 +-
 drivers/staging/lustre/lustre/ptlrpc/sec.c         |  22 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c    |  80 +--
 drivers/staging/lustre/lustre/ptlrpc/sec_config.c  |  22 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_null.c    |  40 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_plain.c   |  94 +--
 drivers/staging/lustre/lustre/ptlrpc/service.c     |  36 +-
 192 files changed, 6805 insertions(+), 6827 deletions(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/26 lnet: use kernel types for lnet core kernel code

LNet stack was originally both a user land and kernel implementation. The source contains many types of the form __u32 but since this is mostly kernel code change the types to kernel internal types.

---
 drivers/staging/lustre/include/linux/lnet/api.h    | 16 ++--
 .../staging/lustre/include/linux/lnet/lib-lnet.h   | 66 ++++++++--------
 .../staging/lustre/include/linux/lnet/lib-types.h  | 50 ++++++------
 .../staging/lustre/include/linux/lnet/socklnd.h    | 20 ++---
 drivers/staging/lustre/lnet/lnet/acceptor.c        | 14 ++--
 drivers/staging/lustre/lnet/lnet/api-ni.c          | 26 +++----
 drivers/staging/lustre/lnet/lnet/config.c          | 48 ++++++------
 drivers/staging/lustre/lnet/lnet/lib-me.c          |  4 +-
 drivers/staging/lustre/lnet/lnet/lib-move.c        | 28 +++----
 drivers/staging/lustre/lnet/lnet/lib-ptl.c         | 14 ++--
 drivers/staging/lustre/lnet/lnet/lib-socket.c      | 10 +--
 drivers/staging/lustre/lnet/lnet/nidstrings.c      | 88 +++++++++++-----------
 drivers/staging/lustre/lnet/lnet/peer.c            | 20 ++---
 drivers/staging/lustre/lnet/lnet/router.c          | 16 ++--
 drivers/staging/lustre/lnet/lnet/router_proc.c     |  4 +-
 15 files changed, 212 insertions(+), 212 deletions(-)
drivers/staging/lustre/include/linux/lnet/api.h +8 -8
index 70c9919..7c30475 100644
@@ -76,7 +76,7 @@
  * @{
  */
 int LNetGetId(unsigned int index, struct lnet_process_id *id);
-int LNetDist(lnet_nid_t nid, lnet_nid_t *srcnid, __u32 *order);
+int LNetDist(lnet_nid_t nid, lnet_nid_t *srcnid, u32 *order);
 lnet_nid_t LNetPrimaryNID(lnet_nid_t nid);
 
 /** @} lnet_addr */
@@ -96,16 +96,16 @@
  */
 int LNetMEAttach(unsigned int      portal,
 		 struct lnet_process_id match_id_in,
-		 __u64		   match_bits_in,
-		 __u64		   ignore_bits_in,
+		 u64		   match_bits_in,
+		 u64		   ignore_bits_in,
 		 enum lnet_unlink unlink_in,
 		 enum lnet_ins_pos pos_in,
 		 struct lnet_handle_me *handle_out);
 
 int LNetMEInsert(struct lnet_handle_me current_in,
 		 struct lnet_process_id match_id_in,
-		 __u64		   match_bits_in,
-		 __u64		   ignore_bits_in,
+		 u64		   match_bits_in,
+		 u64		   ignore_bits_in,
 		 enum lnet_unlink unlink_in,
 		 enum lnet_ins_pos position_in,
 		 struct lnet_handle_me *handle_out);
@@ -186,15 +186,15 @@ int LNetPut(lnet_nid_t	      self,
 	    enum lnet_ack_req ack_req_in,
 	    struct lnet_process_id target_in,
 	    unsigned int      portal_in,
-	    __u64	      match_bits_in,
+	    u64 match_bits_in,
 	    unsigned int      offset_in,
-	    __u64	      hdr_data_in);
+	    u64	hdr_data_in);
 
 int LNetGet(lnet_nid_t	      self,
 	    struct lnet_handle_md md_in,
 	    struct lnet_process_id target_in,
 	    unsigned int      portal_in,
-	    __u64	      match_bits_in,
+	    u64	match_bits_in,
 	    unsigned int      offset_in);
 /** @} lnet_data */
 
drivers/staging/lustre/include/linux/lnet/lib-lnet.h +33 -33

183 lines not on this page · raw message

drivers/staging/lustre/include/linux/lnet/lib-types.h +25 -25

168 lines not on this page · raw message

drivers/staging/lustre/include/linux/lnet/socklnd.h +10 -10
index 9f69257..20fa221d 100644
@@ -39,17 +39,17 @@
 #include <uapi/linux/lnet/socklnd.h>
 
 struct ksock_hello_msg {
-	__u32		kshm_magic;	/* magic number of socklnd message */
-	__u32		kshm_version;	/* version of socklnd message */
+	u32		kshm_magic;	/* magic number of socklnd message */
+	u32		kshm_version;	/* version of socklnd message */
 	lnet_nid_t      kshm_src_nid;	/* sender's nid */
 	lnet_nid_t	kshm_dst_nid;	/* destination nid */
 	lnet_pid_t	kshm_src_pid;	/* sender's pid */
 	lnet_pid_t	kshm_dst_pid;	/* destination pid */
-	__u64		kshm_src_incarnation; /* sender's incarnation */
-	__u64		kshm_dst_incarnation; /* destination's incarnation */
-	__u32		kshm_ctype;	/* connection type */
-	__u32		kshm_nips;	/* # IP addrs */
-	__u32		kshm_ips[0];	/* IP addrs */
+	u64		kshm_src_incarnation; /* sender's incarnation */
+	u64		kshm_dst_incarnation; /* destination's incarnation */
+	u32		kshm_ctype;	/* connection type */
+	u32		kshm_nips;	/* # IP addrs */
+	u32		kshm_ips[0];	/* IP addrs */
 } __packed;
 
 struct ksock_lnet_msg {
@@ -64,9 +64,9 @@ struct ksock_lnet_msg {
 } __packed;
 
 struct ksock_msg {
-	__u32	ksm_type;		/* type of socklnd message */
-	__u32	ksm_csum;		/* checksum if != 0 */
-	__u64	ksm_zc_cookies[2];	/* Zero-Copy request/ACK cookie */
+	u32	ksm_type;		/* type of socklnd message */
+	u32	ksm_csum;		/* checksum if != 0 */
+	u64	ksm_zc_cookies[2];	/* Zero-Copy request/ACK cookie */
 	union {
 		struct ksock_lnet_msg lnetmsg; /* lnet message, it's empty if
 						* it's NOOP
drivers/staging/lustre/lnet/lnet/acceptor.c +7 -7
index 150fcd6..aa28a9f 100644
@@ -56,7 +56,7 @@
 EXPORT_SYMBOL(lnet_acceptor_port);
 
 static inline int
-lnet_accept_magic(__u32 magic, __u32 constant)
+lnet_accept_magic(u32 magic, u32 constant)
 {
 	return (magic == constant ||
 		magic == __swab32(constant));
@@ -96,7 +96,7 @@
 
 void
 lnet_connect_console_error(int rc, lnet_nid_t peer_nid,
-			   __u32 peer_ip, int peer_port)
+			   u32 peer_ip, int peer_port)
 {
 	switch (rc) {
 	/* "normal" errors */
@@ -142,7 +142,7 @@
 
 int
 lnet_connect(struct socket **sockp, lnet_nid_t peer_nid,
-	     __u32 local_ip, __u32 peer_ip, int peer_port)
+	     u32 local_ip, u32 peer_ip, int peer_port)
 {
 	struct lnet_acceptor_connreq cr;
 	struct socket *sock;
@@ -205,10 +205,10 @@
 EXPORT_SYMBOL(lnet_connect);
 
 static int
-lnet_accept(struct socket *sock, __u32 magic)
+lnet_accept(struct socket *sock, u32 magic)
 {
 	struct lnet_acceptor_connreq cr;
-	__u32 peer_ip;
+	u32 peer_ip;
 	int peer_port;
 	int rc;
 	int flip;
@@ -328,8 +328,8 @@
 {
 	struct socket *newsock;
 	int rc;
-	__u32 magic;
-	__u32 peer_ip;
+	u32 magic;
+	u32 peer_ip;
 	int peer_port;
 	int secure = (int)((long)arg);
 
drivers/staging/lustre/lnet/lnet/api-ni.c +13 -13
index 6d52824..be77e10 100644
@@ -104,7 +104,7 @@ struct lnet the_lnet = {
 static int lnet_ping(struct lnet_process_id id, signed long timeout,
 		     struct lnet_process_id __user *ids, int n_ids);
 
-static int lnet_discover(struct lnet_process_id id, __u32 force,
+static int lnet_discover(struct lnet_process_id id, u32 force,
 			 struct lnet_process_id __user *ids, int n_ids);
 
 static int
@@ -420,7 +420,7 @@ static void lnet_assert_wire_constants(void)
 }
 
 static struct lnet_lnd *
-lnet_find_lnd_by_type(__u32 type)
+lnet_find_lnd_by_type(u32 type)
 {
 	struct lnet_lnd *lnd;
 
@@ -632,7 +632,7 @@ static void lnet_assert_wire_constants(void)
 }
 
 struct lnet_libhandle *
-lnet_res_lh_lookup(struct lnet_res_container *rec, __u64 cookie)
+lnet_res_lh_lookup(struct lnet_res_container *rec, u64 cookie)
 {
 	/* ALWAYS called with lnet_res_lock held */
 	struct list_head *head;
@@ -803,7 +803,7 @@ struct lnet_libhandle *
 }
 
 struct lnet_ni  *
-lnet_net2ni_locked(__u32 net_id, int cpt)
+lnet_net2ni_locked(u32 net_id, int cpt)
 {
 	struct lnet_ni *ni;
 	struct lnet_net *net;
@@ -822,7 +822,7 @@ struct lnet_ni  *
 }
 
 struct lnet_ni *
-lnet_net2ni_addref(__u32 net)
+lnet_net2ni_addref(u32 net)
 {
 	struct lnet_ni *ni;
 
@@ -837,7 +837,7 @@ struct lnet_ni *
 EXPORT_SYMBOL(lnet_net2ni_addref);
 
 struct lnet_net *
-lnet_get_net_locked(__u32 net_id)
+lnet_get_net_locked(u32 net_id)
 {
 	struct lnet_net *net;
 
@@ -852,7 +852,7 @@ struct lnet_net *
 unsigned int
 lnet_nid_cpt_hash(lnet_nid_t nid, unsigned int number)
 {
-	__u64 key = nid;
+	u64 key = nid;
 	unsigned int val;
 
 	LASSERT(number >= 1 && number <= LNET_CPT_NUMBER);
@@ -920,7 +920,7 @@ struct lnet_net *
 EXPORT_SYMBOL(lnet_cpt_of_nid);
 
 int
-lnet_islocalnet(__u32 net_id)
+lnet_islocalnet(u32 net_id)
 {
 	struct lnet_net *net;
 	int cpt;
@@ -2234,7 +2234,7 @@ void lnet_lib_exit(void)
 lnet_fill_ni_info(struct lnet_ni *ni, struct lnet_ioctl_config_ni *cfg_ni,
 		  struct lnet_ioctl_config_lnd_tunables *tun,
 		  struct lnet_ioctl_element_stats *stats,
-		  __u32 tun_size)
+		  u32 tun_size)
 {
 	size_t min_size = 0;
 	int i;
@@ -2471,7 +2471,7 @@ struct lnet_ni *
 lnet_get_ni_config(struct lnet_ioctl_config_ni *cfg_ni,
 		   struct lnet_ioctl_config_lnd_tunables *tun,
 		   struct lnet_ioctl_element_stats *stats,
-		   __u32 tun_size)
+		   u32 tun_size)
 {
 	struct lnet_ni *ni;
 	int cpt;
@@ -2848,7 +2848,7 @@ int lnet_dyn_del_ni(struct lnet_ioctl_config_ni *conf)
 }
 
 int
-lnet_dyn_del_net(__u32 net_id)
+lnet_dyn_del_net(u32 net_id)
 {
 	struct lnet_net *net;
 	struct lnet_ping_buffer *pbuf;
@@ -2980,7 +2980,7 @@ u32 lnet_get_dlc_seq_locked(void)
 		struct lnet_ioctl_config_ni *cfg_ni;
 		struct lnet_ioctl_config_lnd_tunables *tun = NULL;
 		struct lnet_ioctl_element_stats *stats;
-		__u32 tun_size;
+		u32 tun_size;
 
 		cfg_ni = arg;
 
@@ -3522,7 +3522,7 @@ static int lnet_ping(struct lnet_process_id id, signed long timeout,
 }
 
 static int
-lnet_discover(struct lnet_process_id id, __u32 force,
+lnet_discover(struct lnet_process_id id, u32 force,
 	      struct lnet_process_id __user *ids,
 	      int n_ids)
 {
drivers/staging/lustre/lnet/lnet/config.c +24 -24

168 lines not on this page · raw message

drivers/staging/lustre/lnet/lnet/lib-me.c +2 -2
index 672e37b..4a5ffb1 100644
@@ -72,7 +72,7 @@
 int
 LNetMEAttach(unsigned int portal,
 	     struct lnet_process_id match_id,
-	     __u64 match_bits, __u64 ignore_bits,
+	     u64 match_bits, u64 ignore_bits,
 	     enum lnet_unlink unlink, enum lnet_ins_pos pos,
 	     struct lnet_handle_me *handle)
 {
@@ -143,7 +143,7 @@
 int
 LNetMEInsert(struct lnet_handle_me current_meh,
 	     struct lnet_process_id match_id,
-	     __u64 match_bits, __u64 ignore_bits,
+	     u64 match_bits, u64 ignore_bits,
 	     enum lnet_unlink unlink, enum lnet_ins_pos pos,
 	     struct lnet_handle_me *handle)
 {
drivers/staging/lustre/lnet/lnet/lib-move.c +14 -14
index eaa1dfa..639f67ed 100644
@@ -94,7 +94,7 @@ void lnet_incr_stats(struct lnet_element_stats *stats,
 	}
 }
 
-__u32 lnet_sum_stats(struct lnet_element_stats *stats,
+u32 lnet_sum_stats(struct lnet_element_stats *stats,
 		     enum lnet_stats_type stats_type)
 {
 	struct lnet_comm_count *counts = get_stats_counts(stats, stats_type);
@@ -1845,7 +1845,7 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats,
 	 */
 	cpt2 = lnet_cpt_of_nid_locked(best_lpni->lpni_nid, best_ni);
 	if (cpt != cpt2) {
-		__u32 seq = lnet_get_dlc_seq_locked();
+		u32 seq = lnet_get_dlc_seq_locked();
 		lnet_net_unlock(cpt);
 		cpt = cpt2;
 		lnet_net_lock(cpt);
@@ -1962,7 +1962,7 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats,
 
 void
 lnet_drop_message(struct lnet_ni *ni, int cpt, void *private, unsigned int nob,
-		  __u32 msg_type)
+		  u32 msg_type)
 {
 	lnet_net_lock(cpt);
 	lnet_incr_stats(&ni->ni_stats, msg_type, LNET_STATS_TYPE_DROP);
@@ -2383,8 +2383,8 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats,
 	lnet_nid_t dest_nid;
 	lnet_nid_t src_nid;
 	struct lnet_peer_ni *lpni;
-	__u32 payload_length;
-	__u32 type;
+	u32 payload_length;
+	u32 type;
 
 	LASSERT(!in_interrupt());
 
@@ -2418,7 +2418,7 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats,
 	case LNET_MSG_PUT:
 	case LNET_MSG_REPLY:
 		if (payload_length >
-		   (__u32)(for_me ? LNET_MAX_PAYLOAD : LNET_MTU)) {
+		   (u32)(for_me ? LNET_MAX_PAYLOAD : LNET_MTU)) {
 			CERROR("%s, src %s: bad %s payload %d (%d max expected)\n",
 			       libcfs_nid2str(from_nid),
 			       libcfs_nid2str(src_nid),
@@ -2741,8 +2741,8 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats,
 int
 LNetPut(lnet_nid_t self, struct lnet_handle_md mdh, enum lnet_ack_req ack,
 	struct lnet_process_id target, unsigned int portal,
-	__u64 match_bits, unsigned int offset,
-	__u64 hdr_data)
+	u64 match_bits, unsigned int offset,
+	u64 hdr_data)
 {
 	struct lnet_msg *msg;
 	struct lnet_libmd *md;
@@ -2948,7 +2948,7 @@ struct lnet_msg *
 int
 LNetGet(lnet_nid_t self, struct lnet_handle_md mdh,
 	struct lnet_process_id target, unsigned int portal,
-	__u64 match_bits, unsigned int offset)
+	u64 match_bits, unsigned int offset)
 {
 	struct lnet_msg *msg;
 	struct lnet_libmd *md;
@@ -3037,14 +3037,14 @@ struct lnet_msg *
  * \retval -EHOSTUNREACH If \a dstnid is not reachable.
  */
 int
-LNetDist(lnet_nid_t dstnid, lnet_nid_t *srcnidp, __u32 *orderp)
+LNetDist(lnet_nid_t dstnid, lnet_nid_t *srcnidp, u32 *orderp)
 {
 	struct lnet_ni *ni = NULL;
 	struct lnet_remotenet *rnet;
-	__u32 dstnet = LNET_NIDNET(dstnid);
+	u32 dstnet = LNET_NIDNET(dstnid);
 	int hops;
 	int cpt;
-	__u32 order = 2;
+	u32 order = 2;
 	struct list_head *rn_list;
 
 	/*
@@ -3098,8 +3098,8 @@ struct lnet_msg *
 		if (rnet->lrn_net == dstnet) {
 			struct lnet_route *route;
 			struct lnet_route *shortest = NULL;
-			__u32 shortest_hops = LNET_UNDEFINED_HOPS;
-			__u32 route_hops;
+			u32 shortest_hops = LNET_UNDEFINED_HOPS;
+			u32 route_hops;
 
 			LASSERT(!list_empty(&rnet->lrn_routes));
 
drivers/staging/lustre/lnet/lnet/lib-ptl.c +7 -7
index 6fa5bbf..fa391ee 100644
@@ -41,7 +41,7 @@
 
 static int
 lnet_ptl_match_type(unsigned int index, struct lnet_process_id match_id,
-		    __u64 mbits, __u64 ignore_bits)
+		    u64 mbits, u64 ignore_bits)
 {
 	struct lnet_portal *ptl = the_lnet.ln_portals[index];
 	int unique;
@@ -213,7 +213,7 @@
 }
 
 static struct lnet_match_table *
-lnet_match2mt(struct lnet_portal *ptl, struct lnet_process_id id, __u64 mbits)
+lnet_match2mt(struct lnet_portal *ptl, struct lnet_process_id id, u64 mbits)
 {
 	if (LNET_CPT_NUMBER == 1)
 		return ptl->ptl_mtables[0]; /* the only one */
@@ -225,7 +225,7 @@
 
 struct lnet_match_table *
 lnet_mt_of_attach(unsigned int index, struct lnet_process_id id,
-		  __u64 mbits, __u64 ignore_bits, enum lnet_ins_pos pos)
+		  u64 mbits, u64 ignore_bits, enum lnet_ins_pos pos)
 {
 	struct lnet_portal *ptl;
 	struct lnet_match_table	*mtable;
@@ -316,7 +316,7 @@ struct lnet_match_table *
 static int
 lnet_mt_test_exhausted(struct lnet_match_table *mtable, int pos)
 {
-	__u64 *bmap;
+	u64 *bmap;
 	int i;
 
 	if (!lnet_ptl_is_wildcard(the_lnet.ln_portals[mtable->mt_portal]))
@@ -324,7 +324,7 @@ struct lnet_match_table *
 
 	if (pos < 0) { /* check all bits */
 		for (i = 0; i < LNET_MT_EXHAUSTED_BMAP; i++) {
-			if (mtable->mt_exhausted[i] != (__u64)(-1))
+			if (mtable->mt_exhausted[i] != (u64)(-1))
 				return 0;
 		}
 		return 1;
@@ -341,7 +341,7 @@ struct lnet_match_table *
 static void
 lnet_mt_set_exhausted(struct lnet_match_table *mtable, int pos, int exhausted)
 {
-	__u64 *bmap;
+	u64 *bmap;
 
 	LASSERT(lnet_ptl_is_wildcard(the_lnet.ln_portals[mtable->mt_portal]));
 	LASSERT(pos <= LNET_MT_HASH_IGNORE);
@@ -358,7 +358,7 @@ struct lnet_match_table *
 
 struct list_head *
 lnet_mt_match_head(struct lnet_match_table *mtable,
-		   struct lnet_process_id id, __u64 mbits)
+		   struct lnet_process_id id, u64 mbits)
 {
 	struct lnet_portal *ptl = the_lnet.ln_portals[mtable->mt_portal];
 	unsigned long hash = mbits;
drivers/staging/lustre/lnet/lnet/lib-socket.c +5 -5
index 62a742e..cff3d1e 100644
@@ -146,7 +146,7 @@
 EXPORT_SYMBOL(lnet_sock_read);
 
 static int
-lnet_sock_create(struct socket **sockp, int *fatal, __u32 local_ip,
+lnet_sock_create(struct socket **sockp, int *fatal, u32 local_ip,
 		 int local_port)
 {
 	struct sockaddr_in locaddr;
@@ -233,7 +233,7 @@
 EXPORT_SYMBOL(lnet_sock_setbuf);
 
 int
-lnet_sock_getaddr(struct socket *sock, bool remote, __u32 *ip, int *port)
+lnet_sock_getaddr(struct socket *sock, bool remote, u32 *ip, int *port)
 {
 	struct sockaddr_in sin;
 	int rc;
@@ -272,7 +272,7 @@
 EXPORT_SYMBOL(lnet_sock_getbuf);
 
 int
-lnet_sock_listen(struct socket **sockp, __u32 local_ip, int local_port,
+lnet_sock_listen(struct socket **sockp, u32 local_ip, int local_port,
 		 int backlog)
 {
 	int fatal;
@@ -337,8 +337,8 @@
 }
 
 int
-lnet_sock_connect(struct socket **sockp, int *fatal, __u32 local_ip,
-		  int local_port, __u32 peer_ip, int peer_port)
+lnet_sock_connect(struct socket **sockp, int *fatal, u32 local_ip,
+		  int local_port, u32 peer_ip, int peer_port)
 {
 	struct sockaddr_in srvaddr;
 	int rc;
drivers/staging/lustre/lnet/lnet/nidstrings.c +44 -44

234 lines not on this page · raw message

drivers/staging/lustre/lnet/lnet/peer.c +10 -10
index db36b5c..d807dd4 100644
@@ -697,17 +697,17 @@ struct lnet_peer_ni *
 
 /* Call with the ln_api_mutex held */
 int
-lnet_get_peer_list(__u32 *countp, __u32 *sizep,
+lnet_get_peer_list(u32 *countp, u32 *sizep,
 		   struct lnet_process_id __user *ids)
 {
 	struct lnet_process_id id;
 	struct lnet_peer_table *ptable;
 	struct lnet_peer *lp;
-	__u32 count = 0;
-	__u32 size = 0;
+	u32 count = 0;
+	u32 size = 0;
 	int lncpt;
 	int cpt;
-	__u32 i;
+	u32 i;
 	int rc;
 
 	rc = -ESHUTDOWN;
@@ -3234,12 +3234,12 @@ void lnet_peer_discovery_stop(void)
 /* Gathering information for userspace. */
 
 int
-lnet_get_peer_ni_info(__u32 peer_index, __u64 *nid,
+lnet_get_peer_ni_info(u32 peer_index, u64 *nid,
 		      char aliveness[LNET_MAX_STR_LEN],
-		      __u32 *cpt_iter, __u32 *refcount,
-		      __u32 *ni_peer_tx_credits, __u32 *peer_tx_credits,
-		      __u32 *peer_rtr_credits, __u32 *peer_min_rtr_credits,
-		      __u32 *peer_tx_qnob)
+		      u32 *cpt_iter, u32 *refcount,
+		      u32 *ni_peer_tx_credits, u32 *peer_tx_credits,
+		      u32 *peer_rtr_credits, u32 *peer_min_rtr_credits,
+		      u32 *peer_tx_qnob)
 {
 	struct lnet_peer_table *peer_table;
 	struct lnet_peer_ni *lp;
@@ -3305,7 +3305,7 @@ int lnet_get_peer_info(struct lnet_ioctl_peer_cfg *cfg, void __user *bulk)
 	struct lnet_peer_ni *lpni;
 	struct lnet_peer *lp;
 	lnet_nid_t nid;
-	__u32 size;
+	u32 size;
 	int rc;
 
 	lp = lnet_find_peer(cfg->prcfg_prim_nid);
drivers/staging/lustre/lnet/lnet/router.c +8 -8
index 86cce27..22c88ec 100644
@@ -247,7 +247,7 @@
 }
 
 struct lnet_remotenet *
-lnet_find_rnet_locked(__u32 net)
+lnet_find_rnet_locked(u32 net)
 {
 	struct lnet_remotenet *rnet;
 	struct list_head *rn_list;
@@ -273,7 +273,7 @@ static void lnet_shuffle_seed(void)
 	/* Nodes with small feet have little entropy
 	 * the NID for this node gives the most entropy in the low bits */
 	while ((ni = lnet_get_next_ni_locked(NULL, ni))) {
-		__u32 lnd_type, seed;
+		u32 lnd_type, seed;
 		lnd_type = LNET_NETTYP(LNET_NIDNET(ni->ni_nid));
 		if (lnd_type != LOLND) {
 			seed = (LNET_NIDADDR(ni->ni_nid) | lnd_type);
@@ -313,7 +313,7 @@ static void lnet_shuffle_seed(void)
 }
 
 int
-lnet_add_route(__u32 net, __u32 hops, lnet_nid_t gateway,
+lnet_add_route(u32 net, u32 hops, lnet_nid_t gateway,
 	       unsigned int priority)
 {
 	struct lnet_remotenet *rnet;
@@ -479,7 +479,7 @@ static void lnet_shuffle_seed(void)
 }
 
 int
-lnet_del_route(__u32 net, lnet_nid_t gw_nid)
+lnet_del_route(u32 net, lnet_nid_t gw_nid)
 {
 	struct lnet_peer_ni *gateway;
 	struct lnet_remotenet *rnet;
@@ -585,8 +585,8 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
 }
 
 int
-lnet_get_route(int idx, __u32 *net, __u32 *hops,
-	       lnet_nid_t *gateway, __u32 *alive, __u32 *priority)
+lnet_get_route(int idx, u32 *net, u32 *hops,
+	       lnet_nid_t *gateway, u32 *alive, u32 *priority)
 {
 	struct lnet_remotenet *rnet;
 	struct lnet_route *route;
@@ -836,7 +836,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
 }
 
 void
-lnet_router_ni_update_locked(struct lnet_peer_ni *gw, __u32 net)
+lnet_router_ni_update_locked(struct lnet_peer_ni *gw, u32 net)
 {
 	struct lnet_route *rte;
 
@@ -1274,7 +1274,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg)
 	struct lnet_peer_ni *rtr;
 
 	while (the_lnet.ln_rc_state == LNET_RC_STATE_RUNNING) {
-		__u64 version;
+		u64 version;
 		int cpt;
 		int cpt2;
 
drivers/staging/lustre/lnet/lnet/router_proc.c +2 -2
index 236b5a1..e8cc70f 100644
@@ -211,8 +211,8 @@ static int proc_lnet_routes(struct ctl_table *table, int write,
 		}
 
 		if (route) {
-			__u32 net = rnet->lrn_net;
-			__u32 hops = route->lr_hops;
+			u32 net = rnet->lrn_net;
+			u32 hops = route->lr_hops;
 			unsigned int priority = route->lr_priority;
 			lnet_nid_t nid = route->lr_gateway->lpni_nid;
 			int alive = lnet_is_route_alive(route);
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 2/26 lnet: use kernel types for lnet klnd kernel code

In reply to James Simmons

LNet klnd drivers was originally both a user land and kernel implementation. The source contains many types of the form __u32 but since this is mostly kernel code change the types to kernel internal types.

---
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c    |  30 ++---
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h    | 126 ++++++++++-----------
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c |  22 ++--
 .../staging/lustre/lnet/klnds/socklnd/socklnd.c    |  54 ++++-----
 .../staging/lustre/lnet/klnds/socklnd/socklnd.h    |  44 +++----
 .../staging/lustre/lnet/klnds/socklnd/socklnd_cb.c |   8 +-
 .../lustre/lnet/klnds/socklnd/socklnd_lib.c        |   4 +-
 .../lustre/lnet/klnds/socklnd/socklnd_proto.c      |  24 ++--
 8 files changed, 156 insertions(+), 156 deletions(-)
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +15 -15
index bd7ff7d..1a6bc45 100644
@@ -44,10 +44,10 @@
 
 struct kib_data kiblnd_data;
 
-static __u32 kiblnd_cksum(void *ptr, int nob)
+static u32 kiblnd_cksum(void *ptr, int nob)
 {
 	char *c = ptr;
-	__u32 sum = 0;
+	u32 sum = 0;
 
 	while (nob-- > 0)
 		sum = ((sum << 1) | (sum >> 31)) + *c++;
@@ -175,7 +175,7 @@ static int kiblnd_unpack_rd(struct kib_msg *msg, int flip)
 }
 
 void kiblnd_pack_msg(struct lnet_ni *ni, struct kib_msg *msg, int version,
-		     int credits, lnet_nid_t dstnid, __u64 dststamp)
+		     int credits, lnet_nid_t dstnid, u64 dststamp)
 {
 	struct kib_net *net = ni->ni_data;
 
@@ -203,8 +203,8 @@ void kiblnd_pack_msg(struct lnet_ni *ni, struct kib_msg *msg, int version,
 int kiblnd_unpack_msg(struct kib_msg *msg, int nob)
 {
 	const int hdr_size = offsetof(struct kib_msg, ibm_u);
-	__u32 msg_cksum;
-	__u16 version;
+	u32 msg_cksum;
+	u16 version;
 	int msg_nob;
 	int flip;
 
@@ -994,7 +994,7 @@ int kiblnd_close_peer_conns_locked(struct kib_peer_ni *peer_ni, int why)
 }
 
 int kiblnd_close_stale_conns_locked(struct kib_peer_ni *peer_ni,
-				    int version, __u64 incarnation)
+				    int version, u64 incarnation)
 {
 	struct kib_conn *conn;
 	struct list_head *ctmp;
@@ -1240,7 +1240,7 @@ void kiblnd_map_rx_descs(struct kib_conn *conn)
 
 		CDEBUG(D_NET, "rx %d: %p %#llx(%#llx)\n",
 		       i, rx->rx_msg, rx->rx_msgaddr,
-		       (__u64)(page_to_phys(pg) + pg_off));
+		       (u64)(page_to_phys(pg) + pg_off));
 
 		pg_off += IBLND_MSG_SIZE;
 		LASSERT(pg_off <= PAGE_SIZE);
@@ -1610,7 +1610,7 @@ static int kiblnd_fmr_pool_is_idle(struct kib_fmr_pool *fpo, time64_t now)
 static int
 kiblnd_map_tx_pages(struct kib_tx *tx, struct kib_rdma_desc *rd)
 {
-	__u64 *pages = tx->tx_pages;
+	u64 *pages = tx->tx_pages;
 	struct kib_hca_dev *hdev;
 	int npages;
 	int size;
@@ -1685,15 +1685,15 @@ void kiblnd_fmr_pool_unmap(struct kib_fmr *fmr, int status)
 }
 
 int kiblnd_fmr_pool_map(struct kib_fmr_poolset *fps, struct kib_tx *tx,
-			struct kib_rdma_desc *rd, __u32 nob, __u64 iov,
+			struct kib_rdma_desc *rd, u32 nob, u64 iov,
 			struct kib_fmr *fmr)
 {
-	__u64 *pages = tx->tx_pages;
+	u64 *pages = tx->tx_pages;
 	bool is_rx = (rd != tx->tx_rd);
 	bool tx_pages_mapped = false;
 	struct kib_fmr_pool *fpo;
 	int npages = 0;
-	__u64 version;
+	u64 version;
 	int rc;
 
  again:
@@ -1740,7 +1740,7 @@ int kiblnd_fmr_pool_map(struct kib_fmr_poolset *fps, struct kib_tx *tx,
 				mr = frd->frd_mr;
 
 				if (!frd->frd_valid) {
-					__u32 key = is_rx ? mr->rkey : mr->lkey;
+					u32 key = is_rx ? mr->rkey : mr->lkey;
 					struct ib_send_wr *inv_wr;
 
 					inv_wr = &frd->frd_inv_wr;
@@ -2204,7 +2204,7 @@ static void kiblnd_net_fini_pools(struct kib_net *net)
 }
 
 static int kiblnd_net_init_pools(struct kib_net *net, struct lnet_ni *ni,
-				 __u32 *cpts, int ncpts)
+				 u32 *cpts, int ncpts)
 {
 	struct lnet_ioctl_config_o2iblnd_tunables *tunables;
 	int cpt;
@@ -2303,7 +2303,7 @@ static int kiblnd_hdev_get_attr(struct kib_hca_dev *hdev)
 	 */
 	hdev->ibh_page_shift = PAGE_SHIFT;
 	hdev->ibh_page_size  = 1 << PAGE_SHIFT;
-	hdev->ibh_page_mask  = ~((__u64)hdev->ibh_page_size - 1);
+	hdev->ibh_page_mask  = ~((u64)hdev->ibh_page_size - 1);
 
 	if (hdev->ibh_ibdev->ops.alloc_fmr &&
 	    hdev->ibh_ibdev->ops.dealloc_fmr &&
@@ -2878,7 +2878,7 @@ static int kiblnd_start_schedulers(struct kib_sched_info *sched)
 	return rc;
 }
 
-static int kiblnd_dev_start_threads(struct kib_dev *dev, int newdev, __u32 *cpts,
+static int kiblnd_dev_start_threads(struct kib_dev *dev, int newdev, u32 *cpts,
 				    int ncpts)
 {
 	int cpt;
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h +63 -63

334 lines not on this page · raw message

drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c +11 -11
index 57fe037..48f2814 100644
@@ -47,7 +47,7 @@ static void kiblnd_init_tx_msg(struct lnet_ni *ni, struct kib_tx *tx,
 			       int type, int body_nob);
 static int kiblnd_init_rdma(struct kib_conn *conn, struct kib_tx *tx, int type,
 			    int resid, struct kib_rdma_desc *dstrd,
-			    __u64 dstcookie);
+			    u64 dstcookie);
 static void kiblnd_queue_tx_locked(struct kib_tx *tx, struct kib_conn *conn);
 static void kiblnd_queue_tx(struct kib_tx *tx, struct kib_conn *conn);
 static void kiblnd_unmap_tx(struct kib_tx *tx);
@@ -223,7 +223,7 @@ static int kiblnd_init_rdma(struct kib_conn *conn, struct kib_tx *tx, int type,
 }
 
 static struct kib_tx *
-kiblnd_find_waiting_tx_locked(struct kib_conn *conn, int txtype, __u64 cookie)
+kiblnd_find_waiting_tx_locked(struct kib_conn *conn, int txtype, u64 cookie)
 {
 	struct kib_tx *tx;
 
@@ -246,7 +246,7 @@ static int kiblnd_init_rdma(struct kib_conn *conn, struct kib_tx *tx, int type,
 }
 
 static void
-kiblnd_handle_completion(struct kib_conn *conn, int txtype, int status, __u64 cookie)
+kiblnd_handle_completion(struct kib_conn *conn, int txtype, int status, u64 cookie)
 {
 	struct kib_tx *tx;
 	struct lnet_ni *ni = conn->ibc_peer->ibp_ni;
@@ -284,7 +284,7 @@ static int kiblnd_init_rdma(struct kib_conn *conn, struct kib_tx *tx, int type,
 }
 
 static void
-kiblnd_send_completion(struct kib_conn *conn, int type, int status, __u64 cookie)
+kiblnd_send_completion(struct kib_conn *conn, int type, int status, u64 cookie)
 {
 	struct lnet_ni *ni = conn->ibc_peer->ibp_ni;
 	struct kib_tx *tx = kiblnd_get_idle_tx(ni, conn->ibc_peer->ibp_nid);
@@ -536,7 +536,7 @@ static int kiblnd_init_rdma(struct kib_conn *conn, struct kib_tx *tx, int type,
 }
 
 static int
-kiblnd_fmr_map_tx(struct kib_net *net, struct kib_tx *tx, struct kib_rdma_desc *rd, __u32 nob)
+kiblnd_fmr_map_tx(struct kib_net *net, struct kib_tx *tx, struct kib_rdma_desc *rd, u32 nob)
 {
 	struct kib_hca_dev *hdev;
 	struct kib_fmr_poolset *fps;
@@ -637,7 +637,7 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
 {
 	struct kib_net *net = ni->ni_data;
 	struct kib_hca_dev *hdev = net->ibn_dev->ibd_hdev;
-	__u32 nob;
+	u32 nob;
 	int i;
 
 	/*
@@ -1086,7 +1086,7 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
 
 static int
 kiblnd_init_rdma(struct kib_conn *conn, struct kib_tx *tx, int type,
-		 int resid, struct kib_rdma_desc *dstrd, __u64 dstcookie)
+		 int resid, struct kib_rdma_desc *dstrd, u64 dstcookie)
 {
 	struct kib_msg *ibmsg = tx->tx_msg;
 	struct kib_rdma_desc *srcrd = tx->tx_rd;
@@ -2296,7 +2296,7 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid,
 	peer_addr = (struct sockaddr_in *)&cmid->route.addr.dst_addr;
 	if (*kiblnd_tunables.kib_require_priv_port &&
 	    ntohs(peer_addr->sin_port) >= PROT_SOCK) {
-		__u32 ip = ntohl(peer_addr->sin_addr.s_addr);
+		u32 ip = ntohl(peer_addr->sin_addr.s_addr);
 
 		CERROR("peer_ni's port (%pI4h:%hu) is not privileged\n",
 		       &ip, ntohs(peer_addr->sin_port));
@@ -2589,7 +2589,7 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid,
 
 static void
 kiblnd_check_reconnect(struct kib_conn *conn, int version,
-		       __u64 incarnation, int why, struct kib_connparams *cp)
+		       u64 incarnation, int why, struct kib_connparams *cp)
 {
 	rwlock_t *glock = &kiblnd_data.kib_global_lock;
 	struct kib_peer_ni *peer_ni = conn->ibc_peer;
@@ -2734,7 +2734,7 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid,
 			struct kib_rej *rej = priv;
 			struct kib_connparams *cp = NULL;
 			int flip = 0;
-			__u64 incarnation = -1;
+			u64 incarnation = -1;
 
 			/* NB. default incarnation is -1 because:
 			 * a) V1 will ignore dst incarnation in connreq.
@@ -2947,7 +2947,7 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid,
 	struct kib_msg *msg;
 	struct rdma_conn_param cp;
 	int version;
-	__u64 incarnation;
+	u64 incarnation;
 	unsigned long flags;
 	int rc;
 
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c +27 -27

203 lines not on this page · raw message

drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h +22 -22

118 lines not on this page · raw message

drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c +4 -4
index 4abf0eb..dd4fb69 100644
@@ -64,7 +64,7 @@ struct ksock_tx *
 }
 
 struct ksock_tx *
-ksocknal_alloc_tx_noop(__u64 cookie, int nonblk)
+ksocknal_alloc_tx_noop(u64 cookie, int nonblk)
 {
 	struct ksock_tx *tx;
 
@@ -1126,7 +1126,7 @@ struct ksock_route *
 		}
 
 		if (conn->ksnc_msg.ksm_zc_cookies[1]) {
-			__u64 cookie = 0;
+			u64 cookie = 0;
 
 			LASSERT(conn->ksnc_proto != &ksocknal_protocol_v1x);
 
@@ -1533,7 +1533,7 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 static struct ksock_proto *
 ksocknal_parse_proto_version(struct ksock_hello_msg *hello)
 {
-	__u32 version = 0;
+	u32 version = 0;
 
 	if (hello->kshm_magic == LNET_PROTO_MAGIC)
 		version = hello->kshm_version;
@@ -1614,7 +1614,7 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 ksocknal_recv_hello(struct lnet_ni *ni, struct ksock_conn *conn,
 		    struct ksock_hello_msg *hello,
 		    struct lnet_process_id *peerid,
-		    __u64 *incarnation)
+		    u64 *incarnation)
 {
 	/* Return < 0	fatal error
 	 *	0	  success
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c +2 -2
index 686c2d3..565c50c 100644
@@ -175,7 +175,7 @@ static int lustre_csum(struct kvec *v, void *context)
 ksocknal_lib_recv(struct ksock_conn *conn)
 {
 	struct msghdr msg = { .msg_iter = conn->ksnc_rx_to };
-	__u32 saved_csum;
+	u32 saved_csum;
 	int rc;
 
 	rc = sock_recvmsg(conn->ksnc_sock, &msg, MSG_DONTWAIT);
@@ -203,7 +203,7 @@ static int lustre_csum(struct kvec *v, void *context)
 ksocknal_lib_csum_tx(struct ksock_tx *tx)
 {
 	int i;
-	__u32 csum;
+	u32 csum;
 	void *base;
 
 	LASSERT(tx->tx_iov[0].iov_base == &tx->tx_msg);
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c +12 -12
index 54ec5d0..91bed59 100644
@@ -68,7 +68,7 @@
 
 static int
 ksocknal_queue_tx_zcack_v2(struct ksock_conn *conn,
-			   struct ksock_tx *tx_ack, __u64 cookie)
+			   struct ksock_tx *tx_ack, u64 cookie)
 {
 	struct ksock_tx *tx = conn->ksnc_tx_carrier;
 
@@ -151,7 +151,7 @@
 
 static int
 ksocknal_queue_tx_zcack_v3(struct ksock_conn *conn,
-			   struct ksock_tx *tx_ack, __u64 cookie)
+			   struct ksock_tx *tx_ack, u64 cookie)
 {
 	struct ksock_tx *tx;
 
@@ -220,7 +220,7 @@
 	/* takes two or more cookies already */
 
 	if (tx->tx_msg.ksm_zc_cookies[0] > tx->tx_msg.ksm_zc_cookies[1]) {
-		__u64   tmp = 0;
+		u64   tmp = 0;
 
 		/* two separated cookies: (a+2, a) or (a+1, a) */
 		LASSERT(tx->tx_msg.ksm_zc_cookies[0] -
@@ -365,7 +365,7 @@
 
 /* (Sink) handle incoming ZC request from sender */
 static int
-ksocknal_handle_zcreq(struct ksock_conn *c, __u64 cookie, int remote)
+ksocknal_handle_zcreq(struct ksock_conn *c, u64 cookie, int remote)
 {
 	struct ksock_peer *peer_ni = c->ksnc_peer;
 	struct ksock_conn *conn;
@@ -409,7 +409,7 @@
 
 /* (Sender) handle ZC_ACK from sink */
 static int
-ksocknal_handle_zcack(struct ksock_conn *conn, __u64 cookie1, __u64 cookie2)
+ksocknal_handle_zcack(struct ksock_conn *conn, u64 cookie1, u64 cookie2)
 {
 	struct ksock_peer *peer_ni = conn->ksnc_peer;
 	struct ksock_tx *tx;
@@ -432,7 +432,7 @@
 
 	list_for_each_entry_safe(tx, tmp, &peer_ni->ksnp_zc_req_list,
 				 tx_zc_list) {
-		__u64 c = tx->tx_msg.ksm_zc_cookies[0];
+		u64 c = tx->tx_msg.ksm_zc_cookies[0];
 
 		if (c == cookie1 || c == cookie2 ||
 		    (cookie1 < c && c < cookie2)) {
@@ -500,7 +500,7 @@
 	hdr->src_nid = cpu_to_le64(hello->kshm_src_nid);
 	hdr->src_pid = cpu_to_le32(hello->kshm_src_pid);
 	hdr->type = cpu_to_le32(LNET_MSG_HELLO);
-	hdr->payload_length = cpu_to_le32(hello->kshm_nips * sizeof(__u32));
+	hdr->payload_length = cpu_to_le32(hello->kshm_nips * sizeof(u32));
 	hdr->msg.hello.type = cpu_to_le32(hello->kshm_ctype);
 	hdr->msg.hello.incarnation = cpu_to_le64(hello->kshm_src_incarnation);
 
@@ -518,7 +518,7 @@
 		hello->kshm_ips[i] = __cpu_to_le32(hello->kshm_ips[i]);
 
 	rc = lnet_sock_write(sock, hello->kshm_ips,
-			     hello->kshm_nips * sizeof(__u32),
+			     hello->kshm_nips * sizeof(u32),
 			     lnet_acceptor_timeout());
 	if (rc) {
 		CNETERR("Error %d sending HELLO payload (%d) to %pI4h/%d\n",
@@ -562,7 +562,7 @@
 		return 0;
 
 	rc = lnet_sock_write(sock, hello->kshm_ips,
-			     hello->kshm_nips * sizeof(__u32),
+			     hello->kshm_nips * sizeof(u32),
 			     lnet_acceptor_timeout());
 	if (rc) {
 		CNETERR("Error %d sending HELLO payload (%d) to %pI4h/%d\n",
@@ -612,7 +612,7 @@
 	hello->kshm_src_incarnation = le64_to_cpu(hdr->msg.hello.incarnation);
 	hello->kshm_ctype           = le32_to_cpu(hdr->msg.hello.type);
 	hello->kshm_nips            = le32_to_cpu(hdr->payload_length) /
-						  sizeof(__u32);
+						  sizeof(u32);
 
 	if (hello->kshm_nips > LNET_INTERFACES_NUM) {
 		CERROR("Bad nips %d from ip %pI4h\n",
@@ -625,7 +625,7 @@
 		goto out;
 
 	rc = lnet_sock_read(sock, hello->kshm_ips,
-			    hello->kshm_nips * sizeof(__u32), timeout);
+			    hello->kshm_nips * sizeof(u32), timeout);
 	if (rc) {
 		CERROR("Error %d reading IPs from ip %pI4h\n",
 		       rc, &conn->ksnc_ipaddr);
@@ -694,7 +694,7 @@
 		return 0;
 
 	rc = lnet_sock_read(sock, hello->kshm_ips,
-			    hello->kshm_nips * sizeof(__u32), timeout);
+			    hello->kshm_nips * sizeof(u32), timeout);
 	if (rc) {
 		CERROR("Error %d reading IPs from ip %pI4h\n",
 		       rc, &conn->ksnc_ipaddr);
Signature · 1 line
1.8.3.1
#3 lore raw

PATCH 3/26 lnet: use kernel types for lnet selftest kernel code

In reply to James Simmons

LNet self test was originally both a user land and kernel implementation. The source contains many types of the form __u32 but since this is mostly kernel code change the types to kernel internal types.

---
 drivers/staging/lustre/lnet/selftest/brw_test.c |  20 ++--
 drivers/staging/lustre/lnet/selftest/console.h  |   2 +-
 drivers/staging/lustre/lnet/selftest/rpc.c      |  22 ++--
 drivers/staging/lustre/lnet/selftest/rpc.h      | 132 ++++++++++++------------
 4 files changed, 88 insertions(+), 88 deletions(-)
drivers/staging/lustre/lnet/selftest/brw_test.c +10 -10
index e372ff3..eb8b1e9 100644
@@ -153,7 +153,7 @@ static int brw_inject_one_error(void)
 }
 
 static void
-brw_fill_page(struct page *pg, int off, int len, int pattern, __u64 magic)
+brw_fill_page(struct page *pg, int off, int len, int pattern, u64 magic)
 {
 	char *addr = page_address(pg) + off;
 	int i;
@@ -186,10 +186,10 @@ static int brw_inject_one_error(void)
 }
 
 static int
-brw_check_page(struct page *pg, int off, int len, int pattern, __u64 magic)
+brw_check_page(struct page *pg, int off, int len, int pattern, u64 magic)
 {
 	char *addr = page_address(pg) + off;
-	__u64 data = 0; /* make compiler happy */
+	u64 data = 0; /* make compiler happy */
 	int i;
 
 	LASSERT(addr);
@@ -199,13 +199,13 @@ static int brw_inject_one_error(void)
 		return 0;
 
 	if (pattern == LST_BRW_CHECK_SIMPLE) {
-		data = *((__u64 *)addr);
+		data = *((u64 *)addr);
 		if (data != magic)
 			goto bad_data;
 
 		if (len > BRW_MSIZE) {
 			addr += PAGE_SIZE - BRW_MSIZE;
-			data = *((__u64 *)addr);
+			data = *((u64 *)addr);
 			if (data != magic)
 				goto bad_data;
 		}
@@ -230,7 +230,7 @@ static int brw_inject_one_error(void)
 }
 
 static void
-brw_fill_bulk(struct srpc_bulk *bk, int pattern, __u64 magic)
+brw_fill_bulk(struct srpc_bulk *bk, int pattern, u64 magic)
 {
 	int i;
 	struct page *pg;
@@ -246,7 +246,7 @@ static int brw_inject_one_error(void)
 }
 
 static int
-brw_check_bulk(struct srpc_bulk *bk, int pattern, __u64 magic)
+brw_check_bulk(struct srpc_bulk *bk, int pattern, u64 magic)
 {
 	int i;
 	struct page *pg;
@@ -331,7 +331,7 @@ static int brw_inject_one_error(void)
 static void
 brw_client_done_rpc(struct sfw_test_unit *tsu, struct srpc_client_rpc *rpc)
 {
-	__u64 magic = BRW_MAGIC;
+	u64 magic = BRW_MAGIC;
 	struct sfw_test_instance *tsi = tsu->tsu_instance;
 	struct sfw_session *sn = tsi->tsi_batch->bat_session;
 	struct srpc_msg *msg = &rpc->crpc_replymsg;
@@ -397,7 +397,7 @@ static int brw_inject_one_error(void)
 static int
 brw_bulk_ready(struct srpc_server_rpc *rpc, int status)
 {
-	__u64 magic = BRW_MAGIC;
+	u64 magic = BRW_MAGIC;
 	struct srpc_brw_reply *reply = &rpc->srpc_replymsg.msg_body.brw_reply;
 	struct srpc_brw_reqst *reqst;
 	struct srpc_msg *reqstmsg;
@@ -452,7 +452,7 @@ static int brw_inject_one_error(void)
 		__swab64s(&reqst->brw_rpyid);
 		__swab64s(&reqst->brw_bulkid);
 	}
-	LASSERT(reqstmsg->msg_type == (__u32)srpc_service2request(sv->sv_id));
+	LASSERT(reqstmsg->msg_type == (u32)srpc_service2request(sv->sv_id));
 
 	reply->brw_status = 0;
 	rpc->srpc_done = brw_server_rpc_done;
drivers/staging/lustre/lnet/selftest/console.h +1 -1
index eaad07c..b5709a4 100644
@@ -153,7 +153,7 @@ struct lstcon_session {
 	unsigned int	    ses_force:1;      /* force creating */
 	unsigned int	    ses_shutdown:1;   /* session is shutting down */
 	unsigned int	    ses_expired:1;    /* console is timedout */
-	__u64		    ses_id_cookie;    /* batch id cookie */
+	u64		    ses_id_cookie;    /* batch id cookie */
 	char		    ses_name[LST_NAME_SIZE];/* session name */
 	struct lstcon_rpc_trans	*ses_ping;		/* session pinger */
 	struct stt_timer	 ses_ping_timer;   /* timer for pinger */
drivers/staging/lustre/lnet/selftest/rpc.c +11 -11
index 26132ab..2a30107 100644
@@ -57,7 +57,7 @@ enum srpc_state {
 	struct lnet_handle_eq	 rpc_lnet_eq;	/* _the_ LNet event queue */
 	enum srpc_state	 rpc_state;
 	struct srpc_counters	 rpc_counters;
-	__u64		 rpc_matchbits;	/* matchbits counter */
+	u64		 rpc_matchbits;	/* matchbits counter */
 } srpc_data;
 
 static inline int
@@ -159,10 +159,10 @@ struct srpc_bulk *
 	return bk;
 }
 
-static inline __u64
+static inline u64
 srpc_next_id(void)
 {
-	__u64 id;
+	u64 id;
 
 	spin_lock(&srpc_data.rpc_glock);
 	id = srpc_data.rpc_matchbits++;
@@ -354,7 +354,7 @@ struct srpc_bulk *
 }
 
 static int
-srpc_post_passive_rdma(int portal, int local, __u64 matchbits, void *buf,
+srpc_post_passive_rdma(int portal, int local, u64 matchbits, void *buf,
 		       int len, int options, struct lnet_process_id peer,
 		       struct lnet_handle_md *mdh, struct srpc_event *ev)
 {
@@ -393,7 +393,7 @@ struct srpc_bulk *
 }
 
 static int
-srpc_post_active_rdma(int portal, __u64 matchbits, void *buf, int len,
+srpc_post_active_rdma(int portal, u64 matchbits, void *buf, int len,
 		      int options, struct lnet_process_id peer,
 		      lnet_nid_t self, struct lnet_handle_md *mdh,
 		      struct srpc_event *ev)
@@ -813,7 +813,7 @@ struct srpc_bulk *
 srpc_prepare_reply(struct srpc_client_rpc *rpc)
 {
 	struct srpc_event *ev = &rpc->crpc_replyev;
-	__u64 *id = &rpc->crpc_reqstmsg.msg_body.reqst.rpyid;
+	u64 *id = &rpc->crpc_reqstmsg.msg_body.reqst.rpyid;
 	int rc;
 
 	ev->ev_fired = 0;
@@ -839,7 +839,7 @@ struct srpc_bulk *
 {
 	struct srpc_bulk *bk = &rpc->crpc_bulk;
 	struct srpc_event *ev = &rpc->crpc_bulkev;
-	__u64 *id = &rpc->crpc_reqstmsg.msg_body.reqst.bulkid;
+	u64 *id = &rpc->crpc_reqstmsg.msg_body.reqst.bulkid;
 	int rc;
 	int opt;
 
@@ -872,7 +872,7 @@ struct srpc_bulk *
 {
 	struct srpc_event *ev = &rpc->srpc_ev;
 	struct srpc_bulk *bk = rpc->srpc_bulk;
-	__u64 id = rpc->srpc_reqstbuf->buf_msg.msg_body.reqst.bulkid;
+	u64 id = rpc->srpc_reqstbuf->buf_msg.msg_body.reqst.bulkid;
 	int rc;
 	int opt;
 
@@ -1362,7 +1362,7 @@ struct srpc_client_rpc *
 	struct srpc_buffer *buffer = rpc->srpc_reqstbuf;
 	struct srpc_service_cd *scd = rpc->srpc_scd;
 	struct srpc_service *sv = scd->scd_svc;
-	__u64 rpyid;
+	u64 rpyid;
 	int rc;
 
 	LASSERT(buffer);
@@ -1415,7 +1415,7 @@ struct srpc_client_rpc *
 	LASSERT(!in_interrupt());
 
 	if (ev->status) {
-		__u32 errors;
+		u32 errors;
 
 		spin_lock(&srpc_data.rpc_glock);
 		if (ev->status != -ECANCELED) /* cancellation is not error */
@@ -1604,7 +1604,7 @@ struct srpc_client_rpc *
 
 	/* 1 second pause to avoid timestamp reuse */
 	schedule_timeout_uninterruptible(HZ);
-	srpc_data.rpc_matchbits = ((__u64)ktime_get_real_seconds()) << 48;
+	srpc_data.rpc_matchbits = ((u64)ktime_get_real_seconds()) << 48;
 
 	srpc_data.rpc_state = SRPC_STATE_NONE;
 
drivers/staging/lustre/lnet/selftest/rpc.h +66 -66

248 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#4 lore raw

PATCH 4/26 ptlrpc: use kernel types for kernel code

In reply to James Simmons

Lustre ptlrpc code was originally both a user land and kernel implementation. The source contains many types of the form __u32 but since this is mostly kernel code change the types to kernel internal types.

---
 drivers/staging/lustre/lustre/ptlrpc/client.c      |  32 +++---
 drivers/staging/lustre/lustre/ptlrpc/events.c      |  10 +-
 drivers/staging/lustre/lustre/ptlrpc/import.c      |  14 +--
 drivers/staging/lustre/lustre/ptlrpc/layout.c      |  18 ++--
 drivers/staging/lustre/lustre/ptlrpc/llog_client.c |   2 +-
 .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c    |  30 +++---
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c      |   4 +-
 .../staging/lustre/lustre/ptlrpc/pack_generic.c    | 112 ++++++++++-----------
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |   4 +-
 drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c     |   2 +-
 drivers/staging/lustre/lustre/ptlrpc/recover.c     |   2 +-
 drivers/staging/lustre/lustre/ptlrpc/sec.c         |  20 ++--
 drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c    |   6 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_null.c    |   6 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_plain.c   |  26 ++---
 drivers/staging/lustre/lustre/ptlrpc/service.c     |  16 +--
 16 files changed, 152 insertions(+), 152 deletions(-)
drivers/staging/lustre/lustre/ptlrpc/client.c +16 -16
index 110bb5d..f4b3875 100644
@@ -286,7 +286,7 @@ void ptlrpc_free_bulk(struct ptlrpc_bulk_desc *desc)
  */
 void ptlrpc_at_set_req_timeout(struct ptlrpc_request *req)
 {
-	__u32 serv_est;
+	u32 serv_est;
 	int idx;
 	struct imp_at *at;
 
@@ -690,12 +690,12 @@ static inline void ptlrpc_assign_next_xid(struct ptlrpc_request *req)
 }
 
 int ptlrpc_request_bufs_pack(struct ptlrpc_request *request,
-			     __u32 version, int opcode, char **bufs,
+			     u32 version, int opcode, char **bufs,
 			     struct ptlrpc_cli_ctx *ctx)
 {
 	int count;
 	struct obd_import *imp;
-	__u32 *lengths;
+	u32 *lengths;
 	int rc;
 
 	count = req_capsule_filled_sizes(&request->rq_pill, RCL_CLIENT);
@@ -785,7 +785,7 @@ int ptlrpc_request_bufs_pack(struct ptlrpc_request *request,
  * steps if necessary.
  */
 int ptlrpc_request_pack(struct ptlrpc_request *request,
-			__u32 version, int opcode)
+			u32 version, int opcode)
 {
 	int rc;
 
@@ -917,7 +917,7 @@ void ptlrpc_request_free(struct ptlrpc_request *request)
  */
 struct ptlrpc_request *ptlrpc_request_alloc_pack(struct obd_import *imp,
 						 const struct req_format *format,
-						 __u32 version, int opcode)
+						 u32 version, int opcode)
 {
 	struct ptlrpc_request *req = ptlrpc_request_alloc(imp, format);
 	int rc;
@@ -1186,7 +1186,7 @@ static int ptlrpc_import_delay_req(struct obd_import *imp,
  */
 static bool ptlrpc_console_allow(struct ptlrpc_request *req)
 {
-	__u32 opc;
+	u32 opc;
 
 	LASSERT(req->rq_reqmsg);
 	opc = lustre_msg_get_opc(req->rq_reqmsg);
@@ -1226,7 +1226,7 @@ static int ptlrpc_check_status(struct ptlrpc_request *req)
 	if (lustre_msg_get_type(req->rq_repmsg) == PTL_RPC_MSG_ERR) {
 		struct obd_import *imp = req->rq_import;
 		lnet_nid_t nid = imp->imp_connection->c_peer.nid;
-		__u32 opc = lustre_msg_get_opc(req->rq_reqmsg);
+		u32 opc = lustre_msg_get_opc(req->rq_reqmsg);
 
 		/* -EAGAIN is normal when using POSIX flocks */
 		if (ptlrpc_console_allow(req) &&
@@ -1256,7 +1256,7 @@ static void ptlrpc_save_versions(struct ptlrpc_request *req)
 {
 	struct lustre_msg *repmsg = req->rq_repmsg;
 	struct lustre_msg *reqmsg = req->rq_reqmsg;
-	__u64 *versions = lustre_msg_get_versions(repmsg);
+	u64 *versions = lustre_msg_get_versions(repmsg);
 
 	if (lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY)
 		return;
@@ -1267,7 +1267,7 @@ static void ptlrpc_save_versions(struct ptlrpc_request *req)
 	       versions[0], versions[1]);
 }
 
-__u64 ptlrpc_known_replied_xid(struct obd_import *imp)
+u64 ptlrpc_known_replied_xid(struct obd_import *imp)
 {
 	struct ptlrpc_request *req;
 
@@ -2471,7 +2471,7 @@ void ptlrpc_req_finished(struct ptlrpc_request *request)
 /**
  * Returns xid of a \a request
  */
-__u64 ptlrpc_req_xid(struct ptlrpc_request *request)
+u64 ptlrpc_req_xid(struct ptlrpc_request *request)
 {
 	return request->rq_xid;
 }
@@ -3025,7 +3025,7 @@ void ptlrpc_abort_set(struct ptlrpc_request_set *set)
 	}
 }
 
-static __u64 ptlrpc_last_xid;
+static u64 ptlrpc_last_xid;
 static spinlock_t ptlrpc_last_xid_lock;
 
 /**
@@ -3054,7 +3054,7 @@ void ptlrpc_init_xid(void)
 		ptlrpc_last_xid >>= 2;
 		ptlrpc_last_xid |= (1ULL << 61);
 	} else {
-		ptlrpc_last_xid = (__u64)now << 20;
+		ptlrpc_last_xid = (u64)now << 20;
 	}
 
 	/* Always need to be aligned to a power-of-two for multi-bulk BRW */
@@ -3074,9 +3074,9 @@ void ptlrpc_init_xid(void)
  * This is assumed to be true due to the initial ptlrpc_last_xid
  * value also being initialized to a power-of-two value. LU-1431
  */
-__u64 ptlrpc_next_xid(void)
+u64 ptlrpc_next_xid(void)
 {
-	__u64 next;
+	u64 next;
 
 	spin_lock(&ptlrpc_last_xid_lock);
 	next = ptlrpc_last_xid + PTLRPC_BULK_OPS_COUNT;
@@ -3155,11 +3155,11 @@ void ptlrpc_set_bulk_mbits(struct ptlrpc_request *req)
  * Get a glimpse@what next xid value might have been.
  * Returns possible next xid.
  */
-__u64 ptlrpc_sample_next_xid(void)
+u64 ptlrpc_sample_next_xid(void)
 {
 #if BITS_PER_LONG == 32
 	/* need to avoid possible word tearing on 32-bit systems */
-	__u64 next;
+	u64 next;
 
 	spin_lock(&ptlrpc_last_xid_lock);
 	next = ptlrpc_last_xid + PTLRPC_BULK_OPS_COUNT;
drivers/staging/lustre/lustre/ptlrpc/events.c +5 -5
index ab6dd74..0c16a2c 100644
@@ -253,9 +253,9 @@ void client_bulk_callback(struct lnet_event *ev)
 static void ptlrpc_req_add_history(struct ptlrpc_service_part *svcpt,
 				   struct ptlrpc_request *req)
 {
-	__u64 sec = req->rq_arrival_time.tv_sec;
-	__u32 usec = req->rq_arrival_time.tv_nsec / NSEC_PER_USEC / 16; /* usec / 16 */
-	__u64 new_seq;
+	u64 sec = req->rq_arrival_time.tv_sec;
+	u32 usec = req->rq_arrival_time.tv_nsec / NSEC_PER_USEC / 16; /* usec / 16 */
+	u64 new_seq;
 
 	/* set sequence ID for request and add it to history list,
 	 * it must be called with hold svcpt::scp_lock
@@ -453,11 +453,11 @@ int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
 			struct lnet_process_id *peer, lnet_nid_t *self)
 {
 	int best_dist = 0;
-	__u32 best_order = 0;
+	u32 best_order = 0;
 	int count = 0;
 	int rc = -ENOENT;
 	int dist;
-	__u32 order;
+	u32 order;
 	lnet_nid_t dst_nid;
 	lnet_nid_t src_nid;
 
drivers/staging/lustre/lustre/ptlrpc/import.c +7 -7
index 480c860d..56a0b76 100644
@@ -51,7 +51,7 @@
 #include "ptlrpc_internal.h"
 
 struct ptlrpc_connect_async_args {
-	 __u64 pcaa_peer_committed;
+	 u64 pcaa_peer_committed;
 	int pcaa_initial_connect;
 };
 
@@ -154,7 +154,7 @@ static void deuuidify(char *uuid, const char *prefix, char **uuid_start,
  *	     (increasing the import->conn_cnt) the older failure should
  *	     not also cause a reconnection.  If zero it forces a reconnect.
  */
-int ptlrpc_set_import_discon(struct obd_import *imp, __u32 conn_cnt)
+int ptlrpc_set_import_discon(struct obd_import *imp, u32 conn_cnt)
 {
 	int rc = 0;
 
@@ -399,7 +399,7 @@ void ptlrpc_pinger_force(struct obd_import *imp)
 }
 EXPORT_SYMBOL(ptlrpc_pinger_force);
 
-void ptlrpc_fail_import(struct obd_import *imp, __u32 conn_cnt)
+void ptlrpc_fail_import(struct obd_import *imp, u32 conn_cnt)
 {
 	LASSERT(!imp->imp_dlm_fake);
 
@@ -547,7 +547,7 @@ static int import_select_connection(struct obd_import *imp)
 /*
  * must be called under imp_lock
  */
-static int ptlrpc_first_transno(struct obd_import *imp, __u64 *transno)
+static int ptlrpc_first_transno(struct obd_import *imp, u64 *transno)
 {
 	struct ptlrpc_request *req;
 
@@ -589,7 +589,7 @@ int ptlrpc_connect_import(struct obd_import *imp)
 	struct obd_device *obd = imp->imp_obd;
 	int initial_connect = 0;
 	int set_transno = 0;
-	__u64 committed_before_reconnect = 0;
+	u64 committed_before_reconnect = 0;
 	struct ptlrpc_request *request;
 	char *bufs[] = { NULL,
 			 obd2cli_tgt(imp->imp_obd),
@@ -686,7 +686,7 @@ int ptlrpc_connect_import(struct obd_import *imp)
 	/* Allow a slightly larger reply for future growth compatibility */
 	req_capsule_set_size(&request->rq_pill, &RMF_CONNECT_DATA, RCL_SERVER,
 			     sizeof(struct obd_connect_data) +
-			     16 * sizeof(__u64));
+			     16 * sizeof(u64));
 	ptlrpc_request_set_replen(request);
 	request->rq_interpret_reply = ptlrpc_connect_interpret;
 
@@ -936,7 +936,7 @@ static int ptlrpc_connect_interpret(const struct lu_env *env,
 	struct ptlrpc_connect_async_args *aa = data;
 	struct obd_import *imp = request->rq_import;
 	struct lustre_handle old_hdl;
-	__u64 old_connect_flags;
+	u64 old_connect_flags;
 	int msg_flags;
 	struct obd_connect_data *ocd;
 	struct obd_export *exp;
drivers/staging/lustre/lustre/ptlrpc/layout.c +9 -9
index a155200..2848f2f 100644
@@ -768,7 +768,7 @@
 };
 
 struct req_msg_field {
-	const __u32 rmf_flags;
+	const u32 rmf_flags;
 	const char  *rmf_name;
 	/**
 	 * Field length. (-1) means "variable length".  If the
@@ -842,7 +842,7 @@ struct req_msg_field RMF_MGS_CONFIG_RES =
 
 struct req_msg_field RMF_U32 =
 	DEFINE_MSGF("generic u32", 0,
-		    sizeof(__u32), lustre_swab_generic_32s, NULL);
+		    sizeof(u32), lustre_swab_generic_32s, NULL);
 EXPORT_SYMBOL(RMF_U32);
 
 struct req_msg_field RMF_SETINFO_VAL =
@@ -855,7 +855,7 @@ struct req_msg_field RMF_GETINFO_KEY =
 
 struct req_msg_field RMF_GETINFO_VALLEN =
 	DEFINE_MSGF("getinfo_vallen", 0,
-		    sizeof(__u32), lustre_swab_generic_32s, NULL);
+		    sizeof(u32), lustre_swab_generic_32s, NULL);
 EXPORT_SYMBOL(RMF_GETINFO_VALLEN);
 
 struct req_msg_field RMF_GETINFO_VAL =
@@ -864,7 +864,7 @@ struct req_msg_field RMF_GETINFO_VAL =
 
 struct req_msg_field RMF_SEQ_OPC =
 	DEFINE_MSGF("seq_query_opc", 0,
-		    sizeof(__u32), lustre_swab_generic_32s, NULL);
+		    sizeof(u32), lustre_swab_generic_32s, NULL);
 EXPORT_SYMBOL(RMF_SEQ_OPC);
 
 struct req_msg_field RMF_SEQ_RANGE =
@@ -875,7 +875,7 @@ struct req_msg_field RMF_SEQ_RANGE =
 
 struct req_msg_field RMF_FLD_OPC =
 	DEFINE_MSGF("fld_query_opc", 0,
-		    sizeof(__u32), lustre_swab_generic_32s, NULL);
+		    sizeof(u32), lustre_swab_generic_32s, NULL);
 EXPORT_SYMBOL(RMF_FLD_OPC);
 
 struct req_msg_field RMF_FLD_MDFLD =
@@ -1069,12 +1069,12 @@ struct req_msg_field RMF_NIOBUF_REMOTE =
 EXPORT_SYMBOL(RMF_NIOBUF_REMOTE);
 
 struct req_msg_field RMF_RCS =
-	DEFINE_MSGF("niobuf_remote", RMF_F_STRUCT_ARRAY, sizeof(__u32),
+	DEFINE_MSGF("niobuf_remote", RMF_F_STRUCT_ARRAY, sizeof(u32),
 		    lustre_swab_generic_32s, dump_rcs);
 EXPORT_SYMBOL(RMF_RCS);
 
 struct req_msg_field RMF_EAVALS_LENS =
-	DEFINE_MSGF("eavals_lens", RMF_F_STRUCT_ARRAY, sizeof(__u32),
+	DEFINE_MSGF("eavals_lens", RMF_F_STRUCT_ARRAY, sizeof(u32),
 		    lustre_swab_generic_32s, NULL);
 EXPORT_SYMBOL(RMF_EAVALS_LENS);
 
@@ -1130,7 +1130,7 @@ struct req_msg_field RMF_MDS_HSM_USER_ITEM =
 
 struct req_msg_field RMF_MDS_HSM_ARCHIVE =
 	DEFINE_MSGF("hsm_archive", 0,
-		    sizeof(__u32), lustre_swab_generic_32s, NULL);
+		    sizeof(u32), lustre_swab_generic_32s, NULL);
 EXPORT_SYMBOL(RMF_MDS_HSM_ARCHIVE);
 
 struct req_msg_field RMF_MDS_HSM_REQUEST =
@@ -2129,7 +2129,7 @@ u32 req_capsule_msg_size(struct req_capsule *pill, enum req_location loc)
  * This function should not be used for formats which contain variable size
  * fields.
  */
-u32 req_capsule_fmt_size(__u32 magic, const struct req_format *fmt,
+u32 req_capsule_fmt_size(u32 magic, const struct req_format *fmt,
 			 enum req_location loc)
 {
 	size_t i = 0;
drivers/staging/lustre/lustre/ptlrpc/llog_client.c +1 -1
index 6ddd93c..8ca6959 100644
@@ -142,7 +142,7 @@ static int llog_client_open(const struct lu_env *env,
 static int llog_client_next_block(const struct lu_env *env,
 				  struct llog_handle *loghandle,
 				  int *cur_idx, int next_idx,
-				  __u64 *cur_offset, void *buf, int len)
+				  u64 *cur_offset, void *buf, int len)
 {
 	struct obd_import *imp;
 	struct ptlrpc_request *req = NULL;
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +15 -15
index cce86c4..92e3e0f 100644
@@ -42,7 +42,7 @@
 #include "ptlrpc_internal.h"
 
 static struct ll_rpc_opcode {
-	__u32       opcode;
+	u32       opcode;
 	const char *opname;
 } ll_rpc_opcode_table[LUSTRE_MAX_OPCODES] = {
 	{ OST_REPLY,	"ost_reply" },
@@ -134,7 +134,7 @@
 };
 
 static struct ll_eopcode {
-	__u32       opcode;
+	u32       opcode;
 	const char *opname;
 } ll_eopcode_table[EXTRA_LAST_OPC] = {
 	{ LDLM_GLIMPSE_ENQUEUE, "ldlm_glimpse_enqueue" },
@@ -153,7 +153,7 @@
 	{ BRW_WRITE_BYTES,      "write_bytes" },
 };
 
-const char *ll_opcode2str(__u32 opcode)
+const char *ll_opcode2str(u32 opcode)
 {
 	/* When one of the assertions below fail, chances are that:
 	 *     1) A new opcode was added in include/lustre/lustre_idl.h,
@@ -162,7 +162,7 @@ const char *ll_opcode2str(__u32 opcode)
 	 *	and the opcode_offset() function in
 	 *	ptlrpc_internal.h needs to be modified.
 	 */
-	__u32 offset = opcode_offset(opcode);
+	u32 offset = opcode_offset(opcode);
 
 	LASSERTF(offset < LUSTRE_MAX_OPCODES,
 		 "offset %u >= LUSTRE_MAX_OPCODES %u\n",
@@ -173,7 +173,7 @@ const char *ll_opcode2str(__u32 opcode)
 	return ll_rpc_opcode_table[offset].opname;
 }
 
-static const char *ll_eopcode2str(__u32 opcode)
+static const char *ll_eopcode2str(u32 opcode)
 {
 	LASSERT(ll_eopcode_table[opcode].opcode == opcode);
 	return ll_eopcode_table[opcode].opname;
@@ -231,7 +231,7 @@ static const char *ll_eopcode2str(__u32 opcode)
 				     ll_eopcode2str(i), units);
 	}
 	for (i = 0; i < LUSTRE_MAX_OPCODES; i++) {
-		__u32 opcode = ll_rpc_opcode_table[i].opcode;
+		u32 opcode = ll_rpc_opcode_table[i].opcode;
 
 		lprocfs_counter_init(svc_stats,
 				     EXTRA_MAX_OPCODES + i, svc_counter_config,
@@ -709,14 +709,14 @@ static ssize_t ptlrpc_lprocfs_nrs_seq_write(struct file *file,
 
 struct ptlrpc_srh_iterator {
 	int			srhi_idx;
-	__u64			srhi_seq;
+	u64			srhi_seq;
 	struct ptlrpc_request	*srhi_req;
 };
 
 static int
 ptlrpc_lprocfs_svc_req_history_seek(struct ptlrpc_service_part *svcpt,
 				    struct ptlrpc_srh_iterator *srhi,
-				    __u64 seq)
+				    u64 seq)
 {
 	struct list_head *e;
 	struct ptlrpc_request *req;
@@ -772,7 +772,7 @@ struct ptlrpc_srh_iterator {
 /* convert seq_file pos to cpt */
 #define PTLRPC_REQ_POS2CPT(svc, pos)			\
 	((svc)->srv_cpt_bits == 0 ? 0 :			\
-	 (__u64)(pos) >> (64 - (svc)->srv_cpt_bits))
+	 (u64)(pos) >> (64 - (svc)->srv_cpt_bits))
 
 /* make up seq_file pos from cpt */
 #define PTLRPC_REQ_CPT2POS(svc, cpt)			\
@@ -788,8 +788,8 @@ struct ptlrpc_srh_iterator {
 /* convert position to sequence */
 #define PTLRPC_REQ_POS2SEQ(svc, pos)			\
 	((svc)->srv_cpt_bits == 0 ? (pos) :		\
-	 ((__u64)(pos) << (svc)->srv_cpt_bits) |	\
-	 ((__u64)(pos) >> (64 - (svc)->srv_cpt_bits)))
+	 ((u64)(pos) << (svc)->srv_cpt_bits) |	\
+	 ((u64)(pos) >> (64 - (svc)->srv_cpt_bits)))
 
 static void *
 ptlrpc_lprocfs_svc_req_history_start(struct seq_file *s, loff_t *pos)
@@ -801,7 +801,7 @@ struct ptlrpc_srh_iterator {
 	int				rc;
 	int				i;
 
-	if (sizeof(loff_t) != sizeof(__u64)) { /* can't support */
+	if (sizeof(loff_t) != sizeof(u64)) { /* can't support */
 		CWARN("Failed to read request history because size of loff_t %d can't match size of u64\n",
 		      (int)sizeof(loff_t));
 		return NULL;
@@ -852,7 +852,7 @@ struct ptlrpc_srh_iterator {
 	struct ptlrpc_service *svc = s->private;
 	struct ptlrpc_srh_iterator *srhi = iter;
 	struct ptlrpc_service_part *svcpt;
-	__u64 seq;
+	u64 seq;
 	int rc;
 	int i;
 
@@ -1120,7 +1120,7 @@ void ptlrpc_lprocfs_register_obd(struct obd_device *obddev)
 void ptlrpc_lprocfs_rpc_sent(struct ptlrpc_request *req, long amount)
 {
 	struct lprocfs_stats *svc_stats;
-	__u32 op = lustre_msg_get_opc(req->rq_reqmsg);
+	u32 op = lustre_msg_get_opc(req->rq_reqmsg);
 	int opc = opcode_offset(op);
 
 	svc_stats = req->rq_import->imp_obd->obd_svc_stats;
@@ -1243,7 +1243,7 @@ int lprocfs_wr_import(struct file *file, const char __user *buffer,
 	uuid = kbuf + prefix_len;
 	ptr = strstr(uuid, "::");
 	if (ptr) {
-		__u32 inst;
+		u32 inst;
 		char *endptr;
 
 		*ptr = 0;
drivers/staging/lustre/lustre/ptlrpc/niobuf.c +2 -2
index 7e7db24..d3044a7 100644
@@ -48,7 +48,7 @@
 static int ptl_send_buf(struct lnet_handle_md *mdh, void *base, int len,
 			enum lnet_ack_req ack, struct ptlrpc_cb_id *cbid,
 			lnet_nid_t self, struct lnet_process_id peer_id,
-			int portal, __u64 xid, unsigned int offset,
+			int portal, u64 xid, unsigned int offset,
 			struct lnet_handle_md *bulk_cookie)
 {
 	int rc;
@@ -530,7 +530,7 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
 	 * from the resend for reply timeout.
 	 */
 	if (request->rq_nr_resend && list_empty(&request->rq_unreplied_list)) {
-		__u64 min_xid = 0;
+		u64 min_xid = 0;
 		/*
 		 * resend for EINPROGRESS, allocate new xid to avoid reply
 		 * reconstruction
drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +56 -56

419 lines not on this page · raw message

drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +2 -2
index da42b99..10c2520 100644
@@ -73,7 +73,7 @@ void ptlrpc_set_add_new_req(struct ptlrpcd_ctl *pc,
 void ptlrpc_resend_req(struct ptlrpc_request *request);
 void ptlrpc_set_bulk_mbits(struct ptlrpc_request *req);
 void ptlrpc_assign_next_xid_nolock(struct ptlrpc_request *req);
-__u64 ptlrpc_known_replied_xid(struct obd_import *imp);
+u64 ptlrpc_known_replied_xid(struct obd_import *imp);
 void ptlrpc_add_unreplied(struct ptlrpc_request *req);
 
 /* events.c */
@@ -83,7 +83,7 @@ void ptlrpc_set_add_new_req(struct ptlrpcd_ctl *pc,
 void ptlrpc_request_handle_notconn(struct ptlrpc_request *req);
 void lustre_assert_wire_constants(void);
 int ptlrpc_import_in_recovery(struct obd_import *imp);
-int ptlrpc_set_import_discon(struct obd_import *imp, __u32 conn_cnt);
+int ptlrpc_set_import_discon(struct obd_import *imp, u32 conn_cnt);
 int ptlrpc_replay_next(struct obd_import *imp, int *inflight);
 void ptlrpc_initiate_recovery(struct obd_import *imp);
 
drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c +1 -1
index 4bd0d9d..e39c38a 100644
@@ -672,7 +672,7 @@ static int ptlrpcd_init(void)
 	int j;
 	int rc = 0;
 	struct cfs_cpt_table *cptable;
-	__u32 *cpts = NULL;
+	u32 *cpts = NULL;
 	int ncpts;
 	int cpt;
 	struct ptlrpcd *pd;
drivers/staging/lustre/lustre/ptlrpc/recover.c +1 -1
index 9d369f8..ed769a4 100644
@@ -67,7 +67,7 @@ int ptlrpc_replay_next(struct obd_import *imp, int *inflight)
 {
 	int rc = 0;
 	struct ptlrpc_request *req = NULL, *pos;
-	__u64 last_transno;
+	u64 last_transno;
 
 	*inflight = 0;
 
drivers/staging/lustre/lustre/ptlrpc/sec.c +10 -10
index 53f4d4f..165082a 100644
@@ -64,7 +64,7 @@
 
 int sptlrpc_register_policy(struct ptlrpc_sec_policy *policy)
 {
-	__u16 number = policy->sp_policy;
+	u16 number = policy->sp_policy;
 
 	LASSERT(policy->sp_name);
 	LASSERT(policy->sp_cops);
@@ -88,7 +88,7 @@ int sptlrpc_register_policy(struct ptlrpc_sec_policy *policy)
 
 int sptlrpc_unregister_policy(struct ptlrpc_sec_policy *policy)
 {
-	__u16 number = policy->sp_policy;
+	u16 number = policy->sp_policy;
 
 	LASSERT(number < SPTLRPC_POLICY_MAX);
 
@@ -109,13 +109,13 @@ int sptlrpc_unregister_policy(struct ptlrpc_sec_policy *policy)
 EXPORT_SYMBOL(sptlrpc_unregister_policy);
 
 static
-struct ptlrpc_sec_policy *sptlrpc_wireflavor2policy(__u32 flavor)
+struct ptlrpc_sec_policy *sptlrpc_wireflavor2policy(u32 flavor)
 {
 	static DEFINE_MUTEX(load_mutex);
 	static atomic_t loaded = ATOMIC_INIT(0);
 	struct ptlrpc_sec_policy *policy;
-	__u16 number = SPTLRPC_FLVR_POLICY(flavor);
-	__u16 flag = 0;
+	u16 number = SPTLRPC_FLVR_POLICY(flavor);
+	u16 flag = 0;
 
 	if (number >= SPTLRPC_POLICY_MAX)
 		return NULL;
@@ -150,7 +150,7 @@ struct ptlrpc_sec_policy *sptlrpc_wireflavor2policy(__u32 flavor)
 	return policy;
 }
 
-__u32 sptlrpc_name2flavor_base(const char *name)
+u32 sptlrpc_name2flavor_base(const char *name)
 {
 	if (!strcmp(name, "null"))
 		return SPTLRPC_FLVR_NULL;
@@ -169,9 +169,9 @@ __u32 sptlrpc_name2flavor_base(const char *name)
 }
 EXPORT_SYMBOL(sptlrpc_name2flavor_base);
 
-const char *sptlrpc_flavor2name_base(__u32 flvr)
+const char *sptlrpc_flavor2name_base(u32 flvr)
 {
-	__u32   base = SPTLRPC_FLVR_BASE(flvr);
+	u32   base = SPTLRPC_FLVR_BASE(flvr);
 
 	if (base == SPTLRPC_FLVR_BASE(SPTLRPC_FLVR_NULL))
 		return "null";
@@ -226,7 +226,7 @@ char *sptlrpc_flavor2name(struct sptlrpc_flavor *sf, char *buf, int bufsize)
 }
 EXPORT_SYMBOL(sptlrpc_flavor2name);
 
-static char *sptlrpc_secflags2str(__u32 flags, char *buf, int bufsize)
+static char *sptlrpc_secflags2str(u32 flags, char *buf, int bufsize)
 {
 	buf[0] = '\0';
 
@@ -2280,7 +2280,7 @@ int sptlrpc_unpack_user_desc(struct lustre_msg *msg, int offset, int swabbed)
 		return -EINVAL;
 	}
 
-	if (sizeof(*pud) + pud->pud_ngroups * sizeof(__u32) >
+	if (sizeof(*pud) + pud->pud_ngroups * sizeof(u32) >
 	    msg->lm_buflens[offset]) {
 		CERROR("%u groups are claimed but bufsize only %u\n",
 		       pud->pud_ngroups, msg->lm_buflens[offset]);
drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c +3 -3
index dbd6c74..93dcb6d 100644
@@ -485,12 +485,12 @@ void sptlrpc_enc_pool_fini(void)
 	[BULK_HASH_ALG_SHA512]	= CFS_HASH_ALG_SHA512,
 };
 
-const char *sptlrpc_get_hash_name(__u8 hash_alg)
+const char *sptlrpc_get_hash_name(u8 hash_alg)
 {
 	return cfs_crypto_hash_name(cfs_hash_alg_id[hash_alg]);
 }
 
-__u8 sptlrpc_get_hash_alg(const char *algname)
+u8 sptlrpc_get_hash_alg(const char *algname)
 {
 	return cfs_crypto_hash_alg(algname);
 }
@@ -532,7 +532,7 @@ int bulk_sec_desc_unpack(struct lustre_msg *msg, int offset, int swabbed)
 }
 EXPORT_SYMBOL(bulk_sec_desc_unpack);
 
-int sptlrpc_get_bulk_checksum(struct ptlrpc_bulk_desc *desc, __u8 alg,
+int sptlrpc_get_bulk_checksum(struct ptlrpc_bulk_desc *desc, u8 alg,
 			      void *buf, int buflen)
 {
 	struct ahash_request *hdesc;
drivers/staging/lustre/lustre/ptlrpc/sec_null.c +3 -3
index ecc387d..6933a53 100644
@@ -57,7 +57,7 @@
 static inline
 void null_encode_sec_part(struct lustre_msg *msg, enum lustre_sec_part sp)
 {
-	msg->lm_secflvr |= (((__u32)sp) & 0xFF) << 24;
+	msg->lm_secflvr |= (((u32)sp) & 0xFF) << 24;
 }
 
 static inline
@@ -91,7 +91,7 @@ int null_ctx_sign(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
 static
 int null_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
 {
-	__u32 cksums, cksumc;
+	u32 cksums, cksumc;
 
 	LASSERT(req->rq_repdata);
 
@@ -361,7 +361,7 @@ int null_authorize(struct ptlrpc_request *req)
 		else
 			req->rq_reply_off = 0;
 	} else {
-		__u32 cksum;
+		u32 cksum;
 
 		cksum = lustre_msg_calc_cksum(rs->rs_repbuf);
 		lustre_msg_set_cksum(rs->rs_repbuf, cksum);
drivers/staging/lustre/lustre/ptlrpc/sec_plain.c +13 -13
index ead1df7..0a31ff4 100644
@@ -76,15 +76,15 @@ static inline struct plain_sec *sec2plsec(struct ptlrpc_sec *sec)
 #define PLAIN_FL_BULK		   (0x02)
 
 struct plain_header {
-	__u8	    ph_ver;	    /* 0 */
-	__u8	    ph_flags;
-	__u8	    ph_sp;	     /* source */
-	__u8	    ph_bulk_hash_alg;  /* complete flavor desc */
-	__u8	    ph_pad[4];
+	u8	    ph_ver;	    /* 0 */
+	u8	    ph_flags;
+	u8	    ph_sp;	     /* source */
+	u8	    ph_bulk_hash_alg;  /* complete flavor desc */
+	u8	    ph_pad[4];
 };
 
 struct plain_bulk_token {
-	__u8	    pbt_hash[8];
+	u8	    pbt_hash[8];
 };
 
 #define PLAIN_BSD_SIZE \
@@ -118,7 +118,7 @@ static int plain_unpack_bsd(struct lustre_msg *msg, int swabbed)
 }
 
 static int plain_generate_bulk_csum(struct ptlrpc_bulk_desc *desc,
-				    __u8 hash_alg,
+				    u8 hash_alg,
 				    struct plain_bulk_token *token)
 {
 	if (hash_alg == BULK_HASH_ALG_NULL)
@@ -130,7 +130,7 @@ static int plain_generate_bulk_csum(struct ptlrpc_bulk_desc *desc,
 }
 
 static int plain_verify_bulk_csum(struct ptlrpc_bulk_desc *desc,
-				  __u8 hash_alg,
+				  u8 hash_alg,
 				  struct plain_bulk_token *tokenr)
 {
 	struct plain_bulk_token tokenv;
@@ -216,7 +216,7 @@ int plain_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
 {
 	struct lustre_msg *msg = req->rq_repdata;
 	struct plain_header *phdr;
-	__u32 cksum;
+	u32 cksum;
 	int swabbed;
 
 	if (msg->lm_bufcount != PLAIN_PACK_SEGMENTS) {
@@ -543,7 +543,7 @@ int plain_alloc_reqbuf(struct ptlrpc_sec *sec,
 		       struct ptlrpc_request *req,
 		       int msgsize)
 {
-	__u32 buflens[PLAIN_PACK_SEGMENTS] = { 0, };
+	u32 buflens[PLAIN_PACK_SEGMENTS] = { 0, };
 	int alloc_len;
 
 	buflens[PLAIN_PACK_HDR_OFF] = sizeof(struct plain_header);
@@ -603,7 +603,7 @@ int plain_alloc_repbuf(struct ptlrpc_sec *sec,
 		       struct ptlrpc_request *req,
 		       int msgsize)
 {
-	__u32 buflens[PLAIN_PACK_SEGMENTS] = { 0, };
+	u32 buflens[PLAIN_PACK_SEGMENTS] = { 0, };
 	int alloc_len;
 
 	buflens[PLAIN_PACK_HDR_OFF] = sizeof(struct plain_header);
@@ -790,7 +790,7 @@ int plain_accept(struct ptlrpc_request *req)
 int plain_alloc_rs(struct ptlrpc_request *req, int msgsize)
 {
 	struct ptlrpc_reply_state *rs;
-	__u32 buflens[PLAIN_PACK_SEGMENTS] = { 0, };
+	u32 buflens[PLAIN_PACK_SEGMENTS] = { 0, };
 	int rs_size = sizeof(*rs);
 
 	LASSERT(msgsize % 8 == 0);
@@ -1001,7 +1001,7 @@ int plain_svc_wrap_bulk(struct ptlrpc_request *req,
 
 int sptlrpc_plain_init(void)
 {
-	__u32 buflens[PLAIN_PACK_SEGMENTS] = { 0, };
+	u32 buflens[PLAIN_PACK_SEGMENTS] = { 0, };
 	int rc;
 
 	buflens[PLAIN_PACK_MSG_OFF] = lustre_msg_early_size();
drivers/staging/lustre/lustre/ptlrpc/service.c +8 -8
index 6a5a9c5..1030f65 100644
@@ -507,7 +507,7 @@ static void ptlrpc_at_timer(struct timer_list *t)
 		INIT_LIST_HEAD(&array->paa_reqs_array[index]);
 
 	array->paa_reqs_count =
-		kzalloc_node(sizeof(__u32) * size, GFP_NOFS,
+		kzalloc_node(sizeof(u32) * size, GFP_NOFS,
 			     cfs_cpt_spread_node(svc->srv_cptable, cpt));
 	if (!array->paa_reqs_count)
 		goto free_reqs_array;
@@ -555,7 +555,7 @@ struct ptlrpc_service *
 	struct ptlrpc_service *service;
 	struct ptlrpc_service_part *svcpt;
 	struct cfs_cpt_table *cptable;
-	__u32 *cpts = NULL;
+	u32 *cpts = NULL;
 	int ncpts;
 	int cpt;
 	int rc;
@@ -925,7 +925,7 @@ static int ptlrpc_check_req(struct ptlrpc_request *req)
 static void ptlrpc_at_set_timer(struct ptlrpc_service_part *svcpt)
 {
 	struct ptlrpc_at_array *array = &svcpt->scp_at_array;
-	__s32 next;
+	s32 next;
 
 	if (array->paa_count == 0) {
 		del_timer(&svcpt->scp_at_timer);
@@ -933,7 +933,7 @@ static void ptlrpc_at_set_timer(struct ptlrpc_service_part *svcpt)
 	}
 
 	/* Set timer for closest deadline */
-	next = (__s32)(array->paa_deadline - ktime_get_real_seconds() -
+	next = (s32)(array->paa_deadline - ktime_get_real_seconds() -
 		       at_early_margin);
 	if (next <= 0) {
 		ptlrpc_at_timer(&svcpt->scp_at_timer);
@@ -950,7 +950,7 @@ static int ptlrpc_at_add_timed(struct ptlrpc_request *req)
 	struct ptlrpc_service_part *svcpt = req->rq_rqbd->rqbd_svcpt;
 	struct ptlrpc_at_array *array = &svcpt->scp_at_array;
 	struct ptlrpc_request *rq = NULL;
-	__u32 index;
+	u32 index;
 
 	if (AT_OFF)
 		return 0;
@@ -1158,7 +1158,7 @@ static void ptlrpc_at_check_timed(struct ptlrpc_service_part *svcpt)
 	struct ptlrpc_at_array *array = &svcpt->scp_at_array;
 	struct ptlrpc_request *rq, *n;
 	struct list_head work_list;
-	__u32 index, count;
+	u32 index, count;
 	time64_t deadline;
 	time64_t now = ktime_get_real_seconds();
 	long delay;
@@ -1478,7 +1478,7 @@ static bool ptlrpc_server_normal_pending(struct ptlrpc_service_part *svcpt,
 {
 	struct ptlrpc_service *svc = svcpt->scp_service;
 	struct ptlrpc_request *req;
-	__u32 deadline;
+	u32 deadline;
 	int rc;
 
 	spin_lock(&svcpt->scp_lock);
@@ -1757,7 +1757,7 @@ static bool ptlrpc_server_normal_pending(struct ptlrpc_service_part *svcpt,
 	       (request->rq_repmsg ?
 		lustre_msg_get_status(request->rq_repmsg) : -999));
 	if (likely(svc->srv_stats && request->rq_reqmsg)) {
-		__u32 op = lustre_msg_get_opc(request->rq_reqmsg);
+		u32 op = lustre_msg_get_opc(request->rq_reqmsg);
 		int opc = opcode_offset(op);
 
 		if (opc > 0 && !(op == LDLM_ENQUEUE || op == MDS_REINT)) {
Signature · 1 line
1.8.3.1
#5 lore raw

PATCH 5/26 lustre: use kernel types for lustre internal headers

In reply to James Simmons

Lustre internal header was originally both a user land and kernel implementation. The source contains many types of the form __u32 but since this is mostly kernel code change the types to kernel internal types.

---
 drivers/staging/lustre/lustre/include/cl_object.h  |  10 +-
 .../staging/lustre/lustre/include/lprocfs_status.h |  28 ++--
 drivers/staging/lustre/lustre/include/lu_object.h  |  46 +++----
 .../staging/lustre/lustre/include/lustre_debug.h   |   4 +-
 .../staging/lustre/lustre/include/lustre_disk.h    |   6 +-
 drivers/staging/lustre/lustre/include/lustre_dlm.h |  66 +++++-----
 .../staging/lustre/lustre/include/lustre_export.h  |  14 +-
 drivers/staging/lustre/lustre/include/lustre_fid.h |  34 ++---
 drivers/staging/lustre/lustre/include/lustre_fld.h |   6 +-
 drivers/staging/lustre/lustre/include/lustre_ha.h  |   2 +-
 .../staging/lustre/lustre/include/lustre_handles.h |   4 +-
 .../staging/lustre/lustre/include/lustre_import.h  |  28 ++--
 .../staging/lustre/lustre/include/lustre_intent.h  |   8 +-
 drivers/staging/lustre/lustre/include/lustre_lmv.h |  26 ++--
 drivers/staging/lustre/lustre/include/lustre_log.h |   8 +-
 drivers/staging/lustre/lustre/include/lustre_mdc.h |   2 +-
 drivers/staging/lustre/lustre/include/lustre_net.h | 144 ++++++++++-----------
 .../lustre/lustre/include/lustre_nrs_fifo.h        |   4 +-
 .../lustre/lustre/include/lustre_req_layout.h      |   4 +-
 drivers/staging/lustre/lustre/include/lustre_sec.h |  92 ++++++-------
 .../staging/lustre/lustre/include/lustre_swab.h    |   6 +-
 drivers/staging/lustre/lustre/include/obd.h        |  84 ++++++------
 drivers/staging/lustre/lustre/include/obd_class.h  |  28 ++--
 23 files changed, 327 insertions(+), 327 deletions(-)
drivers/staging/lustre/lustre/include/cl_object.h +5 -5
index 41b32b7..3109c04 100644
@@ -153,7 +153,7 @@ struct cl_attr {
 	 *
 	 * \todo XXX An interface for block size is needed.
 	 */
-	__u64  cat_blocks;
+	u64  cat_blocks;
 	/**
 	 * User identifier for quota purposes.
 	 */
@@ -164,7 +164,7 @@ struct cl_attr {
 	gid_t  cat_gid;
 
 	/* nlink of the directory */
-	__u64  cat_nlink;
+	u64  cat_nlink;
 
 	/* Project identifier for quota purpose. */
 	u32	cat_projid;
@@ -1151,14 +1151,14 @@ struct cl_lock_descr {
 	/** Index of the last page (inclusive) protected by this lock. */
 	pgoff_t	   cld_end;
 	/** Group ID, for group lock */
-	__u64	     cld_gid;
+	u64	     cld_gid;
 	/** Lock mode. */
 	enum cl_lock_mode cld_mode;
 	/**
 	 * flags to enqueue lock. A combination of bit-flags from
 	 * enum cl_enq_flags.
 	 */
-	__u32	     cld_enq_flags;
+	u32	     cld_enq_flags;
 };
 
 #define DDESCR "%s(%d):[%lu, %lu]:%x"
@@ -2438,7 +2438,7 @@ void cl_sync_io_note(const struct lu_env *env, struct cl_sync_io *anchor,
  */
 
 struct lu_env *cl_env_get(u16 *refcheck);
-struct lu_env *cl_env_alloc(u16 *refcheck, __u32 tags);
+struct lu_env *cl_env_alloc(u16 *refcheck, u32 tags);
 void cl_env_put(struct lu_env *env, u16 *refcheck);
 unsigned int cl_env_cache_purge(unsigned int nr);
 struct lu_env *cl_env_percpu_get(void);
drivers/staging/lustre/lustre/include/lprocfs_status.h +14 -14
index c22ae3d..7649040 100644
@@ -136,7 +136,7 @@ enum {
 	LPROCFS_TYPE_CYCLE	= 0x0800,
 };
 
-#define LC_MIN_INIT ((~(__u64)0) >> 1)
+#define LC_MIN_INIT ((~(u64)0) >> 1)
 
 struct lprocfs_counter_header {
 	unsigned int		lc_config;
@@ -145,17 +145,17 @@ struct lprocfs_counter_header {
 };
 
 struct lprocfs_counter {
-	__s64	lc_count;
-	__s64	lc_min;
-	__s64	lc_max;
-	__s64	lc_sumsquare;
+	s64	lc_count;
+	s64	lc_min;
+	s64	lc_max;
+	s64	lc_sumsquare;
 	/*
 	 * Every counter has lc_array_sum[0], while lc_array_sum[1] is only
 	 * for irq context counter, i.e. stats with
 	 * LPROCFS_STATS_FLAG_IRQ_SAFE flag, its counter need
 	 * lc_array_sum[1]
 	 */
-	__s64	lc_array_sum[1];
+	s64	lc_array_sum[1];
 };
 
 #define lc_sum		lc_array_sum[0]
@@ -163,7 +163,7 @@ struct lprocfs_counter {
 
 struct lprocfs_percpu {
 #ifndef __GNUC__
-	__s64			pad;
+	s64			pad;
 #endif
 	struct lprocfs_counter lp_cntr[0];
 };
@@ -210,7 +210,7 @@ struct lprocfs_stats {
 #define OPC_RANGE(seg) (seg ## _LAST_OPC - seg ## _FIRST_OPC)
 
 /* Pack all opcodes down into a single monotonically increasing index */
-static inline int opcode_offset(__u32 opc)
+static inline int opcode_offset(u32 opc)
 {
 	if (opc < OST_LAST_OPC) {
 		 /* OST opcode */
@@ -394,7 +394,7 @@ void lprocfs_stats_unlock(struct lprocfs_stats *stats,
 
 	/* irq safe stats need lc_array_sum[1] */
 	if ((stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) != 0)
-		percpusize += stats->ls_num * sizeof(__s64);
+		percpusize += stats->ls_num * sizeof(s64);
 
 	if ((stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) == 0)
 		percpusize = L1_CACHE_ALIGN(percpusize);
@@ -411,7 +411,7 @@ void lprocfs_stats_unlock(struct lprocfs_stats *stats,
 	cntr = &stats->ls_percpu[cpuid]->lp_cntr[index];
 
 	if ((stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) != 0)
-		cntr = (void *)cntr + index * sizeof(__s64);
+		cntr = (void *)cntr + index * sizeof(s64);
 
 	return cntr;
 }
@@ -431,11 +431,11 @@ void lprocfs_stats_unlock(struct lprocfs_stats *stats,
 #define lprocfs_counter_decr(stats, idx) \
 	lprocfs_counter_sub(stats, idx, 1)
 
-__s64 lprocfs_read_helper(struct lprocfs_counter *lc,
+s64 lprocfs_read_helper(struct lprocfs_counter *lc,
 			  struct lprocfs_counter_header *header,
 			  enum lprocfs_stats_flags flags,
 			  enum lprocfs_fields_flags field);
-__u64 lprocfs_stats_collector(struct lprocfs_stats *stats, int idx,
+u64 lprocfs_stats_collector(struct lprocfs_stats *stats, int idx,
 			      enum lprocfs_fields_flags field);
 
 extern struct lprocfs_stats *
@@ -485,10 +485,10 @@ int lprocfs_wr_pinger_recov(struct file *file, const char __user *buffer,
 int lprocfs_write_helper(const char __user *buffer, unsigned long count,
 			 int *val);
 int lprocfs_write_u64_helper(const char __user *buffer,
-			     unsigned long count, __u64 *val);
+			     unsigned long count, u64 *val);
 int lprocfs_write_frac_u64_helper(const char __user *buffer,
 				  unsigned long count,
-				  __u64 *val, int mult);
+				  u64 *val, int mult);
 char *lprocfs_find_named_value(const char *buffer, const char *name,
 			       size_t *count);
 void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value);
drivers/staging/lustre/lustre/include/lu_object.h +23 -23

136 lines not on this page · raw message

drivers/staging/lustre/lustre/include/lustre_debug.h +2 -2
index 721a81f..b9414fc 100644
@@ -44,8 +44,8 @@
 
 /* lib/debug.c */
 int dump_req(struct ptlrpc_request *req);
-int block_debug_setup(void *addr, int len, __u64 off, __u64 id);
-int block_debug_check(char *who, void *addr, int len, __u64 off, __u64 id);
+int block_debug_setup(void *addr, int len, u64 off, u64 id);
+int block_debug_check(char *who, void *addr, int len, u64 off, u64 id);
 
 /** @} debug */
 
drivers/staging/lustre/lustre/include/lustre_disk.h +3 -3
index 7b6421d..091a09f 100644
@@ -70,8 +70,8 @@
 
 /* gleaned from the mount command - no persistent info here */
 struct lustre_mount_data {
-	__u32	lmd_magic;
-	__u32	lmd_flags;	/* lustre mount flags */
+	u32	lmd_magic;
+	u32	lmd_flags;	/* lustre mount flags */
 	int	lmd_mgs_failnodes; /* mgs failover node count */
 	int	lmd_exclude_count;
 	int	lmd_recovery_time_soft;
@@ -84,7 +84,7 @@ struct lustre_mount_data {
 				 * _device_ mount options)
 				 */
 	char	*lmd_params;	/* lustre params */
-	__u32	*lmd_exclude;	/* array of OSTs to ignore */
+	u32	*lmd_exclude;	/* array of OSTs to ignore */
 	char	*lmd_mgs;	/* MGS nid */
 	char	*lmd_osd_type;	/* OSD type */
 	char    *lmd_nidnet;	/* network to restrict this client to */
drivers/staging/lustre/lustre/include/lustre_dlm.h +33 -33

209 lines not on this page · raw message

drivers/staging/lustre/lustre/include/lustre_export.h +7 -7
index 79ad5aa..1c70259 100644
@@ -101,12 +101,12 @@ struct obd_export {
 	/** Active connection */
 	struct ptlrpc_connection *exp_connection;
 	/** Connection count value from last successful reconnect rpc */
-	__u32		     exp_conn_cnt;
+	u32		     exp_conn_cnt;
 	struct list_head		exp_outstanding_replies;
 	struct list_head		exp_uncommitted_replies;
 	spinlock_t		  exp_uncommitted_replies_lock;
 	/** Last committed transno for this export */
-	__u64		     exp_last_committed;
+	u64		     exp_last_committed;
 	/** On replay all requests waiting for replay are linked here */
 	struct list_head		exp_req_replay_queue;
 	/**
@@ -139,12 +139,12 @@ struct obd_export {
 	spinlock_t		  exp_bl_list_lock;
 };
 
-static inline __u64 *exp_connect_flags_ptr(struct obd_export *exp)
+static inline u64 *exp_connect_flags_ptr(struct obd_export *exp)
 {
 	return &exp->exp_connect_data.ocd_connect_flags;
 }
 
-static inline __u64 exp_connect_flags(struct obd_export *exp)
+static inline u64 exp_connect_flags(struct obd_export *exp)
 {
 	return *exp_connect_flags_ptr(exp);
 }
@@ -219,7 +219,7 @@ static inline bool imp_connect_lvb_type(struct obd_import *imp)
 		return false;
 }
 
-static inline __u64 exp_connect_ibits(struct obd_export *exp)
+static inline u64 exp_connect_ibits(struct obd_export *exp)
 {
 	struct obd_connect_data *ocd;
 
@@ -239,9 +239,9 @@ static inline bool imp_connect_disp_stripe(struct obd_import *imp)
 
 #define KKUC_CT_DATA_MAGIC	0x092013cea
 struct kkuc_ct_data {
-	__u32		kcd_magic;
+	u32		kcd_magic;
 	struct obd_uuid	kcd_uuid;
-	__u32		kcd_archive;
+	u32		kcd_archive;
 };
 
 /** @} export */
drivers/staging/lustre/lustre/include/lustre_fid.h +17 -17
index 094ad28..f0afa8d 100644
@@ -235,14 +235,14 @@ enum local_oid {
 	SLAVE_LLOG_CATALOGS_OID	= 4124UL,
 };
 
-static inline void lu_local_obj_fid(struct lu_fid *fid, __u32 oid)
+static inline void lu_local_obj_fid(struct lu_fid *fid, u32 oid)
 {
 	fid->f_seq = FID_SEQ_LOCAL_FILE;
 	fid->f_oid = oid;
 	fid->f_ver = 0;
 }
 
-static inline void lu_local_name_obj_fid(struct lu_fid *fid, __u32 oid)
+static inline void lu_local_name_obj_fid(struct lu_fid *fid, u32 oid)
 {
 	fid->f_seq = FID_SEQ_LOCAL_NAME;
 	fid->f_oid = oid;
@@ -290,13 +290,13 @@ static inline int fid_is_quota(const struct lu_fid *fid)
 	       fid_seq(fid) == FID_SEQ_QUOTA_GLB;
 }
 
-static inline int fid_seq_in_fldb(__u64 seq)
+static inline int fid_seq_in_fldb(u64 seq)
 {
 	return fid_seq_is_igif(seq) || fid_seq_is_norm(seq) ||
 	       fid_seq_is_root(seq) || fid_seq_is_dot(seq);
 }
 
-static inline void lu_last_id_fid(struct lu_fid *fid, __u64 seq, __u32 ost_idx)
+static inline void lu_last_id_fid(struct lu_fid *fid, u64 seq, u32 ost_idx)
 {
 	if (fid_seq_is_mdt0(seq)) {
 		fid->f_seq = fid_idif_seq(0, ost_idx);
@@ -352,7 +352,7 @@ struct lu_client_seq {
 	 * Sequence width, that is how many objects may be allocated in one
 	 * sequence. Default value for it is LUSTRE_SEQ_MAX_WIDTH.
 	 */
-	__u64		   lcs_width;
+	u64		   lcs_width;
 
 	/* wait queue for fid allocation and update indicator */
 	wait_queue_head_t	     lcs_waitq;
@@ -409,8 +409,8 @@ static inline bool fid_res_name_eq(const struct lu_fid *fid,
 fid_extract_from_res_name(struct lu_fid *fid, const struct ldlm_res_id *res)
 {
 	fid->f_seq = res->name[LUSTRE_RES_ID_SEQ_OFF];
-	fid->f_oid = (__u32)(res->name[LUSTRE_RES_ID_VER_OID_OFF]);
-	fid->f_ver = (__u32)(res->name[LUSTRE_RES_ID_VER_OID_OFF] >> 32);
+	fid->f_oid = (u32)(res->name[LUSTRE_RES_ID_VER_OID_OFF]);
+	fid->f_ver = (u32)(res->name[LUSTRE_RES_ID_VER_OID_OFF] >> 32);
 	LASSERT(fid_res_name_eq(fid, res));
 }
 
@@ -435,9 +435,9 @@ static inline void fid_extract_from_quota_res(struct lu_fid *glb_fid,
 {
 	fid_extract_from_res_name(glb_fid, res);
 	qid->qid_fid.f_seq = res->name[LUSTRE_RES_ID_QUOTA_SEQ_OFF];
-	qid->qid_fid.f_oid = (__u32)res->name[LUSTRE_RES_ID_QUOTA_VER_OID_OFF];
+	qid->qid_fid.f_oid = (u32)res->name[LUSTRE_RES_ID_QUOTA_VER_OID_OFF];
 	qid->qid_fid.f_ver =
-		(__u32)(res->name[LUSTRE_RES_ID_QUOTA_VER_OID_OFF] >> 32);
+		(u32)(res->name[LUSTRE_RES_ID_QUOTA_VER_OID_OFF] >> 32);
 }
 
 static inline void
@@ -500,7 +500,7 @@ static inline int ostid_res_name_eq(const struct ost_id *oi,
  * Note: we need check oi_seq to decide where to set oi_id,
  * so oi_seq should always be set ahead of oi_id.
  */
-static inline int ostid_set_id(struct ost_id *oi, __u64 oid)
+static inline int ostid_set_id(struct ost_id *oi, u64 oid)
 {
 	if (fid_seq_is_mdt0(oi->oi.oi_seq)) {
 		if (oid >= IDIF_MAX_OID)
@@ -569,10 +569,10 @@ static inline void ost_fid_build_resid(const struct lu_fid *fid,
  * the time between re-used inode numbers is very long - 2^40 SEQ numbers,
  * or about 2^40 client mounts, if clients create less than 2^24 files/mount.
  */
-static inline __u64 fid_flatten(const struct lu_fid *fid)
+static inline u64 fid_flatten(const struct lu_fid *fid)
 {
-	__u64 ino;
-	__u64 seq;
+	u64 ino;
+	u64 seq;
 
 	if (fid_is_igif(fid)) {
 		ino = lu_igif_ino(fid);
@@ -586,7 +586,7 @@ static inline __u64 fid_flatten(const struct lu_fid *fid)
 	return ino ? ino : fid_oid(fid);
 }
 
-static inline __u32 fid_hash(const struct lu_fid *f, int bits)
+static inline u32 fid_hash(const struct lu_fid *f, int bits)
 {
 	/* all objects with same id and different versions will belong to same
 	 * collisions list.
@@ -597,10 +597,10 @@ static inline __u32 fid_hash(const struct lu_fid *f, int bits)
 /**
  * map fid to 32 bit value for ino on 32bit systems.
  */
-static inline __u32 fid_flatten32(const struct lu_fid *fid)
+static inline u32 fid_flatten32(const struct lu_fid *fid)
 {
-	__u32 ino;
-	__u64 seq;
+	u32 ino;
+	u64 seq;
 
 	if (fid_is_igif(fid)) {
 		ino = lu_igif_ino(fid);
drivers/staging/lustre/lustre/include/lustre_fld.h +3 -3
index f42122a..4bcabf7 100644
@@ -62,7 +62,7 @@ struct lu_fld_target {
 	struct list_head	       ft_chain;
 	struct obd_export       *ft_exp;
 	struct lu_server_fld    *ft_srv;
-	__u64		    ft_idx;
+	u64		    ft_idx;
 };
 
 struct lu_server_fld {
@@ -115,7 +115,7 @@ int fld_client_init(struct lu_client_fld *fld,
 void fld_client_flush(struct lu_client_fld *fld);
 
 int fld_client_lookup(struct lu_client_fld *fld, u64 seq, u32 *mds,
-		      __u32 flags, const struct lu_env *env);
+		      u32 flags, const struct lu_env *env);
 
 int fld_client_create(struct lu_client_fld *fld,
 		      struct lu_seq_range *range,
@@ -128,7 +128,7 @@ int fld_client_add_target(struct lu_client_fld *fld,
 			  struct lu_fld_target *tar);
 
 int fld_client_del_target(struct lu_client_fld *fld,
-			  __u64 idx);
+			  u64 idx);
 
 void fld_client_debugfs_fini(struct lu_client_fld *fld);
 
drivers/staging/lustre/lustre/include/lustre_ha.h +1 -1
index cbd6898..af92a56 100644
@@ -53,7 +53,7 @@
 void ptlrpc_activate_import(struct obd_import *imp);
 void ptlrpc_deactivate_import(struct obd_import *imp);
 void ptlrpc_invalidate_import(struct obd_import *imp);
-void ptlrpc_fail_import(struct obd_import *imp, __u32 conn_cnt);
+void ptlrpc_fail_import(struct obd_import *imp, u32 conn_cnt);
 void ptlrpc_pinger_force(struct obd_import *imp);
 
 /** @} ha */
drivers/staging/lustre/lustre/include/lustre_handles.h +2 -2
index 3556ce8..84f70f3 100644
@@ -64,7 +64,7 @@ struct portals_handle_ops {
  */
 struct portals_handle {
 	struct list_head			h_link;
-	__u64				h_cookie;
+	u64				h_cookie;
 	const void			*h_owner;
 	struct portals_handle_ops	*h_ops;
 
@@ -81,7 +81,7 @@ struct portals_handle {
 void class_handle_hash(struct portals_handle *,
 		       struct portals_handle_ops *ops);
 void class_handle_unhash(struct portals_handle *);
-void *class_handle2object(__u64 cookie, const void *owner);
+void *class_handle2object(u64 cookie, const void *owner);
 void class_handle_free_cb(struct rcu_head *rcu);
 int class_handle_init(void);
 void class_handle_cleanup(void);
drivers/staging/lustre/lustre/include/lustre_import.h +14 -14
index 8a8a125..db075be 100644
@@ -69,10 +69,10 @@ struct adaptive_timeout {
 
 struct ptlrpc_at_array {
 	struct list_head       *paa_reqs_array; /** array to hold requests */
-	__u32	     paa_size;       /** the size of array */
-	__u32	     paa_count;      /** the total count of reqs */
+	u32	     paa_size;       /** the size of array */
+	u32	     paa_count;      /** the total count of reqs */
 	time64_t     paa_deadline;   /** the earliest deadline of reqs */
-	__u32	    *paa_reqs_count; /** the count of reqs in each entry */
+	u32	    *paa_reqs_count; /** the count of reqs in each entry */
 };
 
 #define IMP_AT_MAX_PORTALS 8
@@ -137,7 +137,7 @@ struct obd_import_conn {
 	/**
 	 * Time (64 bit jiffies) of last connection attempt on this connection
 	 */
-	__u64		     oic_last_attempt;
+	u64		     oic_last_attempt;
 };
 
 /* state history */
@@ -190,7 +190,7 @@ struct obd_import {
 	/** List of not replied requests */
 	struct list_head	imp_unreplied_list;
 	/** Known maximal replied XID */
-	__u64			imp_known_replied_xid;
+	u64			imp_known_replied_xid;
 
 	/** obd device for this import */
 	struct obd_device	*imp_obd;
@@ -227,23 +227,23 @@ struct obd_import {
 	/** Current import generation. Incremented on every reconnect */
 	int		       imp_generation;
 	/** Incremented every time we send reconnection request */
-	__u32		     imp_conn_cnt;
+	u32		     imp_conn_cnt;
        /**
 	* \see ptlrpc_free_committed remembers imp_generation value here
 	* after a check to save on unnecessary replay list iterations
 	*/
 	int		       imp_last_generation_checked;
 	/** Last transno we replayed */
-	__u64		     imp_last_replay_transno;
+	u64		     imp_last_replay_transno;
 	/** Last transno committed on remote side */
-	__u64		     imp_peer_committed_transno;
+	u64		     imp_peer_committed_transno;
 	/**
 	 * \see ptlrpc_free_committed remembers last_transno since its last
 	 * check here and if last_transno did not change since last run of
 	 * ptlrpc_free_committed and import generation is the same, we can
 	 * skip looking for requests to remove from replay list as optimisation
 	 */
-	__u64		     imp_last_transno_checked;
+	u64		     imp_last_transno_checked;
 	/**
 	 * Remote export handle. This is how remote side knows what export
 	 * we are talking to. Filled from response to connect request
@@ -252,7 +252,7 @@ struct obd_import {
 	/** When to perform next ping. time in jiffies. */
 	unsigned long		imp_next_ping;
 	/** When we last successfully connected. time in 64bit jiffies */
-	__u64		     imp_last_success_conn;
+	u64		     imp_last_success_conn;
 
 	/** List of all possible connection for import. */
 	struct list_head		imp_conn_list;
@@ -304,14 +304,14 @@ struct obd_import {
 				  imp_connect_tried:1,
 				 /* connected but not FULL yet */
 				 imp_connected:1;
-	__u32		     imp_connect_op;
+	u32		     imp_connect_op;
 	struct obd_connect_data   imp_connect_data;
-	__u64		     imp_connect_flags_orig;
+	u64		     imp_connect_flags_orig;
 	u64			imp_connect_flags2_orig;
 	int		       imp_connect_error;
 
-	__u32		     imp_msg_magic;
-	__u32		     imp_msghdr_flags;       /* adjusted based on server capability */
+	u32		     imp_msg_magic;
+	u32		     imp_msghdr_flags;       /* adjusted based on server capability */
 
 	struct imp_at	     imp_at;		 /* adaptive timeout data */
 	time64_t	     imp_last_reply_time;    /* for health check */
drivers/staging/lustre/lustre/include/lustre_intent.h +4 -4
index 51e5c0e..3f26d7a 100644
@@ -41,14 +41,14 @@
 struct lookup_intent {
 	int		it_op;
 	int		it_create_mode;
-	__u64		it_flags;
+	u64		it_flags;
 	int		it_disposition;
 	int		it_status;
-	__u64		it_lock_handle;
-	__u64		it_lock_bits;
+	u64		it_lock_handle;
+	u64		it_lock_bits;
 	int		it_lock_mode;
 	int		it_remote_lock_mode;
-	__u64	   it_remote_lock_handle;
+	u64	   it_remote_lock_handle;
 	struct ptlrpc_request *it_request;
 	unsigned int    it_lock_set:1;
 };
drivers/staging/lustre/lustre/include/lustre_lmv.h +13 -13
index 080ec1f..c4f05d2 100644
@@ -42,13 +42,13 @@ struct lmv_oinfo {
 };
 
 struct lmv_stripe_md {
-	__u32	lsm_md_magic;
-	__u32	lsm_md_stripe_count;
-	__u32	lsm_md_master_mdt_index;
-	__u32	lsm_md_hash_type;
-	__u32	lsm_md_layout_version;
-	__u32	lsm_md_default_count;
-	__u32	lsm_md_default_index;
+	u32	lsm_md_magic;
+	u32	lsm_md_stripe_count;
+	u32	lsm_md_master_mdt_index;
+	u32	lsm_md_hash_type;
+	u32	lsm_md_layout_version;
+	u32	lsm_md_default_count;
+	u32	lsm_md_default_index;
 	char	lsm_md_pool_name[LOV_MAXPOOLNAME + 1];
 	struct lmv_oinfo lsm_md_oinfo[0];
 };
@@ -56,7 +56,7 @@ struct lmv_stripe_md {
 static inline bool
 lsm_md_eq(const struct lmv_stripe_md *lsm1, const struct lmv_stripe_md *lsm2)
 {
-	__u32 idx;
+	u32 idx;
 
 	if (lsm1->lsm_md_magic != lsm2->lsm_md_magic ||
 	    lsm1->lsm_md_stripe_count != lsm2->lsm_md_stripe_count ||
@@ -82,7 +82,7 @@ struct lmv_stripe_md {
 static inline void lmv1_le_to_cpu(struct lmv_mds_md_v1 *lmv_dst,
 				  const struct lmv_mds_md_v1 *lmv_src)
 {
-	__u32 i;
+	u32 i;
 
 	lmv_dst->lmv_magic = le32_to_cpu(lmv_src->lmv_magic);
 	lmv_dst->lmv_stripe_count = le32_to_cpu(lmv_src->lmv_stripe_count);
@@ -126,18 +126,18 @@ static inline void lmv_le_to_cpu(union lmv_mds_md *lmv_dst,
 static inline unsigned int
 lmv_hash_fnv1a(unsigned int count, const char *name, int namelen)
 {
-	__u64 hash;
+	u64 hash;
 
 	hash = lustre_hash_fnv_1a_64(name, namelen);
 
 	return do_div(hash, count);
 }
 
-static inline int lmv_name_to_stripe_index(__u32 lmv_hash_type,
+static inline int lmv_name_to_stripe_index(u32 lmv_hash_type,
 					   unsigned int stripe_count,
 					   const char *name, int namelen)
 {
-	__u32 hash_type = lmv_hash_type & LMV_HASH_TYPE_MASK;
+	u32 hash_type = lmv_hash_type & LMV_HASH_TYPE_MASK;
 	int idx;
 
 	LASSERT(namelen > 0);
@@ -165,7 +165,7 @@ static inline int lmv_name_to_stripe_index(__u32 lmv_hash_type,
 	return idx;
 }
 
-static inline bool lmv_is_known_hash_type(__u32 type)
+static inline bool lmv_is_known_hash_type(u32 type)
 {
 	return (type & LMV_HASH_TYPE_MASK) == LMV_HASH_TYPE_FNV_1A_64 ||
 	       (type & LMV_HASH_TYPE_MASK) == LMV_HASH_TYPE_ALL_CHARS;
drivers/staging/lustre/lustre/include/lustre_log.h +4 -4
index 07f4e60..4ba4501 100644
@@ -143,7 +143,7 @@ int llog_setup(const struct lu_env *env, struct obd_device *obd,
 
 struct llog_operations {
 	int (*lop_next_block)(const struct lu_env *env, struct llog_handle *h,
-			      int *curr_idx, int next_idx, __u64 *offset,
+			      int *curr_idx, int next_idx, u64 *offset,
 			      void *buf, int len);
 	int (*lop_prev_block)(const struct lu_env *env, struct llog_handle *h,
 			      int prev_idx, void *buf, int len);
@@ -218,7 +218,7 @@ struct llog_handle {
 	size_t			 lgh_hdr_size;
 	int			 lgh_last_idx;
 	int			 lgh_cur_idx; /* used during llog_process */
-	__u64			 lgh_cur_offset; /* used during llog_process */
+	u64			 lgh_cur_offset; /* used during llog_process */
 	struct llog_ctxt	*lgh_ctxt;
 	union {
 		struct plain_handle_data	 phd;
@@ -250,7 +250,7 @@ struct llog_ctxt {
 	 * llog chunk size, and llog record size can not be bigger than
 	 * loc_chunk_size
 	 */
-	__u32			loc_chunk_size;
+	u32			loc_chunk_size;
 };
 
 #define LLOG_PROC_BREAK 0x0001
@@ -348,7 +348,7 @@ static inline int llog_ctxt_null(struct obd_device *obd, int index)
 
 static inline int llog_next_block(const struct lu_env *env,
 				  struct llog_handle *loghandle, int *cur_idx,
-				  int next_idx, __u64 *cur_offset, void *buf,
+				  int next_idx, u64 *cur_offset, void *buf,
 				  int len)
 {
 	struct llog_operations *lop;
drivers/staging/lustre/lustre/include/lustre_mdc.h +1 -1
index 6ac7fc4..c1fb324 100644
@@ -204,7 +204,7 @@ static inline void mdc_update_max_ea_from_body(struct obd_export *exp,
 		if (cli->cl_max_mds_easize < body->mbo_max_mdsize)
 			cli->cl_max_mds_easize = body->mbo_max_mdsize;
 
-		def_easize = min_t(__u32, body->mbo_max_mdsize,
+		def_easize = min_t(u32, body->mbo_max_mdsize,
 				   OBD_MAX_DEFAULT_EA_SIZE);
 		cli->cl_default_mds_easize = def_easize;
 	}
drivers/staging/lustre/lustre/include/lustre_net.h +72 -72

311 lines not on this page · raw message

drivers/staging/lustre/lustre/include/lustre_nrs_fifo.h +2 -2
index b70d97d..0db4345f 100644
@@ -59,12 +59,12 @@ struct nrs_fifo_head {
 	/**
 	 * For debugging purposes.
 	 */
-	__u64				fh_sequence;
+	u64				fh_sequence;
 };
 
 struct nrs_fifo_req {
 	struct list_head	fr_list;
-	__u64			fr_sequence;
+	u64			fr_sequence;
 };
 
 /** @} fifo */
drivers/staging/lustre/lustre/include/lustre_req_layout.h +2 -2
index 3387ab2..2aba99f 100644
@@ -66,7 +66,7 @@ struct req_capsule {
 	struct ptlrpc_request   *rc_req;
 	const struct req_format *rc_fmt;
 	enum req_location	rc_loc;
-	__u32		    rc_area[RCL_NR][REQ_MAX_FIELD_NR];
+	u32		    rc_area[RCL_NR][REQ_MAX_FIELD_NR];
 };
 
 void req_capsule_init(struct req_capsule *pill, struct ptlrpc_request *req,
@@ -105,7 +105,7 @@ u32 req_capsule_get_size(const struct req_capsule *pill,
 			 const struct req_msg_field *field,
 			 enum req_location loc);
 u32 req_capsule_msg_size(struct req_capsule *pill, enum req_location loc);
-u32 req_capsule_fmt_size(__u32 magic, const struct req_format *fmt,
+u32 req_capsule_fmt_size(u32 magic, const struct req_format *fmt,
 			 enum req_location loc);
 void req_capsule_extend(struct req_capsule *pill, const struct req_format *fmt);
 
drivers/staging/lustre/lustre/include/lustre_sec.h +46 -46

197 lines not on this page · raw message

drivers/staging/lustre/lustre/include/lustre_swab.h +3 -3
index 6939ac1..1758dd9 100644
@@ -62,7 +62,7 @@
 void lustre_swab_ost_lvb(struct ost_lvb *lvb);
 void lustre_swab_obd_quotactl(struct obd_quotactl *q);
 void lustre_swab_lquota_lvb(struct lquota_lvb *lvb);
-void lustre_swab_generic_32s(__u32 *val);
+void lustre_swab_generic_32s(u32 *val);
 void lustre_swab_mdt_body(struct mdt_body *b);
 void lustre_swab_mdt_ioepoch(struct mdt_ioepoch *b);
 void lustre_swab_mdt_rec_setattr(struct mdt_rec_setattr *sa);
@@ -79,7 +79,7 @@
 void lustre_swab_mgs_config_body(struct mgs_config_body *body);
 void lustre_swab_mgs_config_res(struct mgs_config_res *body);
 void lustre_swab_ost_body(struct ost_body *b);
-void lustre_swab_ost_last_id(__u64 *id);
+void lustre_swab_ost_last_id(u64 *id);
 void lustre_swab_fiemap(struct fiemap *fiemap);
 void lustre_swab_lov_user_md_v1(struct lov_user_md_v1 *lum);
 void lustre_swab_lov_user_md_v3(struct lov_user_md_v3 *lum);
@@ -107,6 +107,6 @@ void lustre_swab_lov_user_md_objects(struct lov_user_ost_data *lod,
 void dump_rniobuf(struct niobuf_remote *rnb);
 void dump_ioo(struct obd_ioobj *nb);
 void dump_ost_body(struct ost_body *ob);
-void dump_rcs(__u32 *rc);
+void dump_rcs(u32 *rc);
 
 #endif
drivers/staging/lustre/lustre/include/obd.h +42 -42

245 lines not on this page · raw message

drivers/staging/lustre/lustre/include/obd_class.h +14 -14
index cc00915..b64ba8b 100644
@@ -92,8 +92,8 @@ int obd_connect_flags2str(char *page, int count, u64 flags, u64 flags2,
 
 int obd_get_request_slot(struct client_obd *cli);
 void obd_put_request_slot(struct client_obd *cli);
-__u32 obd_get_max_rpcs_in_flight(struct client_obd *cli);
-int obd_set_max_rpcs_in_flight(struct client_obd *cli, __u32 max);
+u32 obd_get_max_rpcs_in_flight(struct client_obd *cli);
+int obd_set_max_rpcs_in_flight(struct client_obd *cli, u32 max);
 int obd_set_max_mod_rpcs_in_flight(struct client_obd *cli, u16 max);
 int obd_mod_rpc_stats_seq_show(struct client_obd *cli, struct seq_file *seq);
 
@@ -356,8 +356,8 @@ static inline int class_devno_max(void)
 }
 
 static inline int obd_get_info(const struct lu_env *env,
-			       struct obd_export *exp, __u32 keylen,
-			       void *key, __u32 *vallen, void *val)
+			       struct obd_export *exp, u32 keylen,
+			       void *key, u32 *vallen, void *val)
 {
 	int rc;
 
@@ -873,7 +873,7 @@ static inline int obd_destroy_export(struct obd_export *exp)
  */
 static inline int obd_statfs_async(struct obd_export *exp,
 				   struct obd_info *oinfo,
-				   __u64 max_age,
+				   u64 max_age,
 				   struct ptlrpc_request_set *rqset)
 {
 	int rc = 0;
@@ -909,8 +909,8 @@ static inline int obd_statfs_async(struct obd_export *exp,
 }
 
 static inline int obd_statfs_rqset(struct obd_export *exp,
-				   struct obd_statfs *osfs, __u64 max_age,
-				   __u32 flags)
+				   struct obd_statfs *osfs, u64 max_age,
+				   u32 flags)
 {
 	struct ptlrpc_request_set *set = NULL;
 	struct obd_info oinfo = {
@@ -936,8 +936,8 @@ static inline int obd_statfs_rqset(struct obd_export *exp,
  * target.  Use a value of "jiffies + HZ" to guarantee freshness.
  */
 static inline int obd_statfs(const struct lu_env *env, struct obd_export *exp,
-			     struct obd_statfs *osfs, __u64 max_age,
-			     __u32 flags)
+			     struct obd_statfs *osfs, u64 max_age,
+			     u32 flags)
 {
 	struct obd_device *obd = exp->exp_obd;
 	int rc = 0;
@@ -1509,7 +1509,7 @@ static inline int md_clear_open_replay_data(struct obd_export *exp,
 
 static inline int md_set_lock_data(struct obd_export *exp,
 				   const struct lustre_handle *lockh,
-				   void *data, __u64 *bits)
+				   void *data, u64 *bits)
 {
 	int rc;
 
@@ -1537,7 +1537,7 @@ static inline int md_cancel_unused(struct obd_export *exp,
 						flags, opaque);
 }
 
-static inline enum ldlm_mode md_lock_match(struct obd_export *exp, __u64 flags,
+static inline enum ldlm_mode md_lock_match(struct obd_export *exp, u64 flags,
 					   const struct lu_fid *fid,
 					   enum ldlm_type type,
 					   union ldlm_policy_data *policy,
@@ -1583,7 +1583,7 @@ static inline int md_intent_getattr_async(struct obd_export *exp,
 
 static inline int md_revalidate_lock(struct obd_export *exp,
 				     struct lookup_intent *it,
-				     struct lu_fid *fid, __u64 *bits)
+				     struct lu_fid *fid, u64 *bits)
 {
 	int rc;
 
@@ -1669,9 +1669,9 @@ static inline void class_uuid_unparse(class_uuid_t uu, struct obd_uuid *out)
 
 /* lustre_peer.c    */
 int lustre_uuid_to_peer(const char *uuid, lnet_nid_t *peer_nid, int index);
-int class_add_uuid(const char *uuid, __u64 nid);
+int class_add_uuid(const char *uuid, u64 nid);
 int class_del_uuid(const char *uuid);
-int class_check_uuid(struct obd_uuid *uuid, __u64 nid);
+int class_check_uuid(struct obd_uuid *uuid, u64 nid);
 
 /* class_obd.c */
 extern char obd_jobid_node[];
Signature · 1 line
1.8.3.1
#6 lore raw

PATCH 6/26 ldlm: use kernel types for kernel code

In reply to James Simmons

Lustre ldlm code was originally both a user land and kernel implementation. The source contains many types of the form __u32 but since this is mostly kernel code change the types to kernel internal types.

---
 drivers/staging/lustre/lustre/ldlm/ldlm_extent.c   |  8 +++---
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c    |  2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 12 ++++----
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c     | 14 +++++-----
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c     | 22 +++++++--------
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  | 32 +++++++++++-----------
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 22 +++++++--------
 7 files changed, 56 insertions(+), 56 deletions(-)
drivers/staging/lustre/lustre/ldlm/ldlm_extent.c +4 -4
index 225c023..99aef0b 100644
@@ -57,7 +57,7 @@
 
 #define START(node) ((node)->l_policy_data.l_extent.start)
 #define LAST(node) ((node)->l_policy_data.l_extent.end)
-INTERVAL_TREE_DEFINE(struct ldlm_lock, l_rb, __u64, __subtree_last,
+INTERVAL_TREE_DEFINE(struct ldlm_lock, l_rb, u64, __subtree_last,
 		     START, LAST, static, extent);
 
 /* When a lock is cancelled by a client, the KMS may undergo change if this
@@ -66,11 +66,11 @@
  *
  * NB: A lock on [x,y] protects a KMS of up to y + 1 bytes!
  */
-__u64 ldlm_extent_shift_kms(struct ldlm_lock *lock, __u64 old_kms)
+u64 ldlm_extent_shift_kms(struct ldlm_lock *lock, u64 old_kms)
 {
 	struct ldlm_resource *res = lock->l_resource;
 	struct ldlm_lock *lck;
-	__u64 kms = 0;
+	u64 kms = 0;
 
 	/* don't let another thread in ldlm_extent_shift_kms race in
 	 * just after we finish and take our lock into account in its
@@ -192,7 +192,7 @@ void ldlm_extent_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
 }
 
 void ldlm_extent_search(struct rb_root_cached *root,
-			__u64 start, __u64 end,
+			u64 start, u64 end,
 			bool (*matches)(struct ldlm_lock *lock, void *data),
 			void *data)
 {
drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +1 -1
index 94f3b1e..baa5b3a 100644
@@ -312,7 +312,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req)
  * \retval <0   : failure
  */
 int
-ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
+ldlm_flock_completion_ast(struct ldlm_lock *lock, u64 flags, void *data)
 {
 	struct file_lock		*getlk = lock->l_ast_data;
 	int				rc = 0;
drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +6 -6
index b64e2be0..d8dcf8a 100644
@@ -136,10 +136,10 @@ struct ldlm_lock *
 ldlm_lock_create(struct ldlm_namespace *ns, const struct ldlm_res_id *id,
 		 enum ldlm_type type, enum ldlm_mode mode,
 		 const struct ldlm_callback_suite *cbs,
-		 void *data, __u32 lvb_len, enum lvb_type lvb_type);
+		 void *data, u32 lvb_len, enum lvb_type lvb_type);
 enum ldlm_error ldlm_lock_enqueue(struct ldlm_namespace *ns,
 				  struct ldlm_lock **lock, void *cookie,
-				  __u64 *flags);
+				  u64 *flags);
 void ldlm_lock_addref_internal(struct ldlm_lock *lock, enum ldlm_mode mode);
 void ldlm_lock_addref_internal_nolock(struct ldlm_lock *lock,
 				      enum ldlm_mode mode);
@@ -176,7 +176,7 @@ void ldlm_handle_bl_callback(struct ldlm_namespace *ns,
 void ldlm_extent_add_lock(struct ldlm_resource *res, struct ldlm_lock *lock);
 void ldlm_extent_unlink_lock(struct ldlm_lock *lock);
 void ldlm_extent_search(struct rb_root_cached *root,
-			__u64 start, __u64 end,
+			u64 start, u64 end,
 			bool (*matches)(struct ldlm_lock *lock, void *data),
 			void *data);
 
@@ -195,9 +195,9 @@ struct ldlm_state {
 };
 
 /* ldlm_pool.c */
-__u64 ldlm_pool_get_slv(struct ldlm_pool *pl);
-void ldlm_pool_set_clv(struct ldlm_pool *pl, __u64 clv);
-__u32 ldlm_pool_get_lvf(struct ldlm_pool *pl);
+u64 ldlm_pool_get_slv(struct ldlm_pool *pl);
+void ldlm_pool_set_clv(struct ldlm_pool *pl, u64 clv);
+u32 ldlm_pool_get_lvf(struct ldlm_pool *pl);
 
 int ldlm_init(void);
 void ldlm_exit(void);
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +7 -7
index ebdfc11..e726e76 100644
@@ -508,7 +508,7 @@ void ldlm_lock2handle(const struct ldlm_lock *lock, struct lustre_handle *lockh)
  *	      Return NULL if flag already set
  */
 struct ldlm_lock *__ldlm_handle2lock(const struct lustre_handle *handle,
-				     __u64 flags)
+				     u64 flags)
 {
 	struct ldlm_lock *lock;
 
@@ -1043,7 +1043,7 @@ struct lock_match_data {
 	struct ldlm_lock	*lmd_lock;
 	enum ldlm_mode		*lmd_mode;
 	union ldlm_policy_data	*lmd_policy;
-	__u64			 lmd_flags;
+	u64			 lmd_flags;
 	int			 lmd_unref;
 };
 
@@ -1250,7 +1250,7 @@ void ldlm_lock_allow_match(struct ldlm_lock *lock)
  * keep caller code unchanged), the context failure will be discovered by
  * caller sometime later.
  */
-enum ldlm_mode ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags,
+enum ldlm_mode ldlm_lock_match(struct ldlm_namespace *ns, u64 flags,
 			       const struct ldlm_res_id *res_id,
 			       enum ldlm_type type,
 			       union ldlm_policy_data *policy,
@@ -1313,7 +1313,7 @@ enum ldlm_mode ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags,
 	if (lock) {
 		ldlm_lock2handle(lock, lockh);
 		if ((flags & LDLM_FL_LVB_READY) && !ldlm_is_lvb_ready(lock)) {
-			__u64 wait_flags = LDLM_FL_LVB_READY |
+			u64 wait_flags = LDLM_FL_LVB_READY |
 				LDLM_FL_DESTROYED | LDLM_FL_FAIL_NOTIFIED;
 
 			if (lock->l_completion_ast) {
@@ -1381,7 +1381,7 @@ enum ldlm_mode ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags,
 EXPORT_SYMBOL(ldlm_lock_match);
 
 enum ldlm_mode ldlm_revalidate_lock_handle(const struct lustre_handle *lockh,
-					   __u64 *bits)
+					   u64 *bits)
 {
 	struct ldlm_lock *lock;
 	enum ldlm_mode mode = 0;
@@ -1519,7 +1519,7 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns,
 				   enum ldlm_type type,
 				   enum ldlm_mode mode,
 				   const struct ldlm_callback_suite *cbs,
-				   void *data, __u32 lvb_len,
+				   void *data, u32 lvb_len,
 				   enum lvb_type lvb_type)
 {
 	struct ldlm_lock *lock;
@@ -1580,7 +1580,7 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns,
  */
 enum ldlm_error ldlm_lock_enqueue(struct ldlm_namespace *ns,
 				  struct ldlm_lock **lockp,
-				  void *cookie, __u64 *flags)
+				  void *cookie, u64 *flags)
 {
 	struct ldlm_lock *lock = *lockp;
 	struct ldlm_resource *res = lock->l_resource;
drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +11 -11
index 36d14ee..e94d8a3 100644
@@ -137,22 +137,22 @@
  */
 #define LDLM_POOL_SLV_SHIFT (10)
 
-static inline __u64 dru(__u64 val, __u32 shift, int round_up)
+static inline u64 dru(u64 val, u32 shift, int round_up)
 {
 	return (val + (round_up ? (1 << shift) - 1 : 0)) >> shift;
 }
 
-static inline __u64 ldlm_pool_slv_max(__u32 L)
+static inline u64 ldlm_pool_slv_max(u32 L)
 {
 	/*
 	 * Allow to have all locks for 1 client for 10 hrs.
 	 * Formula is the following: limit * 10h / 1 client.
 	 */
-	__u64 lim = (__u64)L *  LDLM_POOL_MAX_AGE / 1;
+	u64 lim = (u64)L *  LDLM_POOL_MAX_AGE / 1;
 	return lim;
 }
 
-static inline __u64 ldlm_pool_slv_min(__u32 L)
+static inline u64 ldlm_pool_slv_min(u32 L)
 {
 	return 1;
 }
@@ -212,7 +212,7 @@ static inline int ldlm_pool_t2gsp(unsigned int t)
 static void ldlm_pool_recalc_stats(struct ldlm_pool *pl)
 {
 	int grant_plan = pl->pl_grant_plan;
-	__u64 slv = pl->pl_server_lock_volume;
+	u64 slv = pl->pl_server_lock_volume;
 	int granted = atomic_read(&pl->pl_granted);
 	int grant_rate = atomic_read(&pl->pl_grant_rate);
 	int cancel_rate = atomic_read(&pl->pl_cancel_rate);
@@ -430,8 +430,8 @@ static int lprocfs_pool_state_seq_show(struct seq_file *m, void *unused)
 	int granted, grant_rate, cancel_rate;
 	int grant_speed, lvf;
 	struct ldlm_pool *pl = m->private;
-	__u64 slv, clv;
-	__u32 limit;
+	u64 slv, clv;
+	u32 limit;
 
 	spin_lock(&pl->pl_lock);
 	slv = pl->pl_server_lock_volume;
@@ -739,9 +739,9 @@ void ldlm_pool_del(struct ldlm_pool *pl, struct ldlm_lock *lock)
  *
  * \pre ->pl_lock is not locked.
  */
-__u64 ldlm_pool_get_slv(struct ldlm_pool *pl)
+u64 ldlm_pool_get_slv(struct ldlm_pool *pl)
 {
-	__u64 slv;
+	u64 slv;
 
 	spin_lock(&pl->pl_lock);
 	slv = pl->pl_server_lock_volume;
@@ -754,7 +754,7 @@ __u64 ldlm_pool_get_slv(struct ldlm_pool *pl)
  *
  * \pre ->pl_lock is not locked.
  */
-void ldlm_pool_set_clv(struct ldlm_pool *pl, __u64 clv)
+void ldlm_pool_set_clv(struct ldlm_pool *pl, u64 clv)
 {
 	spin_lock(&pl->pl_lock);
 	pl->pl_client_lock_volume = clv;
@@ -764,7 +764,7 @@ void ldlm_pool_set_clv(struct ldlm_pool *pl, __u64 clv)
 /**
  * Returns current LVF from \a pl.
  */
-__u32 ldlm_pool_get_lvf(struct ldlm_pool *pl)
+u32 ldlm_pool_get_lvf(struct ldlm_pool *pl)
 {
 	return atomic_read(&pl->pl_lock_volume_factor);
 }
drivers/staging/lustre/lustre/ldlm/ldlm_request.c +16 -16
index c09359a..a7fe8c6 100644
@@ -104,7 +104,7 @@ static int ldlm_request_bufsize(int count, int type)
 	return sizeof(struct ldlm_request) + avail;
 }
 
-static void ldlm_expired_completion_wait(struct ldlm_lock *lock, __u32 conn_cnt)
+static void ldlm_expired_completion_wait(struct ldlm_lock *lock, u32 conn_cnt)
 {
 	struct obd_import *imp;
 	struct obd_device *obd;
@@ -213,13 +213,13 @@ static int ldlm_completion_tail(struct ldlm_lock *lock, void *data)
  * or penultimate cases happen in some other thread.
  *
  */
-int ldlm_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
+int ldlm_completion_ast(struct ldlm_lock *lock, u64 flags, void *data)
 {
 	/* XXX ALLOCATE - 160 bytes */
 	struct obd_device *obd;
 	struct obd_import *imp = NULL;
-	__u32 timeout;
-	__u32 conn_cnt = 0;
+	u32 timeout;
+	u32 conn_cnt = 0;
 	int rc = 0;
 
 	if (flags == LDLM_FL_WAIT_NOREPROC) {
@@ -337,9 +337,9 @@ static void failed_lock_cleanup(struct ldlm_namespace *ns,
  * Called after receiving reply from server.
  */
 int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req,
-			  enum ldlm_type type, __u8 with_policy,
+			  enum ldlm_type type, u8 with_policy,
 			  enum ldlm_mode mode,
-			  __u64 *flags, void *lvb, __u32 lvb_len,
+			  u64 *flags, void *lvb, u32 lvb_len,
 			  const struct lustre_handle *lockh, int rc)
 {
 	struct ldlm_namespace *ns = exp->exp_obd->obd_namespace;
@@ -670,8 +670,8 @@ static struct ptlrpc_request *ldlm_enqueue_pack(struct obd_export *exp,
 int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
 		     struct ldlm_enqueue_info *einfo,
 		     const struct ldlm_res_id *res_id,
-		     union ldlm_policy_data const *policy, __u64 *flags,
-		     void *lvb, __u32 lvb_len, enum lvb_type lvb_type,
+		     union ldlm_policy_data const *policy, u64 *flags,
+		     void *lvb, u32 lvb_len, enum lvb_type lvb_type,
 		     struct lustre_handle *lockh, int async)
 {
 	struct ldlm_namespace *ns;
@@ -792,9 +792,9 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
  * \retval LDLM_FL_CANCELING otherwise;
  * \retval LDLM_FL_BL_AST if there is a need for a separate CANCEL RPC.
  */
-static __u64 ldlm_cli_cancel_local(struct ldlm_lock *lock)
+static u64 ldlm_cli_cancel_local(struct ldlm_lock *lock)
 {
-	__u64 rc = LDLM_FL_LOCAL_ONLY;
+	u64 rc = LDLM_FL_LOCAL_ONLY;
 
 	if (lock->l_conn_export) {
 		bool local_only;
@@ -960,8 +960,8 @@ static inline struct ldlm_pool *ldlm_imp2pl(struct obd_import *imp)
 int ldlm_cli_update_pool(struct ptlrpc_request *req)
 {
 	struct obd_device *obd;
-	__u64 new_slv;
-	__u32 new_limit;
+	u64 new_slv;
+	u32 new_limit;
 
 	if (unlikely(!req->rq_import || !req->rq_import->imp_obd ||
 		     !imp_connect_lru_resize(req->rq_import))) {
@@ -1014,7 +1014,7 @@ int ldlm_cli_cancel(const struct lustre_handle *lockh,
 {
 	struct obd_export *exp;
 	int avail, flags, count = 1;
-	__u64 rc = 0;
+	u64 rc = 0;
 	struct ldlm_namespace *ns;
 	struct ldlm_lock *lock;
 	LIST_HEAD(cancels);
@@ -1080,7 +1080,7 @@ int ldlm_cli_cancel_list_local(struct list_head *cancels, int count,
 	LIST_HEAD(head);
 	struct ldlm_lock *lock, *next;
 	int left = 0, bl_ast = 0;
-	__u64 rc;
+	u64 rc;
 
 	left = count;
 	list_for_each_entry_safe(lock, next, cancels, l_bl_ast) {
@@ -1169,7 +1169,7 @@ static enum ldlm_policy_res ldlm_cancel_lrur_policy(struct ldlm_namespace *ns,
 {
 	unsigned long cur = jiffies;
 	struct ldlm_pool *pl = &ns->ns_pool;
-	__u64 slv, lvf, lv;
+	u64 slv, lvf, lv;
 	unsigned long la;
 
 	/* Stop LRU processing when we reach past @count or have checked all
@@ -1562,7 +1562,7 @@ int ldlm_cancel_lru(struct ldlm_namespace *ns, int nr,
 int ldlm_cancel_resource_local(struct ldlm_resource *res,
 			       struct list_head *cancels,
 			       union ldlm_policy_data *policy,
-			       enum ldlm_mode mode, __u64 lock_flags,
+			       enum ldlm_mode mode, u64 lock_flags,
 			       enum ldlm_cancel_flags cancel_flags,
 			       void *opaque)
 {
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +11 -11
index 11c0b88..e0b9918 100644
@@ -132,7 +132,7 @@ static ssize_t resource_count_show(struct kobject *kobj, struct attribute *attr,
 {
 	struct ldlm_namespace *ns = container_of(kobj, struct ldlm_namespace,
 						 ns_kobj);
-	__u64		  res = 0;
+	u64		  res = 0;
 	struct cfs_hash_bd	  bd;
 	int		    i;
 
@@ -148,7 +148,7 @@ static ssize_t lock_count_show(struct kobject *kobj, struct attribute *attr,
 {
 	struct ldlm_namespace *ns = container_of(kobj, struct ldlm_namespace,
 						 ns_kobj);
-	__u64		  locks;
+	u64		  locks;
 
 	locks = lprocfs_stats_collector(ns->ns_stats, LDLM_NSS_LOCKS,
 					LPROCFS_FIELDS_FLAGS_SUM);
@@ -172,7 +172,7 @@ static ssize_t lru_size_show(struct kobject *kobj, struct attribute *attr,
 {
 	struct ldlm_namespace *ns = container_of(kobj, struct ldlm_namespace,
 						 ns_kobj);
-	__u32 *nr = &ns->ns_max_unused;
+	u32 *nr = &ns->ns_max_unused;
 
 	if (ns_connect_lru_resize(ns))
 		nr = &ns->ns_nr_unused;
@@ -421,12 +421,12 @@ static unsigned int ldlm_res_hop_fid_hash(struct cfs_hash *hs,
 {
 	const struct ldlm_res_id *id = key;
 	struct lu_fid       fid;
-	__u32	       hash;
-	__u32	       val;
+	u32	       hash;
+	u32	       val;
 
 	fid.f_seq = id->name[LUSTRE_RES_ID_SEQ_OFF];
-	fid.f_oid = (__u32)id->name[LUSTRE_RES_ID_VER_OID_OFF];
-	fid.f_ver = (__u32)(id->name[LUSTRE_RES_ID_VER_OID_OFF] >> 32);
+	fid.f_oid = (u32)id->name[LUSTRE_RES_ID_VER_OID_OFF];
+	fid.f_ver = (u32)(id->name[LUSTRE_RES_ID_VER_OID_OFF] >> 32);
 
 	hash = fid_flatten32(&fid);
 	hash += (hash >> 4) + (hash << 12); /* mixing oid and seq */
@@ -694,7 +694,7 @@ struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name,
  * locks with refs.
  */
 static void cleanup_resource(struct ldlm_resource *res, struct list_head *q,
-			     __u64 flags)
+			     u64 flags)
 {
 	int rc = 0;
 	bool local_only = !!(flags & LDLM_FL_LOCAL_ONLY);
@@ -764,7 +764,7 @@ static int ldlm_resource_clean(struct cfs_hash *hs, struct cfs_hash_bd *bd,
 			       struct hlist_node *hnode, void *arg)
 {
 	struct ldlm_resource *res = cfs_hash_object(hs, hnode);
-	__u64 flags = *(__u64 *)arg;
+	u64 flags = *(u64 *)arg;
 
 	cleanup_resource(res, &res->lr_granted, flags);
 	cleanup_resource(res, &res->lr_waiting, flags);
@@ -795,7 +795,7 @@ static int ldlm_resource_complain(struct cfs_hash *hs, struct cfs_hash_bd *bd,
  * evicted and all of its state needs to be destroyed.
  * Also used during shutdown.
  */
-int ldlm_namespace_cleanup(struct ldlm_namespace *ns, __u64 flags)
+int ldlm_namespace_cleanup(struct ldlm_namespace *ns, u64 flags)
 {
 	if (!ns) {
 		CDEBUG(D_INFO, "NULL ns, skipping cleanup\n");
@@ -1048,7 +1048,7 @@ struct ldlm_resource *
 	struct hlist_node     *hnode;
 	struct ldlm_resource *res = NULL;
 	struct cfs_hash_bd	 bd;
-	__u64		 version;
+	u64		 version;
 	int		      ns_refcount = 0;
 	int rc;
 
Signature · 1 line
1.8.3.1
#7 lore raw

PATCH 7/26 obdclass: use kernel types for kernel code

In reply to James Simmons

Lustre obdclass code was originally both a user land and kernel implementation. The source contains many types of the form __u32 but since this is mostly kernel code change the types to kernel internal types.

---
 drivers/staging/lustre/lustre/obdclass/cl_io.c     |  2 +-
 drivers/staging/lustre/lustre/obdclass/cl_lock.c   |  2 +-
 drivers/staging/lustre/lustre/obdclass/cl_object.c |  2 +-
 drivers/staging/lustre/lustre/obdclass/class_obd.c | 14 +++----
 drivers/staging/lustre/lustre/obdclass/debug.c     | 16 ++++----
 drivers/staging/lustre/lustre/obdclass/genops.c    | 10 ++---
 drivers/staging/lustre/lustre/obdclass/llog_swab.c | 14 +++----
 .../lustre/lustre/obdclass/lprocfs_counters.c      |  2 +-
 .../lustre/lustre/obdclass/lprocfs_status.c        | 46 +++++++++++-----------
 drivers/staging/lustre/lustre/obdclass/lu_object.c | 26 ++++++------
 .../lustre/lustre/obdclass/lustre_handles.c        |  4 +-
 .../staging/lustre/lustre/obdclass/lustre_peer.c   |  4 +-
 .../staging/lustre/lustre/obdclass/obd_config.c    |  4 +-
 drivers/staging/lustre/lustre/obdclass/obd_mount.c |  8 ++--
 14 files changed, 77 insertions(+), 77 deletions(-)
drivers/staging/lustre/lustre/obdclass/cl_io.c +1 -1
index 84c7710..d3f2455 100644
@@ -205,7 +205,7 @@ int cl_io_rw_init(const struct lu_env *env, struct cl_io *io,
 
 	LU_OBJECT_HEADER(D_VFSTRACE, env, &io->ci_obj->co_lu,
 			 "io range: %u [%llu, %llu) %u %u\n",
-			 iot, (__u64)pos, (__u64)pos + count,
+			 iot, (u64)pos, (u64)pos + count,
 			 io->u.ci_rw.crw_nonblock, io->u.ci_wr.wr_append);
 	io->u.ci_rw.crw_pos    = pos;
 	io->u.ci_rw.crw_count  = count;
drivers/staging/lustre/lustre/obdclass/cl_lock.c +1 -1
index 23c1609..425ca9c 100644
@@ -180,7 +180,7 @@ int cl_lock_request(const struct lu_env *env, struct cl_io *io,
 		    struct cl_lock *lock)
 {
 	struct cl_sync_io *anchor = NULL;
-	__u32 enq_flags = lock->cll_descr.cld_enq_flags;
+	u32 enq_flags = lock->cll_descr.cld_enq_flags;
 	int rc;
 
 	rc = cl_lock_init(env, lock, io);
drivers/staging/lustre/lustre/obdclass/cl_object.c +1 -1
index b2bf570..5b59a71 100644
@@ -592,7 +592,7 @@ static void cl_env_init0(struct cl_env *cle, void *debug)
 	cl_env_inc(CS_busy);
 }
 
-static struct lu_env *cl_env_new(__u32 ctx_tags, __u32 ses_tags, void *debug)
+static struct lu_env *cl_env_new(u32 ctx_tags, u32 ses_tags, void *debug)
 {
 	struct lu_env *env;
 	struct cl_env *cle;
drivers/staging/lustre/lustre/obdclass/class_obd.c +7 -7
index 75345dd..e130cf7 100644
@@ -120,7 +120,7 @@ int lustre_get_jobid(char *jobid)
 }
 EXPORT_SYMBOL(lustre_get_jobid);
 
-static int class_resolve_dev_name(__u32 len, const char *name)
+static int class_resolve_dev_name(u32 len, const char *name)
 {
 	int rc;
 	int dev;
@@ -594,19 +594,19 @@ static long obd_class_ioctl(struct file *filp, unsigned int cmd,
 
 static int obd_init_checks(void)
 {
-	__u64 u64val, div64val;
+	u64 u64val, div64val;
 	char buf[64];
 	int len, ret = 0;
 
 	CDEBUG(D_INFO, "LPU64=%s, LPD64=%s, LPX64=%s\n", "%llu", "%lld",
 	       "%#llx");
 
-	CDEBUG(D_INFO, "OBD_OBJECT_EOF = %#llx\n", (__u64)OBD_OBJECT_EOF);
+	CDEBUG(D_INFO, "OBD_OBJECT_EOF = %#llx\n", (u64)OBD_OBJECT_EOF);
 
 	u64val = OBD_OBJECT_EOF;
 	CDEBUG(D_INFO, "u64val OBD_OBJECT_EOF = %#llx\n", u64val);
 	if (u64val != OBD_OBJECT_EOF) {
-		CERROR("__u64 %#llx(%d) != 0xffffffffffffffff\n",
+		CERROR("u64 %#llx(%d) != 0xffffffffffffffff\n",
 		       u64val, (int)sizeof(u64val));
 		ret = -EINVAL;
 	}
@@ -619,12 +619,12 @@ static int obd_init_checks(void)
 	div64val = OBD_OBJECT_EOF;
 	CDEBUG(D_INFO, "u64val OBD_OBJECT_EOF = %#llx\n", u64val);
 	if (u64val != OBD_OBJECT_EOF) {
-		CERROR("__u64 %#llx(%d) != 0xffffffffffffffff\n",
+		CERROR("u64 %#llx(%d) != 0xffffffffffffffff\n",
 		       u64val, (int)sizeof(u64val));
 		ret = -EOVERFLOW;
 	}
 	if (u64val >> 8 != OBD_OBJECT_EOF >> 8) {
-		CERROR("__u64 %#llx(%d) != 0xffffffffffffffff\n",
+		CERROR("u64 %#llx(%d) != 0xffffffffffffffff\n",
 		       u64val, (int)sizeof(u64val));
 		return -EOVERFLOW;
 	}
@@ -654,7 +654,7 @@ static int obd_init_checks(void)
 	}
 	if ((u64val & ~PAGE_MASK) >= PAGE_SIZE) {
 		CWARN("mask failed: u64val %llu >= %llu\n", u64val,
-		      (__u64)PAGE_SIZE);
+		      (u64)PAGE_SIZE);
 		ret = -EINVAL;
 	}
 
drivers/staging/lustre/lustre/obdclass/debug.c +8 -8
index 2156a82..2e526c7 100644
@@ -43,8 +43,8 @@
 #include <lustre_debug.h>
 #include <lustre_net.h>
 
-#define LPDS sizeof(__u64)
-int block_debug_setup(void *addr, int len, __u64 off, __u64 id)
+#define LPDS sizeof(u64)
+int block_debug_setup(void *addr, int len, u64 off, u64 id)
 {
 	LASSERT(addr);
 
@@ -58,9 +58,9 @@ int block_debug_setup(void *addr, int len, __u64 off, __u64 id)
 }
 EXPORT_SYMBOL(block_debug_setup);
 
-int block_debug_check(char *who, void *addr, int end, __u64 off, __u64 id)
+int block_debug_check(char *who, void *addr, int end, u64 off, u64 id)
 {
-	__u64 ne_off;
+	u64 ne_off;
 	int err = 0;
 
 	LASSERT(addr);
@@ -69,24 +69,24 @@ int block_debug_check(char *who, void *addr, int end, __u64 off, __u64 id)
 	id = le64_to_cpu(id);
 	if (memcmp(addr, (char *)&ne_off, LPDS)) {
 		CDEBUG(D_ERROR, "%s: id %#llx offset %llu off: %#llx != %#llx\n",
-		       who, id, off, *(__u64 *)addr, ne_off);
+		       who, id, off, *(u64 *)addr, ne_off);
 		err = -EINVAL;
 	}
 	if (memcmp(addr + LPDS, (char *)&id, LPDS)) {
 		CDEBUG(D_ERROR, "%s: id %#llx offset %llu id: %#llx != %#llx\n",
-		       who, id, off, *(__u64 *)(addr + LPDS), id);
+		       who, id, off, *(u64 *)(addr + LPDS), id);
 		err = -EINVAL;
 	}
 
 	addr += end - LPDS - LPDS;
 	if (memcmp(addr, (char *)&ne_off, LPDS)) {
 		CDEBUG(D_ERROR, "%s: id %#llx offset %llu end off: %#llx != %#llx\n",
-		       who, id, off, *(__u64 *)addr, ne_off);
+		       who, id, off, *(u64 *)addr, ne_off);
 		err = -EINVAL;
 	}
 	if (memcmp(addr + LPDS, (char *)&id, LPDS)) {
 		CDEBUG(D_ERROR, "%s: id %#llx offset %llu end id: %#llx != %#llx\n",
-		       who, id, off, *(__u64 *)(addr + LPDS), id);
+		       who, id, off, *(u64 *)(addr + LPDS), id);
 		err = -EINVAL;
 	}
 
drivers/staging/lustre/lustre/obdclass/genops.c +5 -5
index 03df181..3d4d6e1 100644
@@ -1366,17 +1366,17 @@ void obd_put_request_slot(struct client_obd *cli)
 }
 EXPORT_SYMBOL(obd_put_request_slot);
 
-__u32 obd_get_max_rpcs_in_flight(struct client_obd *cli)
+u32 obd_get_max_rpcs_in_flight(struct client_obd *cli)
 {
 	return cli->cl_max_rpcs_in_flight;
 }
 EXPORT_SYMBOL(obd_get_max_rpcs_in_flight);
 
-int obd_set_max_rpcs_in_flight(struct client_obd *cli, __u32 max)
+int obd_set_max_rpcs_in_flight(struct client_obd *cli, u32 max)
 {
 	struct obd_request_slot_waiter *orsw;
 	const char *typ_name;
-	__u32 old;
+	u32 old;
 	int diff;
 	int rc;
 	int i;
@@ -1424,7 +1424,7 @@ int obd_set_max_rpcs_in_flight(struct client_obd *cli, __u32 max)
 }
 EXPORT_SYMBOL(obd_set_max_rpcs_in_flight);
 
-int obd_set_max_mod_rpcs_in_flight(struct client_obd *cli, __u16 max)
+int obd_set_max_mod_rpcs_in_flight(struct client_obd *cli, u16 max)
 {
 	struct obd_connect_data *ocd;
 	u16 maxmodrpcs;
@@ -1564,7 +1564,7 @@ static inline bool obd_skip_mod_rpc_slot(const struct lookup_intent *it)
  * Returns the tag to be set in the request message. Tag 0
  * is reserved for non-modifying requests.
  */
-u16 obd_get_mod_rpc_slot(struct client_obd *cli, __u32 opc,
+u16 obd_get_mod_rpc_slot(struct client_obd *cli, u32 opc,
 			 struct lookup_intent *it)
 {
 	bool close_req = false;
drivers/staging/lustre/lustre/obdclass/llog_swab.c +7 -7
index f18330f..fddc1ea 100644
@@ -358,12 +358,12 @@ void lustre_swab_lustre_cfg(struct lustre_cfg *lcfg)
 
 /* used only for compatibility with old on-disk cfg_marker data */
 struct cfg_marker32 {
-	__u32   cm_step;
-	__u32   cm_flags;
-	__u32   cm_vers;
-	__u32   padding;
-	__u32   cm_createtime;
-	__u32   cm_canceltime;
+	u32   cm_step;
+	u32   cm_flags;
+	u32   cm_vers;
+	u32   padding;
+	u32   cm_createtime;
+	u32   cm_canceltime;
 	char    cm_tgtname[MTI_NAME_MAXLEN];
 	char    cm_comment[MTI_NAME_MAXLEN];
 };
@@ -381,7 +381,7 @@ void lustre_swab_cfg_marker(struct cfg_marker *marker, int swab, int size)
 		__swab32s(&marker->cm_vers);
 	}
 	if (size == sizeof(*cm32)) {
-		__u32 createtime, canceltime;
+		u32 createtime, canceltime;
 		/* There was a problem with the original declaration of
 		 * cfg_marker on 32-bit systems because it used time_t as
 		 * a wire protocol structure, and didn't verify this in
drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c +1 -1
index 85f09af..77bc66f 100644
@@ -82,7 +82,7 @@ void lprocfs_counter_add(struct lprocfs_stats *stats, int idx, long amount)
 			percpu_cntr->lc_sum += amount;
 
 		if (header->lc_config & LPROCFS_CNTR_STDDEV)
-			percpu_cntr->lc_sumsquare += (__s64)amount * amount;
+			percpu_cntr->lc_sumsquare += (s64)amount * amount;
 		if (amount < percpu_cntr->lc_min)
 			percpu_cntr->lc_min = amount;
 		if (amount > percpu_cntr->lc_max)
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +23 -23

141 lines not on this page · raw message

drivers/staging/lustre/lustre/obdclass/lu_object.c +13 -13
index c513e55..a132d87 100644
@@ -106,7 +106,7 @@ enum {
 MODULE_PARM_DESC(lu_cache_nr, "Maximum number of objects in lu_object cache");
 
 static void lu_object_free(const struct lu_env *env, struct lu_object *o);
-static __u32 ls_stats_read(struct lprocfs_stats *stats, int idx);
+static u32 ls_stats_read(struct lprocfs_stats *stats, int idx);
 
 wait_queue_head_t *
 lu_site_wq_from_fid(struct lu_site *site, struct lu_fid *fid)
@@ -590,7 +590,7 @@ void lu_object_print(const struct lu_env *env, void *cookie,
 static struct lu_object *htable_lookup(struct lu_site *s,
 				       struct cfs_hash_bd *bd,
 				       const struct lu_fid *f,
-				       __u64 *version)
+				       u64 *version)
 {
 	struct lu_site_bkt_data *bkt;
 	struct lu_object_header *h;
@@ -643,18 +643,18 @@ static struct lu_object *lu_object_find(const struct lu_env *env,
  */
 static void lu_object_limit(const struct lu_env *env, struct lu_device *dev)
 {
-	__u64 size, nr;
+	u64 size, nr;
 
 	if (lu_cache_nr == LU_CACHE_NR_UNLIMITED)
 		return;
 
 	size = cfs_hash_size_get(dev->ld_site->ls_obj_hash);
-	nr = (__u64)lu_cache_nr;
+	nr = (u64)lu_cache_nr;
 	if (size <= nr)
 		return;
 
 	lu_site_purge_objects(env, dev->ld_site,
-			      min_t(__u64, size - nr, LU_CACHE_NR_MAX_ADJUST),
+			      min_t(u64, size - nr, LU_CACHE_NR_MAX_ADJUST),
 			      false);
 }
 
@@ -675,7 +675,7 @@ struct lu_object *lu_object_find_at(const struct lu_env *env,
 	struct lu_site	*s;
 	struct cfs_hash	    *hs;
 	struct cfs_hash_bd	  bd;
-	__u64		  version = 0;
+	u64		  version = 0;
 
 	/*
 	 * This uses standard index maintenance protocol:
@@ -884,7 +884,7 @@ static unsigned int lu_obj_hop_hash(struct cfs_hash *hs,
 				    const void *key, unsigned int mask)
 {
 	struct lu_fid  *fid = (struct lu_fid *)key;
-	__u32	   hash;
+	u32	   hash;
 
 	hash = fid_flatten32(fid);
 	hash += (hash >> 4) + (hash << 12); /* mixing oid and seq */
@@ -1593,7 +1593,7 @@ static int keys_init(struct lu_context *ctx)
 /**
  * Initialize context data-structure. Create values for all keys.
  */
-int lu_context_init(struct lu_context *ctx, __u32 tags)
+int lu_context_init(struct lu_context *ctx, u32 tags)
 {
 	int	rc;
 
@@ -1705,10 +1705,10 @@ int lu_context_refill(struct lu_context *ctx)
  * predefined when the lu_device type are registered, during the module probe
  * phase.
  */
-__u32 lu_context_tags_default;
-__u32 lu_session_tags_default;
+u32 lu_context_tags_default;
+u32 lu_session_tags_default;
 
-int lu_env_init(struct lu_env *env, __u32 tags)
+int lu_env_init(struct lu_env *env, u32 tags)
 {
 	int result;
 
@@ -1939,12 +1939,12 @@ void lu_global_fini(void)
 	lu_ref_global_fini();
 }
 
-static __u32 ls_stats_read(struct lprocfs_stats *stats, int idx)
+static u32 ls_stats_read(struct lprocfs_stats *stats, int idx)
 {
 	struct lprocfs_counter ret;
 
 	lprocfs_stats_collect(stats, idx, &ret);
-	return (__u32)ret.lc_count;
+	return (u32)ret.lc_count;
 }
 
 /**
drivers/staging/lustre/lustre/obdclass/lustre_handles.c +2 -2
index cdc8dc1..b296877 100644
@@ -42,7 +42,7 @@
 #include <lustre_handles.h>
 #include <lustre_lib.h>
 
-static __u64 handle_base;
+static u64 handle_base;
 #define HANDLE_INCR 7
 static spinlock_t handle_base_lock;
 
@@ -132,7 +132,7 @@ void class_handle_unhash(struct portals_handle *h)
 }
 EXPORT_SYMBOL(class_handle_unhash);
 
-void *class_handle2object(__u64 cookie, const void *owner)
+void *class_handle2object(u64 cookie, const void *owner)
 {
 	struct handle_bucket *bucket;
 	struct portals_handle *h;
drivers/staging/lustre/lustre/obdclass/lustre_peer.c +2 -2
index 5705b0a..8e7f3a8 100644
@@ -80,7 +80,7 @@ int lustre_uuid_to_peer(const char *uuid, lnet_nid_t *peer_nid, int index)
 /* Add a nid to a niduuid.  Multiple nids can be added to a single uuid;
  * LNET will choose the best one.
  */
-int class_add_uuid(const char *uuid, __u64 nid)
+int class_add_uuid(const char *uuid, u64 nid)
 {
 	struct uuid_nid_data *data, *entry;
 	int found = 0;
@@ -173,7 +173,7 @@ int class_del_uuid(const char *uuid)
 }
 
 /* check if @nid exists in nid list of @uuid */
-int class_check_uuid(struct obd_uuid *uuid, __u64 nid)
+int class_check_uuid(struct obd_uuid *uuid, u64 nid)
 {
 	struct uuid_nid_data *entry;
 	int found = 0;
drivers/staging/lustre/lustre/obdclass/obd_config.c +2 -2
index 7d00ca4..887afda 100644
@@ -168,7 +168,7 @@ static int parse_nid(char *buf, void *value, int quiet)
 
 static int parse_net(char *buf, void *value)
 {
-	__u32 *net = value;
+	u32 *net = value;
 
 	*net = libcfs_str2net(buf);
 	CDEBUG(D_INFO, "Net %s\n", libcfs_net2str(*net));
@@ -1415,7 +1415,7 @@ int class_config_llog_handler(const struct lu_env *env,
 		 */
 		if (lcfg->lcfg_nal != 0 &&      /* pre-newconfig log? */
 		    (lcfg->lcfg_nid >> 32) == 0) {
-			__u32 addr = (__u32)(lcfg->lcfg_nid & 0xffffffff);
+			u32 addr = (u32)(lcfg->lcfg_nid & 0xffffffff);
 
 			lcfg_new->lcfg_nid =
 				LNET_MKNID(LNET_MKNET(lcfg->lcfg_nal, 0), addr);
drivers/staging/lustre/lustre/obdclass/obd_mount.c +4 -4
index db5e1b5..eab3216 100644
@@ -269,7 +269,7 @@ int lustre_start_mgc(struct super_block *sb)
 		if (lmd_is_client(lsi->lsi_lmd)) {
 			int has_ir;
 			int vallen = sizeof(*data);
-			__u32 *flags = &lsi->lsi_lmd->lmd_flags;
+			u32 *flags = &lsi->lsi_lmd->lmd_flags;
 
 			rc = obd_get_info(NULL, obd->obd_self_export,
 					  strlen(KEY_CONN_DATA), KEY_CONN_DATA,
@@ -621,7 +621,7 @@ static int server_name2fsname(const char *svname, char *fsname,
  * rc < 0  on error
  * if endptr isn't NULL it is set to end of name
  */
-static int server_name2index(const char *svname, __u32 *idx,
+static int server_name2index(const char *svname, u32 *idx,
 			     const char **endptr)
 {
 	unsigned long index;
@@ -721,7 +721,7 @@ int lustre_check_exclusion(struct super_block *sb, char *svname)
 {
 	struct lustre_sb_info *lsi = s2lsi(sb);
 	struct lustre_mount_data *lmd = lsi->lsi_lmd;
-	__u32 index;
+	u32 index;
 	int i, rc;
 
 	rc = server_name2index(svname, &index, NULL);
@@ -745,7 +745,7 @@ int lustre_check_exclusion(struct super_block *sb, char *svname)
 static int lmd_make_exclusion(struct lustre_mount_data *lmd, const char *ptr)
 {
 	const char *s1 = ptr, *s2;
-	__u32 index = 0, *exclude_list;
+	u32 index = 0, *exclude_list;
 	int rc = 0, devmax;
 
 	/* The shortest an ost name can be is 8 chars: -OST0000.
Signature · 1 line
1.8.3.1
#8 lore raw

PATCH 8/26 lustre: convert remaining code to kernel types

In reply to James Simmons

Convert the remaining Lustre kernel code to use the proper kernel types.

---
 drivers/staging/lustre/lustre/fid/fid_lib.c        |  2 +-
 drivers/staging/lustre/lustre/fid/fid_request.c    |  4 +-
 drivers/staging/lustre/lustre/fid/lproc_fid.c      |  4 +-
 drivers/staging/lustre/lustre/fld/fld_cache.c      |  4 +-
 drivers/staging/lustre/lustre/fld/fld_internal.h   | 12 ++--
 drivers/staging/lustre/lustre/fld/fld_request.c    |  8 +--
 drivers/staging/lustre/lustre/llite/dir.c          | 30 ++++-----
 drivers/staging/lustre/lustre/llite/file.c         | 46 +++++++-------
 drivers/staging/lustre/lustre/llite/lcommon_misc.c |  4 +-
 .../staging/lustre/lustre/llite/llite_internal.h   | 74 +++++++++++-----------
 drivers/staging/lustre/lustre/llite/llite_lib.c    | 12 ++--
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |  2 +-
 drivers/staging/lustre/lustre/llite/llite_nfs.c    | 12 ++--
 drivers/staging/lustre/lustre/llite/lproc_llite.c  |  6 +-
 drivers/staging/lustre/lustre/llite/namei.c        | 16 ++---
 drivers/staging/lustre/lustre/llite/range_lock.c   |  4 +-
 drivers/staging/lustre/lustre/llite/range_lock.h   | 10 +--
 drivers/staging/lustre/lustre/llite/rw.c           | 10 +--
 drivers/staging/lustre/lustre/llite/statahead.c    | 26 ++++----
 drivers/staging/lustre/lustre/llite/vvp_internal.h |  2 +-
 drivers/staging/lustre/lustre/llite/vvp_io.c       | 12 ++--
 drivers/staging/lustre/lustre/llite/xattr_cache.c  |  6 +-
 drivers/staging/lustre/lustre/lmv/lmv_intent.c     |  8 +--
 drivers/staging/lustre/lustre/lmv/lmv_internal.h   |  2 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c        | 50 +++++++--------
 .../staging/lustre/lustre/lov/lov_cl_internal.h    |  4 +-
 drivers/staging/lustre/lustre/lov/lov_dev.c        | 10 +--
 drivers/staging/lustre/lustre/lov/lov_internal.h   | 20 +++---
 drivers/staging/lustre/lustre/lov/lov_merge.c      |  8 +--
 drivers/staging/lustre/lustre/lov/lov_obd.c        | 46 +++++++-------
 drivers/staging/lustre/lustre/lov/lov_pack.c       |  2 +-
 drivers/staging/lustre/lustre/lov/lov_pool.c       |  4 +-
 drivers/staging/lustre/lustre/lov/lov_request.c    |  4 +-
 drivers/staging/lustre/lustre/mdc/mdc_internal.h   | 24 +++----
 drivers/staging/lustre/lustre/mdc/mdc_lib.c        | 22 +++----
 drivers/staging/lustre/lustre/mdc/mdc_locks.c      | 20 +++---
 drivers/staging/lustre/lustre/mdc/mdc_reint.c      |  6 +-
 drivers/staging/lustre/lustre/mdc/mdc_request.c    | 42 ++++++------
 drivers/staging/lustre/lustre/mgc/mgc_request.c    | 16 ++---
 .../staging/lustre/lustre/obdecho/echo_client.c    |  6 +-
 .../staging/lustre/lustre/obdecho/echo_internal.h  |  2 +-
 drivers/staging/lustre/lustre/osc/osc_cache.c      | 10 +--
 .../staging/lustre/lustre/osc/osc_cl_internal.h    |  2 +-
 drivers/staging/lustre/lustre/osc/osc_internal.h   |  6 +-
 drivers/staging/lustre/lustre/osc/osc_io.c         | 10 +--
 drivers/staging/lustre/lustre/osc/osc_lock.c       | 12 ++--
 drivers/staging/lustre/lustre/osc/osc_object.c     |  2 +-
 drivers/staging/lustre/lustre/osc/osc_request.c    | 38 +++++------
 48 files changed, 341 insertions(+), 341 deletions(-)
drivers/staging/lustre/lustre/fid/fid_lib.c +1 -1
index ac52b37..6b06847 100644
@@ -60,7 +60,7 @@
  */
 const struct lu_seq_range LUSTRE_SEQ_SPACE_RANGE = {
 	.lsr_start	= FID_SEQ_NORMAL,
-	.lsr_end	= (__u64)~0ULL,
+	.lsr_end	= (u64)~0ULL,
 };
 
 /* Zero range, used for init and other purposes. */
drivers/staging/lustre/lustre/fid/fid_request.c +2 -2
index f91242c..3f79f22 100644
@@ -52,13 +52,13 @@
 static struct dentry *seq_debugfs_dir;
 
 static int seq_client_rpc(struct lu_client_seq *seq,
-			  struct lu_seq_range *output, __u32 opc,
+			  struct lu_seq_range *output, u32 opc,
 			  const char *opcname)
 {
 	struct obd_export     *exp = seq->lcs_exp;
 	struct ptlrpc_request *req;
 	struct lu_seq_range   *out, *in;
-	__u32                 *op;
+	u32                 *op;
 	unsigned int           debug_mask;
 	int                    rc;
 
drivers/staging/lustre/lustre/fid/lproc_fid.c +2 -2
index aa2df68..d583778 100644
@@ -50,7 +50,7 @@
 #include "fid_internal.h"
 
 /* Format: [0x64BIT_INT - 0x64BIT_INT] + 32 bytes just in case */
-#define MAX_FID_RANGE_STRLEN (32 + 2 * 2 * sizeof(__u64))
+#define MAX_FID_RANGE_STRLEN (32 + 2 * 2 * sizeof(u64))
 /*
  * Note: this function is only used for testing, it is no safe for production
  * use.
@@ -143,7 +143,7 @@
 			     size_t count, loff_t *off)
 {
 	struct lu_client_seq *seq;
-	__u64  max;
+	u64  max;
 	int rc, val;
 
 	seq = ((struct seq_file *)file->private_data)->private;
drivers/staging/lustre/lustre/fld/fld_cache.c +2 -2
index a7415c9..749d33b 100644
@@ -94,7 +94,7 @@ struct fld_cache *fld_cache_init(const char *name,
  */
 void fld_cache_fini(struct fld_cache *cache)
 {
-	__u64 pct;
+	u64 pct;
 
 	LASSERT(cache);
 	fld_cache_flush(cache);
@@ -383,7 +383,7 @@ static int fld_cache_insert_nolock(struct fld_cache *cache,
 	struct list_head *prev = NULL;
 	const u64 new_start  = f_new->fce_range.lsr_start;
 	const u64 new_end  = f_new->fce_range.lsr_end;
-	__u32 new_flags  = f_new->fce_range.lsr_flags;
+	u32 new_flags  = f_new->fce_range.lsr_flags;
 
 	/*
 	 * Duplicate entries are eliminated in insert op.
drivers/staging/lustre/lustre/fld/fld_internal.h +6 -6
index e1d6aaa..66a0fb6 100644
@@ -63,15 +63,15 @@
 #include <lustre_fld.h>
 
 struct fld_stats {
-	__u64   fst_count;
-	__u64   fst_cache;
-	__u64   fst_inflight;
+	u64   fst_count;
+	u64   fst_cache;
+	u64   fst_inflight;
 };
 
 struct lu_fld_hash {
 	const char	      *fh_name;
-	int (*fh_hash_func)(struct lu_client_fld *, __u64);
-	struct lu_fld_target *(*fh_scan_func)(struct lu_client_fld *, __u64);
+	int (*fh_hash_func)(struct lu_client_fld *, u64);
+	struct lu_fld_target *(*fh_scan_func)(struct lu_client_fld *, u64);
 };
 
 struct fld_cache_entry {
@@ -130,7 +130,7 @@ enum {
 extern struct lu_fld_hash fld_hash[];
 
 int fld_client_rpc(struct obd_export *exp,
-		   struct lu_seq_range *range, __u32 fld_op,
+		   struct lu_seq_range *range, u32 fld_op,
 		   struct ptlrpc_request **reqp);
 
 extern struct lprocfs_vars fld_client_debugfs_list[];
drivers/staging/lustre/lustre/fld/fld_request.c +4 -4
index 7b0365b..8a915b9 100644
@@ -193,7 +193,7 @@ int fld_client_add_target(struct lu_client_fld *fld,
 EXPORT_SYMBOL(fld_client_add_target);
 
 /* Remove export from FLD */
-int fld_client_del_target(struct lu_client_fld *fld, __u64 idx)
+int fld_client_del_target(struct lu_client_fld *fld, u64 idx)
 {
 	struct lu_fld_target *target, *tmp;
 
@@ -303,12 +303,12 @@ void fld_client_fini(struct lu_client_fld *fld)
 EXPORT_SYMBOL(fld_client_fini);
 
 int fld_client_rpc(struct obd_export *exp,
-		   struct lu_seq_range *range, __u32 fld_op,
+		   struct lu_seq_range *range, u32 fld_op,
 		   struct ptlrpc_request **reqp)
 {
 	struct ptlrpc_request *req = NULL;
 	struct lu_seq_range   *prange;
-	__u32		 *op;
+	u32		 *op;
 	int		    rc = 0;
 	struct obd_import     *imp;
 
@@ -383,7 +383,7 @@ int fld_client_rpc(struct obd_export *exp,
 }
 
 int fld_client_lookup(struct lu_client_fld *fld, u64 seq, u32 *mds,
-		      __u32 flags, const struct lu_env *env)
+		      u32 flags, const struct lu_env *env)
 {
 	struct lu_seq_range res = { 0 };
 	struct lu_fld_target *target;
drivers/staging/lustre/lustre/llite/dir.c +15 -15
index 2459f5c..4520344 100644
@@ -138,7 +138,7 @@
  *
  */
 struct page *ll_get_dir_page(struct inode *dir, struct md_op_data *op_data,
-			     __u64 offset)
+			     u64 offset)
 {
 	struct md_callback cb_op;
 	struct page *page;
@@ -180,9 +180,9 @@ void ll_release_page(struct inode *inode, struct page *page, bool remove)
  * IF_* flag shld be converted to particular OS file type in
  * platform llite module.
  */
-static __u16 ll_dirent_type_get(struct lu_dirent *ent)
+static u16 ll_dirent_type_get(struct lu_dirent *ent)
 {
-	__u16 type = 0;
+	u16 type = 0;
 	struct luda_type *lt;
 	int len = 0;
 
@@ -197,11 +197,11 @@ static __u16 ll_dirent_type_get(struct lu_dirent *ent)
 	return type;
 }
 
-int ll_dir_read(struct inode *inode, __u64 *ppos, struct md_op_data *op_data,
+int ll_dir_read(struct inode *inode, u64 *ppos, struct md_op_data *op_data,
 		struct dir_context *ctx)
 {
 	struct ll_sb_info    *sbi	= ll_i2sbi(inode);
-	__u64		   pos		= *ppos;
+	u64		   pos		= *ppos;
 	bool is_api32 = ll_need_32bit_api(sbi);
 	int		   is_hash64 = sbi->ll_flags & LL_SBI_64BIT_HASH;
 	struct page	  *page;
@@ -213,8 +213,8 @@ int ll_dir_read(struct inode *inode, __u64 *ppos, struct md_op_data *op_data,
 	while (rc == 0 && !done) {
 		struct lu_dirpage *dp;
 		struct lu_dirent  *ent;
-		__u64 hash;
-		__u64 next;
+		u64 hash;
+		u64 next;
 
 		if (IS_ERR(page)) {
 			rc = PTR_ERR(page);
@@ -225,11 +225,11 @@ int ll_dir_read(struct inode *inode, __u64 *ppos, struct md_op_data *op_data,
 		dp = page_address(page);
 		for (ent = lu_dirent_start(dp); ent && !done;
 		     ent = lu_dirent_next(ent)) {
-			__u16	  type;
+			u16	  type;
 			int	    namelen;
 			struct lu_fid  fid;
-			__u64	  lhash;
-			__u64	  ino;
+			u64	  lhash;
+			u64	  ino;
 
 			hash = le64_to_cpu(ent->lde_hash);
 			if (hash < pos)
@@ -294,7 +294,7 @@ static int ll_readdir(struct file *filp, struct dir_context *ctx)
 	struct inode		*inode	= file_inode(filp);
 	struct ll_file_data	*lfd	= LUSTRE_FPRIVATE(filp);
 	struct ll_sb_info	*sbi	= ll_i2sbi(inode);
-	__u64 pos = lfd ? lfd->lfd_pos : 0;
+	u64 pos = lfd ? lfd->lfd_pos : 0;
 	int			hash64	= sbi->ll_flags & LL_SBI_64BIT_HASH;
 	bool api32 = ll_need_32bit_api(sbi);
 	struct md_op_data *op_data;
@@ -327,7 +327,7 @@ static int ll_readdir(struct file *filp, struct dir_context *ctx)
 		 */
 		if (file_dentry(filp)->d_parent &&
 		    file_dentry(filp)->d_parent->d_inode) {
-			__u64 ibits = MDS_INODELOCK_UPDATE;
+			u64 ibits = MDS_INODELOCK_UPDATE;
 			struct inode *parent;
 
 			parent = file_dentry(filp)->d_parent->d_inode;
@@ -760,7 +760,7 @@ static int ll_ioc_copy_start(struct super_block *sb, struct hsm_copy *copy)
 	/* For archive request, we need to read the current file version. */
 	if (copy->hc_hai.hai_action == HSMA_ARCHIVE) {
 		struct inode	*inode;
-		__u64		 data_version = 0;
+		u64		 data_version = 0;
 
 		/* Get inode for this fid */
 		inode = search_inode_for_lustre(sb, &copy->hc_hai.hai_fid);
@@ -845,7 +845,7 @@ static int ll_ioc_copy_end(struct super_block *sb, struct hsm_copy *copy)
 	     (copy->hc_hai.hai_action == HSMA_RESTORE)) &&
 	    (copy->hc_errval == 0)) {
 		struct inode	*inode;
-		__u64		 data_version = 0;
+		u64		 data_version = 0;
 
 		/* Get lsm for this fid */
 		inode = search_inode_for_lustre(sb, &copy->hc_hai.hai_fid);
@@ -1522,7 +1522,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	case LL_IOC_FID2MDTIDX: {
 		struct obd_export *exp = ll_i2mdexp(inode);
 		struct lu_fid fid;
-		__u32 index;
+		u32 index;
 
 		if (copy_from_user(&fid, (const struct lu_fid __user *)arg,
 				   sizeof(fid)))
drivers/staging/lustre/lustre/llite/file.c +23 -23

172 lines not on this page · raw message

drivers/staging/lustre/lustre/llite/lcommon_misc.c +2 -2
index 80563a2..75156d8 100644
@@ -85,7 +85,7 @@ int cl_ocd_update(struct obd_device *host, struct obd_device *watched,
 {
 	struct lustre_client_ocd *lco;
 	struct client_obd	*cli;
-	__u64 flags;
+	u64 flags;
 	int   result;
 
 	if (!strcmp(watched->obd_type->typ_name, LUSTRE_OSC_NAME) &&
@@ -122,7 +122,7 @@ int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,
 	struct cl_io	   *io;
 	struct cl_lock	 *lock;
 	struct cl_lock_descr   *descr;
-	__u32		   enqflags;
+	u32		   enqflags;
 	u16 refcheck;
 	int		     rc;
 
drivers/staging/lustre/lustre/llite/llite_internal.h +37 -37

221 lines not on this page · raw message

drivers/staging/lustre/lustre/llite/llite_lib.c +6 -6
index 7b1226b..88b08dd 100644
@@ -2142,7 +2142,7 @@ int ll_remount_fs(struct super_block *sb, int *flags, char *data)
 	struct ll_sb_info *sbi = ll_s2sbi(sb);
 	char *profilenm = get_profile_name(sb);
 	int err;
-	__u32 read_only;
+	u32 read_only;
 
 	if ((bool)(*flags & SB_RDONLY) != sb_rdonly(sb)) {
 		read_only = *flags & SB_RDONLY;
@@ -2297,7 +2297,7 @@ int ll_obd_statfs(struct inode *inode, void __user *arg)
 	struct obd_export *exp;
 	char *buf = NULL;
 	struct obd_ioctl_data *data = NULL;
-	__u32 type;
+	u32 type;
 	int len = 0, rc;
 
 	if (!inode) {
@@ -2322,15 +2322,15 @@ int ll_obd_statfs(struct inode *inode, void __user *arg)
 		goto out_statfs;
 	}
 
-	if (data->ioc_inllen1 != sizeof(__u32) ||
-	    data->ioc_inllen2 != sizeof(__u32) ||
+	if (data->ioc_inllen1 != sizeof(u32) ||
+	    data->ioc_inllen2 != sizeof(u32) ||
 	    data->ioc_plen1 != sizeof(struct obd_statfs) ||
 	    data->ioc_plen2 != sizeof(struct obd_uuid)) {
 		rc = -EINVAL;
 		goto out_statfs;
 	}
 
-	memcpy(&type, data->ioc_inlbuf1, sizeof(__u32));
+	memcpy(&type, data->ioc_inlbuf1, sizeof(u32));
 	if (type & LL_STATFS_LMV) {
 		exp = sbi->ll_md_exp;
 	} else if (type & LL_STATFS_LOV) {
@@ -2352,7 +2352,7 @@ int ll_obd_statfs(struct inode *inode, void __user *arg)
 struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data,
 				      struct inode *i1, struct inode *i2,
 				      const char *name, size_t namelen,
-				      u32 mode, __u32 opc, void *data)
+				      u32 mode, u32 opc, void *data)
 {
 	if (!name) {
 		/* Do not reuse namelen for something else. */
drivers/staging/lustre/lustre/llite/llite_mmap.c +1 -1
index 33e23ee..c6e9f10 100644
@@ -466,7 +466,7 @@ static void ll_vm_close(struct vm_area_struct *vma)
 /* XXX put nice comment here.  talk about __free_pte -> dirty pages and
  * nopage's reference passing to the pte
  */
-int ll_teardown_mmaps(struct address_space *mapping, __u64 first, __u64 last)
+int ll_teardown_mmaps(struct address_space *mapping, u64 first, u64 last)
 {
 	int rc = -ENOENT;
 
drivers/staging/lustre/lustre/llite/llite_nfs.c +6 -6
index 5e91e83..7c5c9b8 100644
@@ -42,12 +42,12 @@
 #include "llite_internal.h"
 #include <linux/exportfs.h>
 
-__u32 get_uuid2int(const char *name, int len)
+u32 get_uuid2int(const char *name, int len)
 {
-	__u32 key0 = 0x12a3fe2d, key1 = 0x37abe8f9;
+	u32 key0 = 0x12a3fe2d, key1 = 0x37abe8f9;
 
 	while (len--) {
-		__u32 key = key1 + (key0 ^ (*name++ * 7152373));
+		u32 key = key1 + (key0 ^ (*name++ * 7152373));
 
 		if (key & 0x80000000)
 			key -= 0x7fffffff;
@@ -59,7 +59,7 @@ __u32 get_uuid2int(const char *name, int len)
 
 void get_uuid2fsid(const char *name, int len, __kernel_fsid_t *fsid)
 {
-	__u64 key = 0, key0 = 0x12a3fe2d, key1 = 0x37abe8f9;
+	u64 key = 0, key0 = 0x12a3fe2d, key1 = 0x37abe8f9;
 
 	while (len--) {
 		key = key1 + (key0 ^ (*name++ * 7152373));
@@ -186,7 +186,7 @@ struct lustre_nfs_fid {
  * 2 -- contains child file handle and parent file handle;
  * 255 -- error.
  */
-static int ll_encode_fh(struct inode *inode, __u32 *fh, int *plen,
+static int ll_encode_fh(struct inode *inode, u32 *fh, int *plen,
 			struct inode *parent)
 {
 	int fileid_len = sizeof(struct lustre_nfs_fid) / 4;
@@ -243,7 +243,7 @@ static int ll_get_name(struct dentry *dentry, char *name,
 		.ctx.actor = ll_nfs_get_name_filldir,
 	};
 	struct md_op_data *op_data;
-	__u64 pos = 0;
+	u64 pos = 0;
 
 	if (!dir || !S_ISDIR(dir->i_mode)) {
 		rc = -ENOTDIR;
drivers/staging/lustre/lustre/llite/lproc_llite.c +3 -3
index 9404bb7..672de81 100644
@@ -1232,8 +1232,8 @@ static void llite_kobj_release(struct kobject *kobj)
 };
 
 static const struct llite_file_opcode {
-	__u32       opcode;
-	__u32       type;
+	u32       opcode;
+	u32       type;
 	const char *opname;
 } llite_opcode_table[LPROC_LL_FILE_OPCODES] = {
 	/* file operation */
@@ -1352,7 +1352,7 @@ int ll_debugfs_register_super(struct super_block *sb, const char *name)
 
 	/* do counter init */
 	for (id = 0; id < LPROC_LL_FILE_OPCODES; id++) {
-		__u32 type = llite_opcode_table[id].type;
+		u32 type = llite_opcode_table[id].type;
 		void *ptr = NULL;
 
 		if (type & LPROCFS_TYPE_REGS)
drivers/staging/lustre/lustre/llite/namei.c +8 -8
index b5b46f7..8bdf947 100644
@@ -191,7 +191,7 @@ int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
 		break;
 	case LDLM_CB_CANCELING: {
 		struct inode *inode = ll_inode_from_resource_lock(lock);
-		__u64 bits = lock->l_policy_data.l_inodebits.bits;
+		u64 bits = lock->l_policy_data.l_inodebits.bits;
 
 		/* Inode is set to lock->l_resource->lr_lvb_inode
 		 * for mdc - bug 24555
@@ -348,12 +348,12 @@ int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
 	return 0;
 }
 
-__u32 ll_i2suppgid(struct inode *i)
+u32 ll_i2suppgid(struct inode *i)
 {
 	if (in_group_p(i->i_gid))
-		return (__u32)from_kgid(&init_user_ns, i->i_gid);
+		return (u32)from_kgid(&init_user_ns, i->i_gid);
 	else
-		return (__u32)(-1);
+		return (u32)(-1);
 }
 
 /* Pack the required supplementary groups into the supplied groups array.
@@ -361,7 +361,7 @@ __u32 ll_i2suppgid(struct inode *i)
  * instead pack one or more groups from the user's supplementary group
  * array in case it might be useful.  Not needed if doing an MDS-side upcall.
  */
-void ll_i2gids(__u32 *suppgids, struct inode *i1, struct inode *i2)
+void ll_i2gids(u32 *suppgids, struct inode *i1, struct inode *i2)
 {
 	LASSERT(i1);
 
@@ -454,7 +454,7 @@ static int ll_lookup_it_finish(struct ptlrpc_request *request,
 			       struct inode *parent, struct dentry **de)
 {
 	struct inode *inode = NULL;
-	__u64 bits = 0;
+	u64 bits = 0;
 	int rc = 0;
 	struct dentry *alias;
 
@@ -536,7 +536,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
 	struct ptlrpc_request *req = NULL;
 	struct md_op_data *op_data = NULL;
 	struct inode *inode;
-	__u32 opc;
+	u32 opc;
 	int rc;
 
 	if (dentry->d_name.len > ll_i2sbi(parent)->ll_namelen)
@@ -901,7 +901,7 @@ void ll_update_times(struct ptlrpc_request *request, struct inode *inode)
 
 static int ll_new_node(struct inode *dir, struct dentry *dentry,
 		       const char *tgt, umode_t mode, int rdev,
-		       __u32 opc)
+		       u32 opc)
 {
 	struct ptlrpc_request *request = NULL;
 	struct md_op_data *op_data;
drivers/staging/lustre/lustre/llite/range_lock.c +2 -2
index d37da8e..c1f0e1e 100644
@@ -42,7 +42,7 @@
 #define START(node) ((node)->rl_start)
 #define LAST(node)  ((node)->rl_last)
 
-INTERVAL_TREE_DEFINE(struct range_lock, rl_rb, __u64, __subtree_last,
+INTERVAL_TREE_DEFINE(struct range_lock, rl_rb, u64, __subtree_last,
 		     START, LAST, static, range);
 /**
  * Initialize a range lock tree
@@ -69,7 +69,7 @@ void range_lock_tree_init(struct range_lock_tree *tree)
  * Pre:  Caller should have allocated the range lock node.
  * Post: The range lock node is meant to cover [start, end] region
  */
-int range_lock_init(struct range_lock *lock, __u64 start, __u64 end)
+int range_lock_init(struct range_lock *lock, u64 start, u64 end)
 {
 	RB_CLEAR_NODE(&lock->rl_rb);
 
drivers/staging/lustre/lustre/llite/range_lock.h +5 -5
index 2a0704d..10566da 100644
@@ -42,8 +42,8 @@
 
 struct range_lock {
 	struct rb_node		rl_rb;
-	__u64			rl_start, rl_last;
-	__u64			__subtree_last;
+	u64			rl_start, rl_last;
+	u64			__subtree_last;
 	/**
 	 * Process to enqueue this lock.
 	 */
@@ -56,17 +56,17 @@ struct range_lock {
 	 * Sequence number of range lock. This number is used to get to know
 	 * the order the locks are queued; this is required for range_cancel().
 	 */
-	__u64			rl_sequence;
+	u64			rl_sequence;
 };
 
 struct range_lock_tree {
 	struct rb_root_cached	rlt_root;
 	spinlock_t		rlt_lock;	/* protect range lock tree */
-	__u64			rlt_sequence;
+	u64			rlt_sequence;
 };
 
 void range_lock_tree_init(struct range_lock_tree *tree);
-int range_lock_init(struct range_lock *lock, __u64 start, __u64 end);
+int range_lock_init(struct range_lock *lock, u64 start, u64 end);
 int  range_lock(struct range_lock_tree *tree, struct range_lock *lock);
 void range_unlock(struct range_lock_tree *tree, struct range_lock *lock);
 #endif
drivers/staging/lustre/lustre/llite/rw.c +5 -5
index 55d8b31..e207d7c 100644
@@ -272,8 +272,8 @@ static inline int stride_io_mode(struct ll_readahead_state *ras)
 stride_pg_count(pgoff_t st_off, unsigned long st_len, unsigned long st_pgs,
 		unsigned long off, unsigned long length)
 {
-	__u64 start = off > st_off ? off - st_off : 0;
-	__u64 end = off + length > st_off ? off + length - st_off : 0;
+	u64 start = off > st_off ? off - st_off : 0;
+	u64 end = off + length > st_off ? off + length - st_off : 0;
 	unsigned long start_left = 0;
 	unsigned long end_left = 0;
 	unsigned long pg_count;
@@ -308,7 +308,7 @@ static inline int stride_io_mode(struct ll_readahead_state *ras)
 
 static int ria_page_count(struct ra_io_arg *ria)
 {
-	__u64 length = ria->ria_end >= ria->ria_start ?
+	u64 length = ria->ria_end >= ria->ria_start ?
 		       ria->ria_end - ria->ria_start + 1 : 0;
 
 	return stride_pg_count(ria->ria_stoff, ria->ria_length,
@@ -445,7 +445,7 @@ static int ll_readahead(const struct lu_env *env, struct cl_io *io,
 	struct ra_io_arg *ria = &lti->lti_ria;
 	struct cl_object *clob;
 	int ret = 0;
-	__u64 kms;
+	u64 kms;
 
 	clob = io->ci_obj;
 	inode = vvp_object_inode(clob);
@@ -764,7 +764,7 @@ static void ras_update(struct ll_sb_info *sbi, struct inode *inode,
 	 * ras_requests and thus can never trigger this behavior.
 	 */
 	if (ras->ras_requests >= 2 && !ras->ras_request_index) {
-		__u64 kms_pages;
+		u64 kms_pages;
 
 		kms_pages = (i_size_read(inode) + PAGE_SIZE - 1) >>
 			    PAGE_SHIFT;
drivers/staging/lustre/lustre/llite/statahead.c +13 -13
index 24c2335c..6f5c7ab 100644
@@ -65,9 +65,9 @@ struct sa_entry {
 	/* link into sai hash table locally */
 	struct list_head	      se_hash;
 	/* entry index in the sai */
-	__u64		   se_index;
+	u64		   se_index;
 	/* low layer ldlm lock handle */
-	__u64		   se_handle;
+	u64		   se_handle;
 	/* entry status */
 	enum se_stat		se_state;
 	/* entry size, contains name */
@@ -163,15 +163,15 @@ static inline int sa_low_hit(struct ll_statahead_info *sai)
  * if the given index is behind of statahead window more than
  * SA_OMITTED_ENTRY_MAX, then it is old.
  */
-static inline int is_omitted_entry(struct ll_statahead_info *sai, __u64 index)
+static inline int is_omitted_entry(struct ll_statahead_info *sai, u64 index)
 {
-	return ((__u64)sai->sai_max + index + SA_OMITTED_ENTRY_MAX <
+	return ((u64)sai->sai_max + index + SA_OMITTED_ENTRY_MAX <
 		 sai->sai_index);
 }
 
 /* allocate sa_entry and hash it to allow scanner process to find it */
 static struct sa_entry *
-sa_alloc(struct dentry *parent, struct ll_statahead_info *sai, __u64 index,
+sa_alloc(struct dentry *parent, struct ll_statahead_info *sai, u64 index,
 	 const char *name, int len, const struct lu_fid *fid)
 {
 	struct ll_inode_info *lli;
@@ -309,7 +309,7 @@ static void sa_free(struct ll_statahead_info *sai, struct sa_entry *entry)
 __sa_make_ready(struct ll_statahead_info *sai, struct sa_entry *entry, int ret)
 {
 	struct list_head *pos = &sai->sai_entries;
-	__u64 index = entry->se_index;
+	u64 index = entry->se_index;
 	struct sa_entry *se;
 
 	LASSERT(!sa_ready(entry));
@@ -492,7 +492,7 @@ static void ll_sai_put(struct ll_statahead_info *sai)
 static void ll_agl_trigger(struct inode *inode, struct ll_statahead_info *sai)
 {
 	struct ll_inode_info *lli   = ll_i2info(inode);
-	__u64		 index = lli->lli_agl_index;
+	u64		 index = lli->lli_agl_index;
 	int		   rc;
 
 	LASSERT(list_empty(&lli->lli_agl_list));
@@ -665,7 +665,7 @@ static int ll_statahead_interpret(struct ptlrpc_request *req,
 	struct ll_inode_info     *lli = ll_i2info(dir);
 	struct ll_statahead_info *sai = lli->lli_sai;
 	struct sa_entry *entry = (struct sa_entry *)minfo->mi_cbdata;
-	__u64 handle = 0;
+	u64 handle = 0;
 
 	if (it_disposition(it, DISP_LOOKUP_NEG))
 		rc = -ENOENT;
@@ -963,7 +963,7 @@ static int ll_statahead_thread(void *arg)
 	struct ll_sb_info	*sbi    = ll_i2sbi(dir);
 	struct ll_statahead_info *sai = lli->lli_sai;
 	struct page	      *page = NULL;
-	__u64		     pos    = 0;
+	u64		     pos    = 0;
 	int		       first  = 0;
 	int		       rc     = 0;
 	struct md_op_data *op_data;
@@ -998,7 +998,7 @@ static int ll_statahead_thread(void *arg)
 		     ent && sai->sai_task && !sa_low_hit(sai);
 		     ent = lu_dirent_next(ent)) {
 			struct lu_fid fid;
-			__u64 hash;
+			u64 hash;
 			int namelen;
 			char *name;
 
@@ -1228,7 +1228,7 @@ static int is_first_dirent(struct inode *dir, struct dentry *dentry)
 	const struct qstr  *target = &dentry->d_name;
 	struct md_op_data *op_data;
 	struct page	  *page;
-	__u64		 pos    = 0;
+	u64		 pos    = 0;
 	int		   dot_de;
 	int rc = LS_NOT_FIRST_DE;
 
@@ -1259,7 +1259,7 @@ static int is_first_dirent(struct inode *dir, struct dentry *dentry)
 		dp = page_address(page);
 		for (ent = lu_dirent_start(dp); ent;
 		     ent = lu_dirent_next(ent)) {
-			__u64 hash;
+			u64 hash;
 			int namelen;
 			char *name;
 
@@ -1425,7 +1425,7 @@ static int revalidate_statahead_dentry(struct inode *dir,
 		struct inode *inode = entry->se_inode;
 		struct lookup_intent it = { .it_op = IT_GETATTR,
 					    .it_lock_handle = entry->se_handle };
-		__u64 bits;
+		u64 bits;
 
 		rc = md_revalidate_lock(ll_i2mdexp(dir), &it,
 					ll_inode2fid(inode), &bits);
drivers/staging/lustre/lustre/llite/vvp_internal.h +1 -1
index 70d62bf..e8712d8 100644
@@ -100,7 +100,7 @@ struct vvp_io {
 	/**
 	 * Layout version when this IO is initialized
 	 */
-	__u32			vui_layout_gen;
+	u32			vui_layout_gen;
 	/**
 	 * File descriptor against which IO is done.
 	 */
drivers/staging/lustre/lustre/llite/vvp_io.c +6 -6
index d9f02ae..26a7897 100644
@@ -188,7 +188,7 @@ static int vvp_prep_size(const struct lu_env *env, struct cl_object *obj,
 			i_size_write(inode, kms);
 			CDEBUG(D_VFSTRACE, DFID " updating i_size %llu\n",
 			       PFID(lu_object_fid(&obj->co_lu)),
-			       (__u64)i_size_read(inode));
+			       (u64)i_size_read(inode));
 		}
 	}
 
@@ -204,7 +204,7 @@ static int vvp_prep_size(const struct lu_env *env, struct cl_object *obj,
  */
 
 static int vvp_io_one_lock_index(const struct lu_env *env, struct cl_io *io,
-				 __u32 enqflags, enum cl_lock_mode mode,
+				 u32 enqflags, enum cl_lock_mode mode,
 			  pgoff_t start, pgoff_t end)
 {
 	struct vvp_io          *vio   = vvp_env_io(env);
@@ -234,7 +234,7 @@ static int vvp_io_one_lock_index(const struct lu_env *env, struct cl_io *io,
 }
 
 static int vvp_io_one_lock(const struct lu_env *env, struct cl_io *io,
-			   __u32 enqflags, enum cl_lock_mode mode,
+			   u32 enqflags, enum cl_lock_mode mode,
 			   loff_t start, loff_t end)
 {
 	struct cl_object *obj = io->ci_obj;
@@ -355,7 +355,7 @@ static void vvp_io_fini(const struct lu_env *env, const struct cl_io_slice *ios)
 	}
 
 	if (!io->ci_ignore_layout && io->ci_verify_layout) {
-		__u32 gen = 0;
+		u32 gen = 0;
 
 		/* check layout version */
 		ll_layout_refresh(inode, &gen);
@@ -590,8 +590,8 @@ static int vvp_io_setattr_lock(const struct lu_env *env,
 			       const struct cl_io_slice *ios)
 {
 	struct cl_io  *io  = ios->cis_io;
-	__u64 new_size;
-	__u32 enqflags = 0;
+	u64 new_size;
+	u32 enqflags = 0;
 
 	if (cl_io_is_trunc(io)) {
 		new_size = io->u.ci_setattr.sa_attr.lvb_size;
drivers/staging/lustre/lustre/llite/xattr_cache.c +3 -3
index 5da69ba0..bb235e0 100644
@@ -338,7 +338,7 @@ static int ll_xattr_cache_refill(struct inode *inode)
 	const char *xdata, *xval, *xtail, *xvtail;
 	struct ll_inode_info *lli = ll_i2info(inode);
 	struct mdt_body *body;
-	__u32 *xsizes;
+	u32 *xsizes;
 	int rc, i;
 
 	rc = ll_xattr_find_get_lock(inode, &oit, &req);
@@ -373,7 +373,7 @@ static int ll_xattr_cache_refill(struct inode *inode)
 	xval = req_capsule_server_sized_get(&req->rq_pill, &RMF_EAVALS,
 					    body->mbo_aclsize);
 	xsizes = req_capsule_server_sized_get(&req->rq_pill, &RMF_EAVALS_LENS,
-					      body->mbo_max_mdsize * sizeof(__u32));
+					      body->mbo_max_mdsize * sizeof(u32));
 	if (!xdata || !xval || !xsizes) {
 		CERROR("wrong setxattr reply\n");
 		rc = -EPROTO;
@@ -458,7 +458,7 @@ static int ll_xattr_cache_refill(struct inode *inode)
  * \retval -ENODATA no such attr or the list is empty
  */
 int ll_xattr_cache_get(struct inode *inode, const char *name, char *buffer,
-		       size_t size, __u64 valid)
+		       size_t size, u64 valid)
 {
 	struct ll_inode_info *lli = ll_i2info(inode);
 	int rc = 0;
drivers/staging/lustre/lustre/lmv/lmv_intent.c +4 -4
index ba6410e..bc364b6 100644
@@ -52,7 +52,7 @@ static int lmv_intent_remote(struct obd_export *exp, struct lookup_intent *it,
 			     const struct lu_fid *parent_fid,
 			     struct ptlrpc_request **reqp,
 			     ldlm_blocking_callback cb_blocking,
-			     __u64 extra_lock_flags)
+			     u64 extra_lock_flags)
 {
 	struct obd_device	*obd = exp->exp_obd;
 	struct lmv_obd		*lmv = &obd->u.lmv;
@@ -262,7 +262,7 @@ static int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data,
 			   struct lookup_intent *it,
 			   struct ptlrpc_request **reqp,
 			   ldlm_blocking_callback cb_blocking,
-			   __u64 extra_lock_flags)
+			   u64 extra_lock_flags)
 {
 	struct obd_device	*obd = exp->exp_obd;
 	struct lmv_obd		*lmv = &obd->u.lmv;
@@ -353,7 +353,7 @@ static int lmv_intent_lookup(struct obd_export *exp,
 			     struct lookup_intent *it,
 			     struct ptlrpc_request **reqp,
 			     ldlm_blocking_callback cb_blocking,
-			     __u64 extra_lock_flags)
+			     u64 extra_lock_flags)
 {
 	struct lmv_stripe_md *lsm = op_data->op_mea1;
 	struct obd_device      *obd = exp->exp_obd;
@@ -475,7 +475,7 @@ static int lmv_intent_lookup(struct obd_export *exp,
 int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
 		    struct lookup_intent *it, struct ptlrpc_request **reqp,
 		    ldlm_blocking_callback cb_blocking,
-		    __u64 extra_lock_flags)
+		    u64 extra_lock_flags)
 {
 	int		rc;
 
drivers/staging/lustre/lustre/lmv/lmv_internal.h +1 -1
index f2c41c7..c0881ff 100644
@@ -46,7 +46,7 @@
 int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
 		    struct lookup_intent *it, struct ptlrpc_request **reqp,
 		    ldlm_blocking_callback cb_blocking,
-		    __u64 extra_lock_flags);
+		    u64 extra_lock_flags);
 
 int lmv_fld_lookup(struct lmv_obd *lmv, const struct lu_fid *fid, u32 *mds);
 int __lmv_fid_alloc(struct lmv_obd *lmv, struct lu_fid *fid, u32 mds);
drivers/staging/lustre/lustre/lmv/lmv_obd.c +25 -25

180 lines not on this page · raw message

drivers/staging/lustre/lustre/lov/lov_cl_internal.h +2 -2
index 5d4c83b..d83b8de 100644
@@ -98,9 +98,9 @@ struct lov_device {
 	struct cl_device	  ld_cl;
 	struct lov_obd	   *ld_lov;
 	/** size of lov_device::ld_target[] array */
-	__u32		     ld_target_nr;
+	u32		     ld_target_nr;
 	struct lovsub_device    **ld_target;
-	__u32		     ld_flags;
+	u32		     ld_flags;
 };
 
 /**
drivers/staging/lustre/lustre/lov/lov_dev.c +5 -5
index abf2ede..67d30fb 100644
@@ -218,7 +218,7 @@ static struct lu_device *lov_device_free(const struct lu_env *env,
 }
 
 static void lov_cl_del_target(const struct lu_env *env, struct lu_device *dev,
-			      __u32 index)
+			      u32 index)
 {
 	struct lov_device *ld = lu2lov_dev(dev);
 
@@ -231,8 +231,8 @@ static void lov_cl_del_target(const struct lu_env *env, struct lu_device *dev,
 static int lov_expand_targets(const struct lu_env *env, struct lov_device *dev)
 {
 	int   result;
-	__u32 tgt_size;
-	__u32 sub_size;
+	u32 tgt_size;
+	u32 sub_size;
 
 	result = 0;
 	tgt_size = dev->ld_lov->lov_tgt_size;
@@ -257,7 +257,7 @@ static int lov_expand_targets(const struct lu_env *env, struct lov_device *dev)
 }
 
 static int lov_cl_add_target(const struct lu_env *env, struct lu_device *dev,
-			     __u32 index)
+			     u32 index)
 {
 	struct obd_device    *obd = dev->ld_obd;
 	struct lov_device    *ld  = lu2lov_dev(dev);
@@ -304,7 +304,7 @@ static int lov_process_config(const struct lu_env *env,
 	int cmd;
 	int rc;
 	int gen;
-	__u32 index;
+	u32 index;
 
 	lov_tgts_getref(obd);
 
drivers/staging/lustre/lustre/lov/lov_internal.h +10 -10
index 2b31c99..9708f1b 100644
@@ -241,7 +241,7 @@ struct lov_request_set {
 
 /* lov_merge.c */
 int lov_merge_lvb_kms(struct lov_stripe_md *lsm, int index,
-		      struct ost_lvb *lvb, __u64 *kms_place);
+		      struct ost_lvb *lvb, u64 *kms_place);
 
 /* lov_offset.c */
 u64 lov_stripe_size(struct lov_stripe_md *lsm, int index, u64 ost_size,
@@ -267,17 +267,17 @@ int lov_prep_statfs_set(struct obd_device *obd, struct obd_info *oinfo,
 void lov_stripe_lock(struct lov_stripe_md *md);
 void lov_stripe_unlock(struct lov_stripe_md *md);
 void lov_fix_desc(struct lov_desc *desc);
-void lov_fix_desc_stripe_size(__u64 *val);
-void lov_fix_desc_stripe_count(__u32 *val);
-void lov_fix_desc_pattern(__u32 *val);
-void lov_fix_desc_qos_maxage(__u32 *val);
+void lov_fix_desc_stripe_size(u64 *val);
+void lov_fix_desc_stripe_count(u32 *val);
+void lov_fix_desc_pattern(u32 *val);
+void lov_fix_desc_qos_maxage(u32 *val);
 u16 lov_get_stripe_count(struct lov_obd *lov, u32 magic, u16 stripe_count);
-int lov_connect_obd(struct obd_device *obd, __u32 index, int activate,
+int lov_connect_obd(struct obd_device *obd, u32 index, int activate,
 		    struct obd_connect_data *data);
 int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg);
 int lov_process_config_base(struct obd_device *obd, struct lustre_cfg *lcfg,
-			    __u32 *indexp, int *genp);
-int lov_del_target(struct obd_device *obd, __u32 index,
+			    u32 *indexp, int *genp);
+int lov_del_target(struct obd_device *obd, u32 index,
 		   struct obd_uuid *uuidp, int gen);
 
 /* lov_pack.c */
@@ -303,8 +303,8 @@ struct lov_stripe_md *lov_unpackmd(struct lov_obd *lov, void *buf,
 /* ost_pool methods */
 int lov_ost_pool_init(struct ost_pool *op, unsigned int count);
 int lov_ost_pool_extend(struct ost_pool *op, unsigned int min_count);
-int lov_ost_pool_add(struct ost_pool *op, __u32 idx, unsigned int min_count);
-int lov_ost_pool_remove(struct ost_pool *op, __u32 idx);
+int lov_ost_pool_add(struct ost_pool *op, u32 idx, unsigned int min_count);
+int lov_ost_pool_remove(struct ost_pool *op, u32 idx);
 int lov_ost_pool_free(struct ost_pool *op);
 
 /* high level pool methods */
drivers/staging/lustre/lustre/lov/lov_merge.c +4 -4
index 79edc26..ab0ba12 100644
@@ -42,12 +42,12 @@
  * uptodate time on the local client.
  */
 int lov_merge_lvb_kms(struct lov_stripe_md *lsm, int index,
-		      struct ost_lvb *lvb, __u64 *kms_place)
+		      struct ost_lvb *lvb, u64 *kms_place)
 {
 	struct lov_stripe_md_entry *lse = lsm->lsm_entries[index];
-	__u64 size = 0;
-	__u64 kms = 0;
-	__u64 blocks = 0;
+	u64 size = 0;
+	u64 kms = 0;
+	u64 blocks = 0;
 	s64 current_mtime = lvb->lvb_mtime;
 	s64 current_atime = lvb->lvb_atime;
 	s64 current_ctime = lvb->lvb_ctime;
drivers/staging/lustre/lustre/lov/lov_obd.c +23 -23

161 lines not on this page · raw message

drivers/staging/lustre/lustre/lov/lov_pack.c +1 -1
index 0a6bb1e..fde5160 100644
@@ -252,7 +252,7 @@ ssize_t lov_lsm_pack(const struct lov_stripe_md *lsm, void *buf,
 /* Find the max stripecount we should use */
 u16 lov_get_stripe_count(struct lov_obd *lov, u32 magic, u16 stripe_count)
 {
-	__u32 max_stripes = LOV_MAX_STRIPE_COUNT_OLD;
+	u32 max_stripes = LOV_MAX_STRIPE_COUNT_OLD;
 
 	if (!stripe_count)
 		stripe_count = lov->desc.ld_default_stripe_count;
drivers/staging/lustre/lustre/lov/lov_pool.c +2 -2
index b90fb1c..177f5a5 100644
@@ -273,7 +273,7 @@ int lov_ost_pool_extend(struct ost_pool *op, unsigned int min_count)
 	return 0;
 }
 
-int lov_ost_pool_add(struct ost_pool *op, __u32 idx, unsigned int min_count)
+int lov_ost_pool_add(struct ost_pool *op, u32 idx, unsigned int min_count)
 {
 	int rc = 0, i;
 
@@ -298,7 +298,7 @@ int lov_ost_pool_add(struct ost_pool *op, __u32 idx, unsigned int min_count)
 	return rc;
 }
 
-int lov_ost_pool_remove(struct ost_pool *op, __u32 idx)
+int lov_ost_pool_remove(struct ost_pool *op, u32 idx)
 {
 	int i;
 
drivers/staging/lustre/lustre/lov/lov_request.c +2 -2
index d13e8d1..45dca36 100644
@@ -136,7 +136,7 @@ static int lov_check_and_wait_active(struct lov_obd *lov, int ost_idx)
 	return rc;
 }
 
-#define LOV_U64_MAX ((__u64)~0ULL)
+#define LOV_U64_MAX ((u64)~0ULL)
 #define LOV_SUM_MAX(tot, add)					   \
 	do {							    \
 		if ((tot) + (add) < (tot))			      \
@@ -188,7 +188,7 @@ static void lov_update_statfs(struct obd_statfs *osfs,
 			      int success)
 {
 	int shift = 0, quit = 0;
-	__u64 tmp;
+	u64 tmp;
 
 	if (success == 0) {
 		memcpy(osfs, lov_sfs, sizeof(*lov_sfs));
drivers/staging/lustre/lustre/mdc/mdc_internal.h +12 -12
index 6da9046..2b849e8 100644
@@ -39,20 +39,20 @@
 int mdc_tunables_init(struct obd_device *obd);
 
 void mdc_pack_body(struct ptlrpc_request *req, const struct lu_fid *fid,
-		   __u64 valid, size_t ea_size, __u32 suppgid, u32 flags);
+		   u64 valid, size_t ea_size, u32 suppgid, u32 flags);
 void mdc_swap_layouts_pack(struct ptlrpc_request *req,
 			   struct md_op_data *op_data);
-void mdc_readdir_pack(struct ptlrpc_request *req, __u64 pgoff, size_t size,
+void mdc_readdir_pack(struct ptlrpc_request *req, u64 pgoff, size_t size,
 		      const struct lu_fid *fid);
-void mdc_getattr_pack(struct ptlrpc_request *req, __u64 valid, u32 flags,
+void mdc_getattr_pack(struct ptlrpc_request *req, u64 valid, u32 flags,
 		      struct md_op_data *data, size_t ea_size);
 void mdc_setattr_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
 		      void *ea, size_t ealen);
 void mdc_create_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
 		     const void *data, size_t datalen, umode_t mode, uid_t uid,
-		     gid_t gid, kernel_cap_t capability, __u64 rdev);
+		     gid_t gid, kernel_cap_t capability, u64 rdev);
 void mdc_open_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
-		   umode_t mode, __u64 rdev, __u64 flags, const void *data,
+		   umode_t mode, u64 rdev, u64 flags, const void *data,
 		   size_t datalen);
 void mdc_file_secctx_pack(struct ptlrpc_request *req,
 			  const char *secctx_name,
@@ -68,7 +68,7 @@ void mdc_rename_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
 /* mdc/mdc_locks.c */
 int mdc_set_lock_data(struct obd_export *exp,
 		      const struct lustre_handle *lockh,
-		      void *data, __u64 *bits);
+		      void *data, u64 *bits);
 
 int mdc_null_inode(struct obd_export *exp, const struct lu_fid *fid);
 
@@ -77,7 +77,7 @@ int mdc_intent_lock(struct obd_export *exp,
 		    struct lookup_intent *it,
 		    struct ptlrpc_request **reqp,
 		    ldlm_blocking_callback cb_blocking,
-		    __u64 extra_lock_flags);
+		    u64 extra_lock_flags);
 
 int mdc_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo,
 		const union ldlm_policy_data *policy,
@@ -86,7 +86,7 @@ int mdc_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo,
 
 int mdc_resource_get_unused(struct obd_export *exp, const struct lu_fid *fid,
 			    struct list_head *cancels, enum ldlm_mode  mode,
-			    __u64 bits);
+			    u64 bits);
 /* mdc/mdc_request.c */
 int mdc_fid_alloc(const struct lu_env *env, struct obd_export *exp,
 		  struct lu_fid *fid, struct md_op_data *op_data);
@@ -101,7 +101,7 @@ int mdc_set_open_replay_data(struct obd_export *exp,
 
 int mdc_create(struct obd_export *exp, struct md_op_data *op_data,
 	       const void *data, size_t datalen, umode_t mode, uid_t uid,
-	       gid_t gid, kernel_cap_t capability, __u64 rdev,
+	       gid_t gid, kernel_cap_t capability, u64 rdev,
 	       struct ptlrpc_request **request);
 int mdc_link(struct obd_export *exp, struct md_op_data *op_data,
 	     struct ptlrpc_request **request);
@@ -118,12 +118,12 @@ int mdc_cancel_unused(struct obd_export *exp, const struct lu_fid *fid,
 		      enum ldlm_cancel_flags flags, void *opaque);
 
 int mdc_revalidate_lock(struct obd_export *exp, struct lookup_intent *it,
-			struct lu_fid *fid, __u64 *bits);
+			struct lu_fid *fid, u64 *bits);
 
 int mdc_intent_getattr_async(struct obd_export *exp,
 			     struct md_enqueue_info *minfo);
 
-enum ldlm_mode mdc_lock_match(struct obd_export *exp, __u64 flags,
+enum ldlm_mode mdc_lock_match(struct obd_export *exp, u64 flags,
 			      const struct lu_fid *fid, enum ldlm_type type,
 			      union ldlm_policy_data *policy,
 			      enum ldlm_mode mode,
@@ -141,7 +141,7 @@ static inline int mdc_prep_elc_req(struct obd_export *exp,
 				 count);
 }
 
-static inline unsigned long hash_x_index(__u64 hash, int hash64)
+static inline unsigned long hash_x_index(u64 hash, int hash64)
 {
 	if (BITS_PER_LONG == 32 && hash64)
 		hash >>= 32;
drivers/staging/lustre/lustre/mdc/mdc_lib.c +11 -11
index a1b1e75..3dfc863 100644
@@ -42,7 +42,7 @@ static void set_mrc_cr_flags(struct mdt_rec_create *mrc, u64 flags)
 	mrc->cr_flags_h = (u32)(flags >> 32);
 }
 
-static void __mdc_pack_body(struct mdt_body *b, __u32 suppgid)
+static void __mdc_pack_body(struct mdt_body *b, u32 suppgid)
 {
 	b->mbo_suppgid = suppgid;
 	b->mbo_uid = from_kuid(&init_user_ns, current_uid());
@@ -65,7 +65,7 @@ void mdc_swap_layouts_pack(struct ptlrpc_request *req,
 }
 
 void mdc_pack_body(struct ptlrpc_request *req, const struct lu_fid *fid,
-		   __u64 valid, size_t ea_size, __u32 suppgid, u32 flags)
+		   u64 valid, size_t ea_size, u32 suppgid, u32 flags)
 {
 	struct mdt_body *b = req_capsule_client_get(&req->rq_pill,
 						    &RMF_MDT_BODY);
@@ -134,7 +134,7 @@ void mdc_file_secctx_pack(struct ptlrpc_request *req, const char *secctx_name,
 	memcpy(buf, secctx, buf_size);
 }
 
-void mdc_readdir_pack(struct ptlrpc_request *req, __u64 pgoff, size_t size,
+void mdc_readdir_pack(struct ptlrpc_request *req, u64 pgoff, size_t size,
 		      const struct lu_fid *fid)
 {
 	struct mdt_body *b = req_capsule_client_get(&req->rq_pill,
@@ -151,11 +151,11 @@ void mdc_readdir_pack(struct ptlrpc_request *req, __u64 pgoff, size_t size,
 void mdc_create_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
 		     const void *data, size_t datalen, umode_t mode,
 		     uid_t uid, gid_t gid, kernel_cap_t cap_effective,
-		     __u64 rdev)
+		     u64 rdev)
 {
 	struct mdt_rec_create	*rec;
 	char			*tmp;
-	__u64			 flags;
+	u64			 flags;
 
 	BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != sizeof(struct mdt_rec_create));
 	rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT);
@@ -189,9 +189,9 @@ void mdc_create_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
 			     op_data->op_file_secctx_size);
 }
 
-static inline __u64 mds_pack_open_flags(__u64 flags)
+static inline u64 mds_pack_open_flags(u64 flags)
 {
-	__u64 cr_flags = (flags & (FMODE_READ | FMODE_WRITE |
+	u64 cr_flags = (flags & (FMODE_READ | FMODE_WRITE |
 				   MDS_OPEN_FL_INTERNAL));
 	if (flags & O_CREAT)
 		cr_flags |= MDS_OPEN_CREAT;
@@ -218,12 +218,12 @@ static inline __u64 mds_pack_open_flags(__u64 flags)
 
 /* packing of MDS records */
 void mdc_open_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
-		   umode_t mode, __u64 rdev, __u64 flags, const void *lmm,
+		   umode_t mode, u64 rdev, u64 flags, const void *lmm,
 		   size_t lmmlen)
 {
 	struct mdt_rec_create *rec;
 	char *tmp;
-	__u64 cr_flags;
+	u64 cr_flags;
 
 	BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != sizeof(struct mdt_rec_create));
 	rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT);
@@ -268,7 +268,7 @@ void mdc_open_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
 
 static inline u64 attr_pack(unsigned int ia_valid, enum op_xvalid ia_xvalid)
 {
-	__u64 sa_valid = 0;
+	u64 sa_valid = 0;
 
 	if (ia_valid & ATTR_MODE)
 		sa_valid |= MDS_ATTR_MODE;
@@ -483,7 +483,7 @@ void mdc_rename_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
 	}
 }
 
-void mdc_getattr_pack(struct ptlrpc_request *req, __u64 valid, u32 flags,
+void mdc_getattr_pack(struct ptlrpc_request *req, u64 valid, u32 flags,
 		      struct md_op_data *op_data, size_t ea_size)
 {
 	struct mdt_body *b = req_capsule_client_get(&req->rq_pill,
drivers/staging/lustre/lustre/mdc/mdc_locks.c +10 -10
index a60959d..e16dce6 100644
@@ -96,7 +96,7 @@ int it_open_error(int phase, struct lookup_intent *it)
 
 /* this must be called on a lockh that is known to have a referenced lock */
 int mdc_set_lock_data(struct obd_export *exp, const struct lustre_handle *lockh,
-		      void *data, __u64 *bits)
+		      void *data, u64 *bits)
 {
 	struct ldlm_lock *lock;
 	struct inode *new_inode = data;
@@ -131,7 +131,7 @@ int mdc_set_lock_data(struct obd_export *exp, const struct lustre_handle *lockh,
 	return 0;
 }
 
-enum ldlm_mode mdc_lock_match(struct obd_export *exp, __u64 flags,
+enum ldlm_mode mdc_lock_match(struct obd_export *exp, u64 flags,
 			      const struct lu_fid *fid, enum ldlm_type type,
 			      union ldlm_policy_data *policy,
 			      enum ldlm_mode mode,
@@ -319,7 +319,7 @@ static int mdc_save_lovea(struct ptlrpc_request *req,
 
 	/* pack the intent */
 	lit = req_capsule_client_get(&req->rq_pill, &RMF_LDLM_INTENT);
-	lit->opc = (__u64)it->it_op;
+	lit->opc = (u64)it->it_op;
 
 	/* pack the intended request */
 	mdc_open_pack(req, op_data, it->it_create_mode, 0, it->it_flags, lmm,
@@ -423,7 +423,7 @@ static struct ptlrpc_request *mdc_intent_unlink_pack(struct obd_export *exp,
 
 	/* pack the intent */
 	lit = req_capsule_client_get(&req->rq_pill, &RMF_LDLM_INTENT);
-	lit->opc = (__u64)it->it_op;
+	lit->opc = (u64)it->it_op;
 
 	/* pack the intended request */
 	mdc_unlink_pack(req, op_data);
@@ -463,7 +463,7 @@ static struct ptlrpc_request *mdc_intent_getattr_pack(struct obd_export *exp,
 
 	/* pack the intent */
 	lit = req_capsule_client_get(&req->rq_pill, &RMF_LDLM_INTENT);
-	lit->opc = (__u64)it->it_op;
+	lit->opc = (u64)it->it_op;
 
 	if (obddev->u.cli.cl_default_mds_easize > 0)
 		easize = obddev->u.cli.cl_default_mds_easize;
@@ -504,7 +504,7 @@ static struct ptlrpc_request *mdc_intent_layout_pack(struct obd_export *exp,
 
 	/* pack the intent */
 	lit = req_capsule_client_get(&req->rq_pill, &RMF_LDLM_INTENT);
-	lit->opc = (__u64)it->it_op;
+	lit->opc = (u64)it->it_op;
 
 	/* pack the layout intent request */
 	layout = req_capsule_client_get(&req->rq_pill, &RMF_LAYOUT_INTENT);
@@ -1031,7 +1031,7 @@ static int mdc_finish_intent_lock(struct obd_export *exp,
 }
 
 int mdc_revalidate_lock(struct obd_export *exp, struct lookup_intent *it,
-			struct lu_fid *fid, __u64 *bits)
+			struct lu_fid *fid, u64 *bits)
 {
 	/* We could just return 1 immediately, but since we should only
 	 * be called in revalidate_it if we already have a lock, let's
@@ -1126,7 +1126,7 @@ int mdc_revalidate_lock(struct obd_export *exp, struct lookup_intent *it,
  */
 int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
 		    struct lookup_intent *it, struct ptlrpc_request **reqp,
-		    ldlm_blocking_callback cb_blocking, __u64 extra_lock_flags)
+		    ldlm_blocking_callback cb_blocking, u64 extra_lock_flags)
 {
 	struct ldlm_enqueue_info einfo = {
 		.ei_type	= LDLM_IBITS,
@@ -1192,7 +1192,7 @@ static int mdc_intent_getattr_async_interpret(const struct lu_env *env,
 	struct lustre_handle     *lockh;
 	struct obd_device	*obddev;
 	struct ldlm_reply	 *lockrep;
-	__u64		     flags = LDLM_FL_HAS_INTENT;
+	u64		     flags = LDLM_FL_HAS_INTENT;
 
 	it    = &minfo->mi_it;
 	lockh = &minfo->mi_lockh;
@@ -1240,7 +1240,7 @@ int mdc_intent_getattr_async(struct obd_export *exp,
 		.l_inodebits = { MDS_INODELOCK_LOOKUP | MDS_INODELOCK_UPDATE }
 	};
 	int		      rc = 0;
-	__u64		    flags = LDLM_FL_HAS_INTENT;
+	u64		    flags = LDLM_FL_HAS_INTENT;
 
 	CDEBUG(D_DLMTRACE,
 	       "name: %.*s in inode " DFID ", intent: %s flags %#Lo\n",
drivers/staging/lustre/lustre/mdc/mdc_reint.c +3 -3
index bdffe6d..765c908 100644
@@ -64,7 +64,7 @@ static int mdc_reint(struct ptlrpc_request *request, int level)
  */
 int mdc_resource_get_unused(struct obd_export *exp, const struct lu_fid *fid,
 			    struct list_head *cancels, enum ldlm_mode mode,
-			    __u64 bits)
+			    u64 bits)
 {
 	struct ldlm_namespace *ns = exp->exp_obd->obd_namespace;
 	union ldlm_policy_data policy = {};
@@ -103,7 +103,7 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
 	LIST_HEAD(cancels);
 	struct ptlrpc_request *req;
 	int count = 0, rc;
-	__u64 bits;
+	u64 bits;
 
 	bits = MDS_INODELOCK_UPDATE;
 	if (op_data->op_attr.ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID))
@@ -151,7 +151,7 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
 int mdc_create(struct obd_export *exp, struct md_op_data *op_data,
 	       const void *data, size_t datalen, umode_t mode,
 	       uid_t uid, gid_t gid, kernel_cap_t cap_effective,
-	       __u64 rdev, struct ptlrpc_request **request)
+	       u64 rdev, struct ptlrpc_request **request)
 {
 	struct ptlrpc_request *req;
 	int level, rc;
drivers/staging/lustre/lustre/mdc/mdc_request.c +21 -21

145 lines not on this page · raw message

drivers/staging/lustre/lustre/mgc/mgc_request.c +8 -8
index ca74c75..dc80081 100644
@@ -53,7 +53,7 @@
 static int mgc_name2resid(char *name, int len, struct ldlm_res_id *res_id,
 			  int type)
 {
-	__u64 resname = 0;
+	u64 resname = 0;
 
 	if (len > sizeof(resname)) {
 		CERROR("name too long: %s\n", name);
@@ -883,10 +883,10 @@ static int mgc_set_mgs_param(struct obd_export *exp,
 }
 
 /* Take a config lock so we can get cancel notifications */
-static int mgc_enqueue(struct obd_export *exp, __u32 type,
-		       union ldlm_policy_data *policy, __u32 mode,
-		       __u64 *flags, void *bl_cb, void *cp_cb, void *gl_cb,
-		       void *data, __u32 lvb_len, void *lvb_swabber,
+static int mgc_enqueue(struct obd_export *exp, u32 type,
+		       union ldlm_policy_data *policy, u32 mode,
+		       u64 *flags, void *bl_cb, void *cp_cb, void *gl_cb,
+		       void *data, u32 lvb_len, void *lvb_swabber,
 		       struct lustre_handle *lockh)
 {
 	struct config_llog_data *cld = data;
@@ -1055,7 +1055,7 @@ static int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
 }
 
 static int mgc_get_info(const struct lu_env *env, struct obd_export *exp,
-			__u32 keylen, void *key, __u32 *vallen, void *val)
+			u32 keylen, void *key, u32 *vallen, void *val)
 {
 	int rc = -EINVAL;
 
@@ -1120,7 +1120,7 @@ enum {
 
 static int mgc_apply_recover_logs(struct obd_device *mgc,
 				  struct config_llog_data *cld,
-				  __u64 max_version,
+				  u64 max_version,
 				  void *data, int datalen, bool mne_swab)
 {
 	struct config_llog_instance *cfg = &cld->cld_cfg;
@@ -1597,7 +1597,7 @@ static bool mgc_import_in_recovery(struct obd_import *imp)
 int mgc_process_log(struct obd_device *mgc, struct config_llog_data *cld)
 {
 	struct lustre_handle lockh = { 0 };
-	__u64 flags = LDLM_FL_NO_LRU;
+	u64 flags = LDLM_FL_NO_LRU;
 	bool retry = false;
 	int rc = 0, rcl;
 
drivers/staging/lustre/lustre/obdecho/echo_client.c +3 -3
index 39b7ab1..4f9dbc4 100644
@@ -85,7 +85,7 @@ struct echo_lock {
 	struct cl_lock_slice   el_cl;
 	struct list_head	     el_chain;
 	struct echo_object    *el_object;
-	__u64		  el_cookie;
+	u64		  el_cookie;
 	atomic_t	   el_refcount;
 };
 
@@ -912,7 +912,7 @@ static int cl_echo_object_put(struct echo_object *eco)
 
 static int __cl_echo_enqueue(struct lu_env *env, struct echo_object *eco,
 			     u64 start, u64 end, int mode,
-			     __u64 *cookie, __u32 enqflags)
+			     u64 *cookie, u32 enqflags)
 {
 	struct cl_io *io;
 	struct cl_lock *lck;
@@ -954,7 +954,7 @@ static int __cl_echo_enqueue(struct lu_env *env, struct echo_object *eco,
 }
 
 static int __cl_echo_cancel(struct lu_env *env, struct echo_device *ed,
-			    __u64 cookie)
+			    u64 cookie)
 {
 	struct echo_client_obd *ec = ed->ed_ec;
 	struct echo_lock       *ecl = NULL;
drivers/staging/lustre/lustre/obdecho/echo_internal.h +1 -1
index 42faa16..ac7a209 100644
@@ -34,7 +34,7 @@
 
 /* The persistent object (i.e. actually stores stuff!) */
 #define ECHO_PERSISTENT_OBJID    1ULL
-#define ECHO_PERSISTENT_SIZE     ((__u64)(1 << 20))
+#define ECHO_PERSISTENT_SIZE     ((u64)(1 << 20))
 
 /* block size to use for data verification */
 #define OBD_ECHO_BLOCK_SIZE	(4 << 10)
drivers/staging/lustre/lustre/osc/osc_cache.c +5 -5
index 7e80a07..bef422c 100644
@@ -880,7 +880,7 @@ int osc_extent_finish(const struct lu_env *env, struct osc_extent *ext,
 	int nr_pages = ext->oe_nr_pages;
 	int lost_grant = 0;
 	int blocksize = cli->cl_import->imp_obd->obd_osfs.os_bsize ? : 4096;
-	__u64 last_off = 0;
+	u64 last_off = 0;
 	int last_count = -1;
 
 	OSC_EXTENT_DUMP(D_CACHE, ext, "extent finished.\n");
@@ -991,7 +991,7 @@ static int osc_extent_truncate(struct osc_extent *ext, pgoff_t trunc_index,
 	struct osc_async_page *tmp;
 	int pages_in_chunk = 0;
 	int ppc_bits = cli->cl_chunkbits - PAGE_SHIFT;
-	__u64 trunc_chunk = trunc_index >> ppc_bits;
+	u64 trunc_chunk = trunc_index >> ppc_bits;
 	int grants = 0;
 	int nr_pages = 0;
 	int rc = 0;
@@ -1799,7 +1799,7 @@ static int osc_list_maint(struct client_obd *cli, struct osc_object *osc)
  * sync so that the app can get a sync error and break the cycle of queueing
  * pages for which writeback will fail.
  */
-static void osc_process_ar(struct osc_async_rc *ar, __u64 xid,
+static void osc_process_ar(struct osc_async_rc *ar, u64 xid,
 			   int rc)
 {
 	if (rc) {
@@ -1824,7 +1824,7 @@ static void osc_ap_completion(const struct lu_env *env, struct client_obd *cli,
 {
 	struct osc_object *osc = oap->oap_obj;
 	struct lov_oinfo *loi = osc->oo_oinfo;
-	__u64 xid = 0;
+	u64 xid = 0;
 
 	if (oap->oap_request) {
 		xid = ptlrpc_req_xid(oap->oap_request);
@@ -3127,7 +3127,7 @@ static bool check_and_discard_cb(const struct lu_env *env, struct cl_io *io,
 		tmp = osc_dlmlock_at_pgoff(env, osc, index,
 					   OSC_DAP_FL_TEST_LOCK);
 		if (tmp) {
-			__u64 end = tmp->l_policy_data.l_extent.end;
+			u64 end = tmp->l_policy_data.l_extent.end;
 			/* Cache the first-non-overlapped index so as to skip
 			 * all pages within [index, oti_fn_index). This is safe
 			 * because if tmp lock is canceled, it will discard
drivers/staging/lustre/lustre/osc/osc_cl_internal.h +1 -1
index c0f58f4..c89c894 100644
@@ -255,7 +255,7 @@ struct osc_lock {
 	/* underlying DLM lock */
 	struct ldlm_lock		*ols_dlmlock;
 	/* DLM flags with which osc_lock::ols_lock was enqueued */
-	__u64				ols_flags;
+	u64				ols_flags;
 	/* osc_lock::ols_lock handle */
 	struct lustre_handle		ols_handle;
 	struct ldlm_enqueue_info	ols_einfo;
drivers/staging/lustre/lustre/osc/osc_internal.h +3 -3
index c61ef89..4033365 100644
@@ -91,7 +91,7 @@ static inline void osc_wake_cache_waiters(struct client_obd *cli)
 	wake_up(&cli->cl_cache_waiters);
 }
 
-int osc_shrink_grant_to_target(struct client_obd *cli, __u64 target_bytes);
+int osc_shrink_grant_to_target(struct client_obd *cli, u64 target_bytes);
 void osc_update_next_shrink(struct client_obd *cli);
 
 /*
@@ -103,7 +103,7 @@ typedef int (*osc_enqueue_upcall_f)(void *cookie, struct lustre_handle *lockh,
 				    int rc);
 
 int osc_enqueue_base(struct obd_export *exp, struct ldlm_res_id *res_id,
-		     __u64 *flags, union ldlm_policy_data *policy,
+		     u64 *flags, union ldlm_policy_data *policy,
 		     struct ost_lvb *lvb, int kms_valid,
 		     osc_enqueue_upcall_f upcall,
 		     void *cookie, struct ldlm_enqueue_info *einfo,
@@ -111,7 +111,7 @@ int osc_enqueue_base(struct obd_export *exp, struct ldlm_res_id *res_id,
 
 int osc_match_base(struct obd_export *exp, struct ldlm_res_id *res_id,
 		   enum ldlm_type type, union ldlm_policy_data *policy,
-		   enum ldlm_mode mode, __u64 *flags, void *data,
+		   enum ldlm_mode mode, u64 *flags, void *data,
 		   struct lustre_handle *lockh, int unref);
 
 int osc_setattr_async(struct obd_export *exp, struct obdo *oa,
drivers/staging/lustre/lustre/osc/osc_io.c +5 -5
index 0a7bfe2..cf5b3cc 100644
@@ -240,7 +240,7 @@ static void osc_page_touch_at(const struct lu_env *env,
 	struct lov_oinfo *loi = cl2osc(obj)->oo_oinfo;
 	struct cl_attr *attr = &osc_env_info(env)->oti_attr;
 	int valid;
-	__u64 kms;
+	u64 kms;
 
 	/* offset within stripe */
 	kms = cl_offset(obj, idx) + to;
@@ -454,7 +454,7 @@ static bool trunc_check_cb(const struct lu_env *env, struct cl_io *io,
 {
 	struct cl_page *page = ops->ops_cl.cpl_page;
 	struct osc_async_page *oap;
-	__u64 start = *(__u64 *)cbdata;
+	u64 start = *(u64 *)cbdata;
 
 	oap = &ops->ops_oap;
 	if (oap->oap_cmd & OBD_BRW_WRITE &&
@@ -470,7 +470,7 @@ static bool trunc_check_cb(const struct lu_env *env, struct cl_io *io,
 }
 
 static void osc_trunc_check(const struct lu_env *env, struct cl_io *io,
-			    struct osc_io *oio, __u64 size)
+			    struct osc_io *oio, u64 size)
 {
 	struct cl_object *clob;
 	int partial;
@@ -498,7 +498,7 @@ static int osc_io_setattr_start(const struct lu_env *env,
 	struct cl_attr *attr = &osc_env_info(env)->oti_attr;
 	struct obdo *oa = &oio->oi_oa;
 	struct osc_async_cbargs *cbargs = &oio->oi_cbarg;
-	__u64 size = io->u.ci_setattr.sa_attr.lvb_size;
+	u64 size = io->u.ci_setattr.sa_attr.lvb_size;
 	unsigned int ia_avalid = io->u.ci_setattr.sa_avalid;
 	enum op_xvalid ia_xvalid = io->u.ci_setattr.sa_xvalid;
 	int result = 0;
@@ -615,7 +615,7 @@ static void osc_io_setattr_end(const struct lu_env *env,
 	}
 
 	if (cl_io_is_trunc(io)) {
-		__u64 size = io->u.ci_setattr.sa_attr.lvb_size;
+		u64 size = io->u.ci_setattr.sa_attr.lvb_size;
 
 		osc_trunc_check(env, io, oio, size);
 		osc_cache_truncate_end(env, oio->oi_trunc);
drivers/staging/lustre/lustre/osc/osc_lock.c +6 -6
index 1781243..06d813e 100644
@@ -153,9 +153,9 @@ static void osc_lock_build_policy(const struct lu_env *env,
 	policy->l_extent.gid = d->cld_gid;
 }
 
-static __u64 osc_enq2ldlm_flags(__u32 enqflags)
+static u64 osc_enq2ldlm_flags(u32 enqflags)
 {
-	__u64 result = 0;
+	u64 result = 0;
 
 	LASSERT((enqflags & ~CEF_MASK) == 0);
 
@@ -200,7 +200,7 @@ static void osc_lock_lvb_update(const struct lu_env *env,
 
 	cl_object_attr_lock(obj);
 	if (dlmlock) {
-		__u64 size;
+		u64 size;
 
 		check_res_locked(dlmlock->l_resource);
 		LASSERT(lvb == dlmlock->l_lvb_data);
@@ -450,7 +450,7 @@ static int __osc_dlm_blocking_ast(const struct lu_env *env,
 	if (obj) {
 		struct ldlm_extent *extent = &dlmlock->l_policy_data.l_extent;
 		struct cl_attr *attr = &osc_env_info(env)->oti_attr;
-		__u64 old_kms;
+		u64 old_kms;
 
 		/* Destroy pages covered by the extent of the DLM lock */
 		result = osc_lock_flush(cl2osc(obj),
@@ -1146,7 +1146,7 @@ int osc_lock_init(const struct lu_env *env,
 		  const struct cl_io *io)
 {
 	struct osc_lock *oscl;
-	__u32 enqflags = lock->cll_descr.cld_enq_flags;
+	u32 enqflags = lock->cll_descr.cld_enq_flags;
 
 	oscl = kmem_cache_zalloc(osc_lock_kmem, GFP_NOFS);
 	if (!oscl)
@@ -1200,7 +1200,7 @@ struct ldlm_lock *osc_dlmlock_at_pgoff(const struct lu_env *env,
 	struct lustre_handle lockh;
 	struct ldlm_lock *lock = NULL;
 	enum ldlm_mode mode;
-	__u64 flags;
+	u64 flags;
 
 	ostid_build_res_name(&obj->oo_oinfo->loi_oi, resname);
 	osc_index2policy(policy, osc2cl(obj), index, index);
drivers/staging/lustre/lustre/osc/osc_object.c +1 -1
index e9ecb77..1097380 100644
@@ -173,7 +173,7 @@ static int osc_attr_update(const struct lu_env *env, struct cl_object *obj,
 		lvb->lvb_blocks = attr->cat_blocks;
 	if (valid & CAT_KMS) {
 		CDEBUG(D_CACHE, "set kms from %llu to %llu\n",
-		       oinfo->loi_kms, (__u64)attr->cat_kms);
+		       oinfo->loi_kms, (u64)attr->cat_kms);
 		loi_kms_set(oinfo, attr->cat_kms);
 	}
 	return 0;
drivers/staging/lustre/lustre/osc/osc_request.c +19 -19
index 2599caa..e92c8ac 100644
@@ -101,7 +101,7 @@ struct osc_enqueue_args {
 	struct obd_export	*oa_exp;
 	enum ldlm_type		oa_type;
 	enum ldlm_mode		oa_mode;
-	__u64			*oa_flags;
+	u64			*oa_flags;
 	osc_enqueue_upcall_f	oa_upcall;
 	void			*oa_cookie;
 	struct ost_lvb		*oa_lvb;
@@ -535,7 +535,7 @@ int osc_sync_base(struct osc_object *obj, struct obdo *oa,
  */
 static int osc_resource_get_unused(struct obd_export *exp, struct obdo *oa,
 				   struct list_head *cancels,
-				   enum ldlm_mode mode, __u64 lock_flags)
+				   enum ldlm_mode mode, u64 lock_flags)
 {
 	struct ldlm_namespace *ns = exp->exp_obd->obd_namespace;
 	struct ldlm_res_id res_id;
@@ -783,7 +783,7 @@ static void osc_shrink_grant_local(struct client_obd *cli, struct obdo *oa)
  */
 static int osc_shrink_grant(struct client_obd *cli)
 {
-	__u64 target_bytes = (cli->cl_max_rpcs_in_flight + 1) *
+	u64 target_bytes = (cli->cl_max_rpcs_in_flight + 1) *
 			     (cli->cl_max_pages_per_rpc << PAGE_SHIFT);
 
 	spin_lock(&cli->cl_loi_list_lock);
@@ -794,7 +794,7 @@ static int osc_shrink_grant(struct client_obd *cli)
 	return osc_shrink_grant_to_target(cli, target_bytes);
 }
 
-int osc_shrink_grant_to_target(struct client_obd *cli, __u64 target_bytes)
+int osc_shrink_grant_to_target(struct client_obd *cli, u64 target_bytes)
 {
 	int rc = 0;
 	struct ost_body	*body;
@@ -1000,7 +1000,7 @@ static int check_write_rcs(struct ptlrpc_request *req,
 			   u32 page_count, struct brw_page **pga)
 {
 	int i;
-	__u32 *remote_rcs;
+	u32 *remote_rcs;
 
 	remote_rcs = req_capsule_server_sized_get(&req->rq_pill, &RMF_RCS,
 						  sizeof(*remote_rcs) *
@@ -1055,7 +1055,7 @@ static u32 osc_checksum_bulk(int nob, u32 pg_count,
 			     struct brw_page **pga, int opc,
 			     enum cksum_type cksum_type)
 {
-	__u32 cksum;
+	u32 cksum;
 	int i = 0;
 	struct ahash_request *hdesc;
 	unsigned int bufsize;
@@ -1285,7 +1285,7 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,
 		oa->o_cksum = body->oa.o_cksum;
 		/* 1 RC per niobuf */
 		req_capsule_set_size(pill, &RMF_RCS, RCL_SERVER,
-				     sizeof(__u32) * niocount);
+				     sizeof(u32) * niocount);
 	} else {
 		if (cli->cl_checksum &&
 		    !sptlrpc_flavor_has_bulk(&req->rq_flvr)) {
@@ -1395,7 +1395,7 @@ static int check_write_checksum(struct obdo *oa,
 				u32 client_cksum, u32 server_cksum,
 				struct osc_brw_async_args *aa)
 {
-	__u32 new_cksum;
+	u32 new_cksum;
 	char *msg;
 	enum cksum_type cksum_type;
 
@@ -1452,7 +1452,7 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc)
 			&req->rq_import->imp_connection->c_peer;
 	struct client_obd *cli = aa->aa_cli;
 	struct ost_body *body;
-	__u32 client_cksum = 0;
+	u32 client_cksum = 0;
 
 	if (rc < 0 && rc != -EDQUOT) {
 		DEBUG_REQ(D_INFO, req, "Failed request with rc = %d\n", rc);
@@ -1534,7 +1534,7 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc)
 
 	if (body->oa.o_valid & OBD_MD_FLCKSUM) {
 		static int cksum_counter;
-		__u32 server_cksum = body->oa.o_cksum;
+		u32 server_cksum = body->oa.o_cksum;
 		char *via = "";
 		char *router = "";
 		enum cksum_type cksum_type;
@@ -2050,7 +2050,7 @@ static int osc_set_lock_data(struct ldlm_lock *lock, void *data)
 static int osc_enqueue_fini(struct ptlrpc_request *req,
 			    osc_enqueue_upcall_f upcall, void *cookie,
 			    struct lustre_handle *lockh, enum ldlm_mode mode,
-			    __u64 *flags, int agl, int errcode)
+			    u64 *flags, int agl, int errcode)
 {
 	bool intent = *flags & LDLM_FL_HAS_INTENT;
 	int rc;
@@ -2090,8 +2090,8 @@ static int osc_enqueue_interpret(const struct lu_env *env,
 	struct lustre_handle *lockh = &aa->oa_lockh;
 	enum ldlm_mode mode = aa->oa_mode;
 	struct ost_lvb *lvb = aa->oa_lvb;
-	__u32 lvb_len = sizeof(*lvb);
-	__u64 flags = 0;
+	u32 lvb_len = sizeof(*lvb);
+	u64 flags = 0;
 
 	/* ldlm_cli_enqueue is holding a reference on the lock, so it must
 	 * be valid.
@@ -2143,7 +2143,7 @@ static int osc_enqueue_interpret(const struct lu_env *env,
  * release locks just after they are obtained.
  */
 int osc_enqueue_base(struct obd_export *exp, struct ldlm_res_id *res_id,
-		     __u64 *flags, union ldlm_policy_data *policy,
+		     u64 *flags, union ldlm_policy_data *policy,
 		     struct ost_lvb *lvb, int kms_valid,
 		     osc_enqueue_upcall_f upcall, void *cookie,
 		     struct ldlm_enqueue_info *einfo,
@@ -2153,7 +2153,7 @@ int osc_enqueue_base(struct obd_export *exp, struct ldlm_res_id *res_id,
 	struct lustre_handle lockh = { 0 };
 	struct ptlrpc_request *req = NULL;
 	int intent = *flags & LDLM_FL_HAS_INTENT;
-	__u64 match_flags = *flags;
+	u64 match_flags = *flags;
 	enum ldlm_mode mode;
 	int rc;
 
@@ -2292,11 +2292,11 @@ int osc_enqueue_base(struct obd_export *exp, struct ldlm_res_id *res_id,
 
 int osc_match_base(struct obd_export *exp, struct ldlm_res_id *res_id,
 		   enum ldlm_type type, union ldlm_policy_data *policy,
-		   enum ldlm_mode mode, __u64 *flags, void *data,
+		   enum ldlm_mode mode, u64 *flags, void *data,
 		   struct lustre_handle *lockh, int unref)
 {
 	struct obd_device *obd = exp->exp_obd;
-	__u64 lflags = *flags;
+	u64 lflags = *flags;
 	enum ldlm_mode rc;
 
 	if (OBD_FAIL_CHECK(OBD_FAIL_OSC_MATCH))
@@ -2371,7 +2371,7 @@ static int osc_statfs_interpret(const struct lu_env *env,
 }
 
 static int osc_statfs_async(struct obd_export *exp,
-			    struct obd_info *oinfo, __u64 max_age,
+			    struct obd_info *oinfo, u64 max_age,
 			    struct ptlrpc_request_set *rqset)
 {
 	struct obd_device *obd = class_exp2obd(exp);
@@ -2415,7 +2415,7 @@ static int osc_statfs_async(struct obd_export *exp,
 }
 
 static int osc_statfs(const struct lu_env *env, struct obd_export *exp,
-		      struct obd_statfs *osfs, __u64 max_age, __u32 flags)
+		      struct obd_statfs *osfs, u64 max_age, u32 flags)
 {
 	struct obd_device *obd = class_exp2obd(exp);
 	struct obd_statfs *msfs;
Signature · 1 line
1.8.3.1
#9 lore raw

PATCH 9/26 lustre: cleanup white spaces in fid and fld layer

In reply to James Simmons

The lustre code is very messy and difficult to read. Remove excess white space and properly align data structures so they are easy on the eyes.

---
 drivers/staging/lustre/lustre/fid/fid_request.c  | 10 +++++-----
 drivers/staging/lustre/lustre/fid/lproc_fid.c    |  2 +-
 drivers/staging/lustre/lustre/fld/fld_cache.c    | 14 +++++++-------
 drivers/staging/lustre/lustre/fld/fld_internal.h | 24 ++++++++++++------------
 drivers/staging/lustre/lustre/fld/fld_request.c  |  8 ++++----
 5 files changed, 29 insertions(+), 29 deletions(-)
drivers/staging/lustre/lustre/fid/fid_request.c +5 -5
index 3f79f22..45dd275 100644
@@ -55,12 +55,12 @@ static int seq_client_rpc(struct lu_client_seq *seq,
 			  struct lu_seq_range *output, u32 opc,
 			  const char *opcname)
 {
-	struct obd_export     *exp = seq->lcs_exp;
+	struct obd_export *exp = seq->lcs_exp;
 	struct ptlrpc_request *req;
-	struct lu_seq_range   *out, *in;
-	u32                 *op;
-	unsigned int           debug_mask;
-	int                    rc;
+	struct lu_seq_range *out, *in;
+	u32 *op;
+	unsigned int debug_mask;
+	int rc;
 
 	LASSERT(exp && !IS_ERR(exp));
 	req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), &RQF_SEQ_QUERY,
drivers/staging/lustre/lustre/fid/lproc_fid.c +1 -1
index d583778..d7d23b4 100644
@@ -143,7 +143,7 @@
 			     size_t count, loff_t *off)
 {
 	struct lu_client_seq *seq;
-	u64  max;
+	u64 max;
 	int rc, val;
 
 	seq = ((struct seq_file *)file->private_data)->private;
drivers/staging/lustre/lustre/fld/fld_cache.c +7 -7
index 749d33b..b4baa53 100644
@@ -255,8 +255,8 @@ static void fld_cache_punch_hole(struct fld_cache *cache,
 				 struct fld_cache_entry *f_new)
 {
 	const struct lu_seq_range *range = &f_new->fce_range;
-	const u64 new_start  = range->lsr_start;
-	const u64 new_end  = range->lsr_end;
+	const u64 new_start = range->lsr_start;
+	const u64 new_end = range->lsr_end;
 	struct fld_cache_entry *fldt;
 
 	fldt = kzalloc(sizeof(*fldt), GFP_ATOMIC);
@@ -294,8 +294,8 @@ static void fld_cache_overlap_handle(struct fld_cache *cache,
 				     struct fld_cache_entry *f_new)
 {
 	const struct lu_seq_range *range = &f_new->fce_range;
-	const u64 new_start  = range->lsr_start;
-	const u64 new_end  = range->lsr_end;
+	const u64 new_start = range->lsr_start;
+	const u64 new_end = range->lsr_end;
 	const u32 mdt = range->lsr_index;
 
 	/* this is overlap case, these case are checking overlapping with
@@ -381,8 +381,8 @@ static int fld_cache_insert_nolock(struct fld_cache *cache,
 	struct fld_cache_entry *n;
 	struct list_head *head;
 	struct list_head *prev = NULL;
-	const u64 new_start  = f_new->fce_range.lsr_start;
-	const u64 new_end  = f_new->fce_range.lsr_end;
+	const u64 new_start = f_new->fce_range.lsr_start;
+	const u64 new_end = f_new->fce_range.lsr_end;
 	u32 new_flags  = f_new->fce_range.lsr_flags;
 
 	/*
@@ -425,7 +425,7 @@ static int fld_cache_insert_nolock(struct fld_cache *cache,
 int fld_cache_insert(struct fld_cache *cache,
 		     const struct lu_seq_range *range)
 {
-	struct fld_cache_entry	*flde;
+	struct fld_cache_entry *flde;
 	int rc;
 
 	flde = fld_cache_entry_create(range);
drivers/staging/lustre/lustre/fld/fld_internal.h +12 -12
index 66a0fb6..76666a4 100644
@@ -75,10 +75,10 @@ struct lu_fld_hash {
 };
 
 struct fld_cache_entry {
-	struct list_head	       fce_lru;
-	struct list_head	       fce_list;
+	struct list_head	fce_lru;
+	struct list_head	fce_list;
 	/** fld cache entries are sorted on range->lsr_start field. */
-	struct lu_seq_range      fce_range;
+	struct lu_seq_range	fce_range;
 };
 
 struct fld_cache {
@@ -86,29 +86,29 @@ struct fld_cache {
 	 * Cache guard, protects fci_hash mostly because others immutable after
 	 * init is finished.
 	 */
-	rwlock_t		 fci_lock;
+	rwlock_t		fci_lock;
 
 	/** Cache shrink threshold */
-	int		      fci_threshold;
+	int			fci_threshold;
 
 	/** Preferred number of cached entries */
-	int		      fci_cache_size;
+	int			fci_cache_size;
 
 	/** Current number of cached entries. Protected by \a fci_lock */
-	int		      fci_cache_count;
+	int			fci_cache_count;
 
 	/** LRU list fld entries. */
-	struct list_head	       fci_lru;
+	struct list_head	fci_lru;
 
 	/** sorted fld entries. */
-	struct list_head	       fci_entries_head;
+	struct list_head	fci_entries_head;
 
 	/** Cache statistics. */
-	struct fld_stats	 fci_stat;
+	struct fld_stats	fci_stat;
 
 	/** Cache name used for debug and messages. */
-	char		     fci_name[LUSTRE_MDT_MAXNAMELEN];
-	unsigned int		 fci_no_shrink:1;
+	char			fci_name[LUSTRE_MDT_MAXNAMELEN];
+	unsigned int		fci_no_shrink:1;
 };
 
 enum {
drivers/staging/lustre/lustre/fld/fld_request.c +4 -4
index 8a915b9..248fffa 100644
@@ -307,10 +307,10 @@ int fld_client_rpc(struct obd_export *exp,
 		   struct ptlrpc_request **reqp)
 {
 	struct ptlrpc_request *req = NULL;
-	struct lu_seq_range   *prange;
-	u32		 *op;
-	int		    rc = 0;
-	struct obd_import     *imp;
+	struct lu_seq_range *prange;
+	u32 *op;
+	int rc = 0;
+	struct obd_import *imp;
 
 	LASSERT(exp);
 
Signature · 1 line
1.8.3.1
#10 lore raw

PATCH 10/26 ldlm: cleanup white spaces

In reply to James Simmons

The ldlm code is very messy and difficult to read. Remove excess white space and properly align data structures so they are easy on the eyes.

---
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c    |  4 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c      | 22 +++---
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c     | 36 +++++-----
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c    | 28 ++++----
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c     |  5 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  | 28 ++++----
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 78 +++++++++++-----------
 7 files changed, 99 insertions(+), 102 deletions(-)
drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +2 -2
index baa5b3a..4fc380d2 100644
@@ -314,8 +314,8 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req)
 int
 ldlm_flock_completion_ast(struct ldlm_lock *lock, u64 flags, void *data)
 {
-	struct file_lock		*getlk = lock->l_ast_data;
-	int				rc = 0;
+	struct file_lock *getlk = lock->l_ast_data;
+	int rc = 0;
 
 	OBD_FAIL_TIMEOUT(OBD_FAIL_LDLM_CP_CB_WAIT2, 4);
 	if (OBD_FAIL_PRECHECK(OBD_FAIL_LDLM_CP_CB_WAIT3)) {
drivers/staging/lustre/lustre/ldlm/ldlm_lib.c +11 -11
index 5a59c15..aef83ff 100644
@@ -512,11 +512,11 @@ int client_connect_import(const struct lu_env *env,
 			  struct obd_device *obd, struct obd_uuid *cluuid,
 			  struct obd_connect_data *data, void *localdata)
 {
-	struct client_obd       *cli    = &obd->u.cli;
-	struct obd_import       *imp    = cli->cl_import;
+	struct client_obd *cli = &obd->u.cli;
+	struct obd_import *imp = cli->cl_import;
 	struct obd_connect_data *ocd;
-	struct lustre_handle    conn    = { 0 };
-	int		     rc;
+	struct lustre_handle conn = { 0 };
+	int rc;
 
 	*exp = NULL;
 	down_write(&cli->cl_sem);
@@ -703,9 +703,9 @@ int target_pack_pool_reply(struct ptlrpc_request *req)
 void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id)
 {
 	struct ptlrpc_service_part *svcpt;
-	int			netrc;
+	int netrc;
 	struct ptlrpc_reply_state *rs;
-	struct obd_export	 *exp;
+	struct obd_export *exp;
 
 	if (req->rq_no_reply)
 		return;
@@ -736,11 +736,11 @@ void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id)
 
 	/* disable reply scheduling while I'm setting up */
 	rs->rs_scheduled = 1;
-	rs->rs_on_net    = 1;
-	rs->rs_xid       = req->rq_xid;
-	rs->rs_transno   = req->rq_transno;
-	rs->rs_export    = exp;
-	rs->rs_opc       = lustre_msg_get_opc(req->rq_reqmsg);
+	rs->rs_on_net = 1;
+	rs->rs_xid = req->rq_xid;
+	rs->rs_transno = req->rq_transno;
+	rs->rs_export = exp;
+	rs->rs_opc = lustre_msg_get_opc(req->rq_reqmsg);
 
 	spin_lock(&exp->exp_uncommitted_replies_lock);
 	CDEBUG(D_NET, "rs transno = %llu, last committed = %llu\n",
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +17 -19
index e726e76..cea0e22 100644
@@ -682,7 +682,7 @@ void ldlm_lock_addref_internal_nolock(struct ldlm_lock *lock,
 int ldlm_lock_addref_try(const struct lustre_handle *lockh, enum ldlm_mode mode)
 {
 	struct ldlm_lock *lock;
-	int	       result;
+	int result;
 
 	result = -EAGAIN;
 	lock = ldlm_handle2lock(lockh);
@@ -1344,7 +1344,7 @@ enum ldlm_mode ldlm_lock_match(struct ldlm_namespace *ns, u64 flags,
 			}
 		}
 	}
- out2:
+out2:
 	if (rc) {
 		LDLM_DEBUG(lock, "matched (%llu %llu)",
 			   (type == LDLM_PLAIN || type == LDLM_IBITS) ?
@@ -1568,8 +1568,6 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns,
 	return ERR_PTR(rc);
 }
 
-
-
 /**
  * Enqueue (request) a lock.
  * On the client this is called from ldlm_cli_enqueue_fini
@@ -1629,9 +1627,9 @@ enum ldlm_error ldlm_lock_enqueue(struct ldlm_namespace *ns,
 ldlm_work_bl_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
 {
 	struct ldlm_cb_set_arg *arg = opaq;
-	struct ldlm_lock_desc   d;
-	int		     rc;
-	struct ldlm_lock       *lock;
+	struct ldlm_lock_desc d;
+	int rc;
+	struct ldlm_lock *lock;
 
 	if (list_empty(arg->list))
 		return -ENOENT;
@@ -1664,9 +1662,9 @@ enum ldlm_error ldlm_lock_enqueue(struct ldlm_namespace *ns,
 static int
 ldlm_work_cp_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
 {
-	struct ldlm_cb_set_arg  *arg = opaq;
-	int		      rc = 0;
-	struct ldlm_lock	*lock;
+	struct ldlm_cb_set_arg *arg = opaq;
+	int rc = 0;
+	struct ldlm_lock *lock;
 	ldlm_completion_callback completion_callback;
 
 	if (list_empty(arg->list))
@@ -1711,9 +1709,9 @@ enum ldlm_error ldlm_lock_enqueue(struct ldlm_namespace *ns,
 ldlm_work_revoke_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
 {
 	struct ldlm_cb_set_arg *arg = opaq;
-	struct ldlm_lock_desc   desc;
-	int		     rc;
-	struct ldlm_lock       *lock;
+	struct ldlm_lock_desc desc;
+	int rc;
+	struct ldlm_lock *lock;
 
 	if (list_empty(arg->list))
 		return -ENOENT;
@@ -1737,10 +1735,10 @@ enum ldlm_error ldlm_lock_enqueue(struct ldlm_namespace *ns,
  */
 static int ldlm_work_gl_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
 {
-	struct ldlm_cb_set_arg		*arg = opaq;
-	struct ldlm_glimpse_work	*gl_work;
-	struct ldlm_lock		*lock;
-	int				 rc = 0;
+	struct ldlm_cb_set_arg *arg = opaq;
+	struct ldlm_glimpse_work *gl_work;
+	struct ldlm_lock *lock;
+	int rc = 0;
 
 	if (list_empty(arg->list))
 		return -ENOENT;
@@ -1776,8 +1774,8 @@ int ldlm_run_ast_work(struct ldlm_namespace *ns, struct list_head *rpc_list,
 		      enum ldlm_desc_ast_t ast_type)
 {
 	struct ldlm_cb_set_arg *arg;
-	set_producer_func       work_ast_lock;
-	int		     rc;
+	set_producer_func work_ast_lock;
+	int rc;
 
 	if (list_empty(rpc_list))
 		return 0;
drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +14 -14
index e766f798..bae67ac 100644
@@ -77,32 +77,32 @@ struct ldlm_bl_pool {
 	 * as a priority. It is used for LDLM_FL_DISCARD_DATA requests.
 	 * see bug 13843
 	 */
-	struct list_head	      blp_prio_list;
+	struct list_head	blp_prio_list;
 
 	/*
 	 * blp_list is used for all other callbacks which are likely
 	 * to take longer to process.
 	 */
-	struct list_head	      blp_list;
+	struct list_head	blp_list;
 
-	wait_queue_head_t	     blp_waitq;
+	wait_queue_head_t	blp_waitq;
 	struct completion	blp_comp;
-	atomic_t	    blp_num_threads;
-	atomic_t	    blp_busy_threads;
-	int		     blp_min_threads;
-	int		     blp_max_threads;
+	atomic_t		blp_num_threads;
+	atomic_t		blp_busy_threads;
+	int			blp_min_threads;
+	int			blp_max_threads;
 };
 
 struct ldlm_bl_work_item {
-	struct list_head	      blwi_entry;
+	struct list_head	blwi_entry;
 	struct ldlm_namespace  *blwi_ns;
 	struct ldlm_lock_desc   blwi_ld;
 	struct ldlm_lock       *blwi_lock;
-	struct list_head	      blwi_head;
-	int		     blwi_count;
+	struct list_head	blwi_head;
+	int			blwi_count;
 	struct completion	blwi_comp;
-	enum ldlm_cancel_flags  blwi_flags;
-	int		     blwi_mem_pressure;
+	enum ldlm_cancel_flags	blwi_flags;
+	int			blwi_mem_pressure;
 };
 
 /**
@@ -928,8 +928,8 @@ static ssize_t cancel_unused_locks_before_replay_store(struct kobject *kobj,
 
 static int ldlm_setup(void)
 {
-	static struct ptlrpc_service_conf	conf;
-	struct ldlm_bl_pool			*blp = NULL;
+	static struct ptlrpc_service_conf conf;
+	struct ldlm_bl_pool *blp = NULL;
 	int rc = 0;
 	int i;
 
drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +2 -3
index e94d8a3..5b23767f 100644
@@ -465,8 +465,7 @@ static ssize_t grant_speed_show(struct kobject *kobj, struct attribute *attr,
 {
 	struct ldlm_pool *pl = container_of(kobj, struct ldlm_pool,
 					    pl_kobj);
-
-	int	       grant_speed;
+	int grant_speed;
 
 	spin_lock(&pl->pl_lock);
 	/* serialize with ldlm_pool_recalc */
@@ -902,7 +901,7 @@ static void ldlm_pools_recalc(struct work_struct *ws)
 	 * Recalc at least ldlm_namespace_nr_read(client) namespaces.
 	 */
 	for (nr = ldlm_namespace_nr_read(client); nr > 0; nr--) {
-		int     skip;
+		int skip;
 		/*
 		 * Lock the list, get first @ns in the list, getref, move it
 		 * to the tail, unlock and call pool recalc. This way we avoid
drivers/staging/lustre/lustre/ldlm/ldlm_request.c +14 -14
index a7fe8c6..b819ade 100644
@@ -565,9 +565,9 @@ int ldlm_prep_elc_req(struct obd_export *exp, struct ptlrpc_request *req,
 		      int version, int opc, int canceloff,
 		      struct list_head *cancels, int count)
 {
-	struct ldlm_namespace   *ns = exp->exp_obd->obd_namespace;
-	struct req_capsule      *pill = &req->rq_pill;
-	struct ldlm_request     *dlm = NULL;
+	struct ldlm_namespace *ns = exp->exp_obd->obd_namespace;
+	struct req_capsule *pill = &req->rq_pill;
+	struct ldlm_request *dlm = NULL;
 	int flags, avail, to_free, pack = 0;
 	LIST_HEAD(head);
 	int rc;
@@ -675,11 +675,11 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
 		     struct lustre_handle *lockh, int async)
 {
 	struct ldlm_namespace *ns;
-	struct ldlm_lock      *lock;
-	struct ldlm_request   *body;
-	int		    is_replay = *flags & LDLM_FL_REPLAY;
-	int		    req_passed_in = 1;
-	int		    rc, err;
+	struct ldlm_lock *lock;
+	struct ldlm_request *body;
+	int is_replay = *flags & LDLM_FL_REPLAY;
+	int req_passed_in = 1;
+	int rc, err;
 	struct ptlrpc_request *req;
 
 	ns = exp->exp_obd->obd_namespace;
@@ -1718,8 +1718,8 @@ static int ldlm_cli_hash_cancel_unused(struct cfs_hash *hs,
 				       struct cfs_hash_bd *bd,
 				       struct hlist_node *hnode, void *arg)
 {
-	struct ldlm_resource	   *res = cfs_hash_object(hs, hnode);
-	struct ldlm_cli_cancel_arg     *lc = arg;
+	struct ldlm_resource *res = cfs_hash_object(hs, hnode);
+	struct ldlm_cli_cancel_arg *lc = arg;
 
 	ldlm_cli_cancel_unused_resource(ldlm_res_to_ns(res), &res->lr_name,
 					NULL, LCK_MINMODE,
@@ -1878,9 +1878,9 @@ static int replay_lock_interpret(const struct lu_env *env,
 				 struct ptlrpc_request *req,
 				 struct ldlm_async_args *aa, int rc)
 {
-	struct ldlm_lock     *lock;
-	struct ldlm_reply    *reply;
-	struct obd_export    *exp;
+	struct ldlm_lock *lock;
+	struct ldlm_reply *reply;
+	struct obd_export *exp;
 
 	atomic_dec(&req->rq_import->imp_replay_inflight);
 	if (rc != ELDLM_OK)
@@ -1920,7 +1920,7 @@ static int replay_one_lock(struct obd_import *imp, struct ldlm_lock *lock)
 {
 	struct ptlrpc_request *req;
 	struct ldlm_async_args *aa;
-	struct ldlm_request   *body;
+	struct ldlm_request *body;
 	int flags;
 
 	/* Bug 11974: Do not replay a lock which is actively being canceled */
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +39 -39

174 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#11 lore raw

PATCH 11/26 llite: cleanup white spaces

In reply to James Simmons

The llite code is very messy and difficult to read. Remove excess white space and properly align data structures so they are easy on the eyes.

---
 drivers/staging/lustre/lustre/llite/dir.c          | 114 ++++++-------
 drivers/staging/lustre/lustre/llite/file.c         | 180 ++++++++++-----------
 drivers/staging/lustre/lustre/llite/glimpse.c      |  18 +--
 drivers/staging/lustre/lustre/llite/lcommon_cl.c   |  24 +--
 drivers/staging/lustre/lustre/llite/llite_lib.c    |  52 +++---
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |  52 +++---
 drivers/staging/lustre/lustre/llite/llite_nfs.c    |  42 ++---
 drivers/staging/lustre/lustre/llite/lproc_llite.c  |  80 ++++-----
 drivers/staging/lustre/lustre/llite/namei.c        |  49 +++---
 drivers/staging/lustre/lustre/llite/rw.c           |   2 +-
 drivers/staging/lustre/lustre/llite/rw26.c         |  57 ++++---
 drivers/staging/lustre/lustre/llite/statahead.c    | 133 +++++++--------
 drivers/staging/lustre/lustre/llite/super25.c      |  16 +-
 drivers/staging/lustre/lustre/llite/vvp_dev.c      | 104 ++++++------
 drivers/staging/lustre/lustre/llite/vvp_internal.h |  56 +++----
 drivers/staging/lustre/lustre/llite/vvp_io.c       | 169 ++++++++++---------
 drivers/staging/lustre/lustre/llite/vvp_object.c   |  30 ++--
 drivers/staging/lustre/lustre/llite/vvp_page.c     |  88 +++++-----
 drivers/staging/lustre/lustre/llite/xattr.c        |  48 +++---
 19 files changed, 658 insertions(+), 656 deletions(-)
drivers/staging/lustre/lustre/llite/dir.c +57 -57
index 4520344..fd1af4a 100644
@@ -200,13 +200,13 @@ static u16 ll_dirent_type_get(struct lu_dirent *ent)
 int ll_dir_read(struct inode *inode, u64 *ppos, struct md_op_data *op_data,
 		struct dir_context *ctx)
 {
-	struct ll_sb_info    *sbi	= ll_i2sbi(inode);
-	u64		   pos		= *ppos;
+	struct ll_sb_info *sbi = ll_i2sbi(inode);
+	u64 pos = *ppos;
 	bool is_api32 = ll_need_32bit_api(sbi);
-	int		   is_hash64 = sbi->ll_flags & LL_SBI_64BIT_HASH;
-	struct page	  *page;
-	bool		   done = false;
-	int		   rc = 0;
+	int is_hash64 = sbi->ll_flags & LL_SBI_64BIT_HASH;
+	struct page *page;
+	bool done = false;
+	int rc = 0;
 
 	page = ll_get_dir_page(inode, op_data, pos);
 
@@ -225,11 +225,11 @@ int ll_dir_read(struct inode *inode, u64 *ppos, struct md_op_data *op_data,
 		dp = page_address(page);
 		for (ent = lu_dirent_start(dp); ent && !done;
 		     ent = lu_dirent_next(ent)) {
-			u16	  type;
-			int	    namelen;
-			struct lu_fid  fid;
-			u64	  lhash;
-			u64	  ino;
+			u16 type;
+			int namelen;
+			struct lu_fid fid;
+			u64 lhash;
+			u64 ino;
 
 			hash = le64_to_cpu(ent->lde_hash);
 			if (hash < pos)
@@ -291,14 +291,14 @@ int ll_dir_read(struct inode *inode, u64 *ppos, struct md_op_data *op_data,
 
 static int ll_readdir(struct file *filp, struct dir_context *ctx)
 {
-	struct inode		*inode	= file_inode(filp);
-	struct ll_file_data	*lfd	= LUSTRE_FPRIVATE(filp);
-	struct ll_sb_info	*sbi	= ll_i2sbi(inode);
+	struct inode *inode = file_inode(filp);
+	struct ll_file_data *lfd = LUSTRE_FPRIVATE(filp);
+	struct ll_sb_info *sbi	= ll_i2sbi(inode);
 	u64 pos = lfd ? lfd->lfd_pos : 0;
-	int			hash64	= sbi->ll_flags & LL_SBI_64BIT_HASH;
+	int hash64 = sbi->ll_flags & LL_SBI_64BIT_HASH;
 	bool api32 = ll_need_32bit_api(sbi);
 	struct md_op_data *op_data;
-	int			rc;
+	int rc;
 
 	CDEBUG(D_VFSTRACE,
 	       "VFS Op:inode=" DFID "(%p) pos/size %lu/%llu 32bit_api %d\n",
@@ -626,7 +626,7 @@ int ll_dir_getstripe(struct inode *inode, void **plmm, int *plmm_size,
 		     struct ptlrpc_request **request, u64 valid)
 {
 	struct ll_sb_info *sbi = ll_i2sbi(inode);
-	struct mdt_body   *body;
+	struct mdt_body *body;
 	struct lov_mds_md *lmm = NULL;
 	struct ptlrpc_request *req = NULL;
 	int rc, lmmsize;
@@ -744,8 +744,8 @@ int ll_get_mdt_idx(struct inode *inode)
  */
 static int ll_ioc_copy_start(struct super_block *sb, struct hsm_copy *copy)
 {
-	struct ll_sb_info		*sbi = ll_s2sbi(sb);
-	struct hsm_progress_kernel	 hpk;
+	struct ll_sb_info *sbi = ll_s2sbi(sb);
+	struct hsm_progress_kernel hpk;
 	int rc2, rc = 0;
 
 	/* Forge a hsm_progress based on data from copy. */
@@ -759,8 +759,8 @@ static int ll_ioc_copy_start(struct super_block *sb, struct hsm_copy *copy)
 
 	/* For archive request, we need to read the current file version. */
 	if (copy->hc_hai.hai_action == HSMA_ARCHIVE) {
-		struct inode	*inode;
-		u64		 data_version = 0;
+		struct inode *inode;
+		u64 data_version = 0;
 
 		/* Get inode for this fid */
 		inode = search_inode_for_lustre(sb, &copy->hc_hai.hai_fid);
@@ -819,8 +819,8 @@ static int ll_ioc_copy_start(struct super_block *sb, struct hsm_copy *copy)
  */
 static int ll_ioc_copy_end(struct super_block *sb, struct hsm_copy *copy)
 {
-	struct ll_sb_info		*sbi = ll_s2sbi(sb);
-	struct hsm_progress_kernel	 hpk;
+	struct ll_sb_info *sbi = ll_s2sbi(sb);
+	struct hsm_progress_kernel hpk;
 	int rc2, rc = 0;
 
 	/* If you modify the logic here, also check llapi_hsm_copy_end(). */
@@ -844,8 +844,8 @@ static int ll_ioc_copy_end(struct super_block *sb, struct hsm_copy *copy)
 	if (((copy->hc_hai.hai_action == HSMA_ARCHIVE) ||
 	     (copy->hc_hai.hai_action == HSMA_RESTORE)) &&
 	    (copy->hc_errval == 0)) {
-		struct inode	*inode;
-		u64		 data_version = 0;
+		struct inode *inode;
+		u64 data_version = 0;
 
 		/* Get lsm for this fid */
 		inode = search_inode_for_lustre(sb, &copy->hc_hai.hai_fid);
@@ -1160,13 +1160,13 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	}
 	case LL_IOC_LMV_SETSTRIPE: {
 		struct lmv_user_md  *lum;
-		char		*buf = NULL;
-		char		*filename;
-		int		 namelen = 0;
-		int		 lumlen = 0;
+		char *buf = NULL;
+		char *filename;
+		int namelen = 0;
+		int lumlen = 0;
 		umode_t mode;
-		int		 len;
-		int		 rc;
+		int len;
+		int rc;
 
 		rc = obd_ioctl_getdata(&buf, &len, (void __user *)arg);
 		if (rc)
@@ -1428,21 +1428,21 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 			struct lov_user_mds_data __user *lmdp;
 			lstat_t st = { 0 };
 
-			st.st_dev     = inode->i_sb->s_dev;
-			st.st_mode    = body->mbo_mode;
-			st.st_nlink   = body->mbo_nlink;
-			st.st_uid     = body->mbo_uid;
-			st.st_gid     = body->mbo_gid;
-			st.st_rdev    = body->mbo_rdev;
-			st.st_size    = body->mbo_size;
+			st.st_dev = inode->i_sb->s_dev;
+			st.st_mode = body->mbo_mode;
+			st.st_nlink = body->mbo_nlink;
+			st.st_uid = body->mbo_uid;
+			st.st_gid = body->mbo_gid;
+			st.st_rdev = body->mbo_rdev;
+			st.st_size = body->mbo_size;
 			st.st_blksize = PAGE_SIZE;
-			st.st_blocks  = body->mbo_blocks;
-			st.st_atime   = body->mbo_atime;
-			st.st_mtime   = body->mbo_mtime;
-			st.st_ctime   = body->mbo_ctime;
-			st.st_ino     = cl_fid_build_ino(&body->mbo_fid1,
-							 sbi->ll_flags &
-							 LL_SBI_32BIT_API);
+			st.st_blocks = body->mbo_blocks;
+			st.st_atime = body->mbo_atime;
+			st.st_mtime = body->mbo_mtime;
+			st.st_ctime = body->mbo_ctime;
+			st.st_ino = cl_fid_build_ino(&body->mbo_fid1,
+						     sbi->ll_flags &
+						     LL_SBI_32BIT_API);
 
 			lmdp = (struct lov_user_mds_data __user *)arg;
 			if (copy_to_user(&lmdp->lmd_st, &st, sizeof(st))) {
@@ -1538,7 +1538,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	}
 	case LL_IOC_HSM_REQUEST: {
 		struct hsm_user_request	*hur;
-		ssize_t			 totalsize;
+		ssize_t	totalsize;
 
 		hur = memdup_user((void __user *)arg, sizeof(*hur));
 		if (IS_ERR(hur))
@@ -1592,8 +1592,8 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		return rc;
 	}
 	case LL_IOC_HSM_PROGRESS: {
-		struct hsm_progress_kernel	hpk;
-		struct hsm_progress		hp;
+		struct hsm_progress_kernel hpk;
+		struct hsm_progress hp;
 
 		if (copy_from_user(&hp, (void __user *)arg, sizeof(hp)))
 			return -EFAULT;
@@ -1622,7 +1622,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
 	case LL_IOC_HSM_COPY_START: {
 		struct hsm_copy	*copy;
-		int		 rc;
+		int rc;
 
 		copy = memdup_user((char __user *)arg, sizeof(*copy));
 		if (IS_ERR(copy))
@@ -1637,7 +1637,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	}
 	case LL_IOC_HSM_COPY_END: {
 		struct hsm_copy	*copy;
-		int		 rc;
+		int rc;
 
 		copy = memdup_user((char __user *)arg, sizeof(*copy));
 		if (IS_ERR(copy))
@@ -1756,11 +1756,11 @@ static int ll_dir_release(struct inode *inode, struct file *file)
 }
 
 const struct file_operations ll_dir_operations = {
-	.llseek   = ll_dir_seek,
-	.open     = ll_dir_open,
-	.release  = ll_dir_release,
-	.read     = generic_read_dir,
-	.iterate_shared  = ll_readdir,
-	.unlocked_ioctl   = ll_dir_ioctl,
-	.fsync    = ll_fsync,
+	.llseek			= ll_dir_seek,
+	.open			= ll_dir_open,
+	.release		= ll_dir_release,
+	.read			= generic_read_dir,
+	.iterate_shared		= ll_readdir,
+	.unlocked_ioctl		= ll_dir_ioctl,
+	.fsync			= ll_fsync,
 };
drivers/staging/lustre/lustre/llite/file.c +90 -90

321 lines not on this page · raw message

drivers/staging/lustre/lustre/llite/glimpse.c +9 -9
index d8712a3..27c233d 100644
@@ -65,7 +65,7 @@ blkcnt_t dirty_cnt(struct inode *inode)
 {
 	blkcnt_t cnt = 0;
 	struct vvp_object *vob = cl_inode2vvp(inode);
-	void	      *results[1];
+	void *results[1];
 
 	if (inode->i_mapping)
 		cnt += radix_tree_gang_lookup_tag(&inode->i_mapping->i_pages,
@@ -80,7 +80,7 @@ blkcnt_t dirty_cnt(struct inode *inode)
 int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
 		    struct inode *inode, struct cl_object *clob, int agl)
 {
-	const struct lu_fid  *fid   = lu_object_fid(&clob->co_lu);
+	const struct lu_fid *fid = lu_object_fid(&clob->co_lu);
 	struct cl_lock *lock = vvp_env_lock(env);
 	struct cl_lock_descr *descr = &lock->cll_descr;
 	int result = 0;
@@ -140,10 +140,10 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
 static int cl_io_get(struct inode *inode, struct lu_env **envout,
 		     struct cl_io **ioout, u16 *refcheck)
 {
-	struct lu_env	  *env;
-	struct cl_io	   *io;
-	struct ll_inode_info	*lli = ll_i2info(inode);
-	struct cl_object       *clob = lli->lli_clob;
+	struct lu_env *env;
+	struct cl_io *io;
+	struct ll_inode_info *lli = ll_i2info(inode);
+	struct cl_object *clob = lli->lli_clob;
 	int result;
 
 	if (S_ISREG(inode->i_mode)) {
@@ -175,9 +175,9 @@ int __cl_glimpse_size(struct inode *inode, int agl)
 	 * cl_glimpse_size(), which doesn't make sense: glimpse locks are not
 	 * blocking anyway.
 	 */
-	struct lu_env	  *env = NULL;
-	struct cl_io	   *io  = NULL;
-	int		     result;
+	struct lu_env *env = NULL;
+	struct cl_io *io  = NULL;
+	int result;
 	u16 refcheck;
 
 	result = cl_io_get(inode, &env, &io, &refcheck);
drivers/staging/lustre/lustre/llite/lcommon_cl.c +12 -12
index ade3b12..afcaa5e 100644
@@ -83,8 +83,8 @@ int cl_setattr_ost(struct cl_object *obj, const struct iattr *attr,
 		   enum op_xvalid xvalid, unsigned int attr_flags)
 {
 	struct lu_env *env;
-	struct cl_io  *io;
-	int	    result;
+	struct cl_io *io;
+	int result;
 	u16 refcheck;
 
 	env = cl_env_get(&refcheck);
@@ -137,11 +137,11 @@ int cl_setattr_ost(struct cl_object *obj, const struct iattr *attr,
  */
 int cl_file_inode_init(struct inode *inode, struct lustre_md *md)
 {
-	struct lu_env	*env;
+	struct lu_env *env;
 	struct ll_inode_info *lli;
-	struct cl_object     *clob;
-	struct lu_site       *site;
-	struct lu_fid	*fid;
+	struct cl_object *clob;
+	struct lu_site *site;
+	struct lu_fid *fid;
 	struct cl_object_conf conf = {
 		.coc_inode = inode,
 		.u = {
@@ -159,8 +159,8 @@ int cl_file_inode_init(struct inode *inode, struct lustre_md *md)
 		return PTR_ERR(env);
 
 	site = ll_i2sbi(inode)->ll_site;
-	lli  = ll_i2info(inode);
-	fid  = &lli->lli_fid;
+	lli = ll_i2info(inode);
+	fid = &lli->lli_fid;
 	LASSERT(fid_is_sane(fid));
 
 	if (!lli->lli_clob) {
@@ -207,7 +207,7 @@ int cl_file_inode_init(struct inode *inode, struct lustre_md *md)
 static void cl_object_put_last(struct lu_env *env, struct cl_object *obj)
 {
 	struct lu_object_header *header = obj->co_lu.lo_header;
-	wait_queue_entry_t	   waiter;
+	wait_queue_entry_t waiter;
 
 	if (unlikely(atomic_read(&header->loh_ref) != 1)) {
 		struct lu_site *site = obj->co_lu.lo_dev->ld_site;
@@ -234,9 +234,9 @@ static void cl_object_put_last(struct lu_env *env, struct cl_object *obj)
 
 void cl_inode_fini(struct inode *inode)
 {
-	struct lu_env	   *env;
-	struct ll_inode_info    *lli  = ll_i2info(inode);
-	struct cl_object	*clob = lli->lli_clob;
+	struct lu_env *env;
+	struct ll_inode_info *lli = ll_i2info(inode);
+	struct cl_object *clob = lli->lli_clob;
 	u16 refcheck;
 	int emergency;
 
drivers/staging/lustre/lustre/llite/llite_lib.c +26 -26

90 lines not on this page · raw message

drivers/staging/lustre/lustre/llite/llite_mmap.c +26 -26

101 lines not on this page · raw message

drivers/staging/lustre/lustre/llite/llite_nfs.c +21 -21

78 lines not on this page · raw message

drivers/staging/lustre/lustre/llite/lproc_llite.c +40 -40

115 lines not on this page · raw message

drivers/staging/lustre/lustre/llite/namei.c +25 -24

75 lines not on this page · raw message

drivers/staging/lustre/lustre/llite/rw.c +1 -1
index e207d7c..af983ee 100644
@@ -309,7 +309,7 @@ static inline int stride_io_mode(struct ll_readahead_state *ras)
 static int ria_page_count(struct ra_io_arg *ria)
 {
 	u64 length = ria->ria_end >= ria->ria_start ?
-		       ria->ria_end - ria->ria_start + 1 : 0;
+		     ria->ria_end - ria->ria_start + 1 : 0;
 
 	return stride_pg_count(ria->ria_stoff, ria->ria_length,
 			       ria->ria_pages, ria->ria_start,
drivers/staging/lustre/lustre/llite/rw26.c +28 -29

105 lines not on this page · raw message

drivers/staging/lustre/lustre/llite/statahead.c +68 -65

270 lines not on this page · raw message

drivers/staging/lustre/lustre/llite/super25.c +8 -8
index 3ad0b11..c2b1668 100644
@@ -73,14 +73,14 @@ static void ll_destroy_inode(struct inode *inode)
 
 /* exported operations */
 struct super_operations lustre_super_operations = {
-	.alloc_inode   = ll_alloc_inode,
-	.destroy_inode = ll_destroy_inode,
-	.evict_inode   = ll_delete_inode,
-	.put_super     = ll_put_super,
-	.statfs	= ll_statfs,
-	.umount_begin  = ll_umount_begin,
-	.remount_fs    = ll_remount_fs,
-	.show_options  = ll_show_options,
+	.alloc_inode		= ll_alloc_inode,
+	.destroy_inode		= ll_destroy_inode,
+	.evict_inode		= ll_delete_inode,
+	.put_super		= ll_put_super,
+	.statfs			= ll_statfs,
+	.umount_begin		= ll_umount_begin,
+	.remount_fs		= ll_remount_fs,
+	.show_options		= ll_show_options,
 };
 
 /** This is the entry point for the mount call into Lustre.
drivers/staging/lustre/lustre/llite/vvp_dev.c +52 -52

223 lines not on this page · raw message

drivers/staging/lustre/lustre/llite/vvp_internal.h +28 -28

126 lines not on this page · raw message

drivers/staging/lustre/lustre/llite/vvp_io.c +84 -85

325 lines not on this page · raw message

drivers/staging/lustre/lustre/llite/vvp_object.c +15 -15
index 86e077b..1637972 100644
@@ -50,7 +50,7 @@
 
 int vvp_object_invariant(const struct cl_object *obj)
 {
-	struct inode *inode  = vvp_object_inode(obj);
+	struct inode *inode = vvp_object_inode(obj);
 	struct ll_inode_info *lli = ll_i2info(inode);
 
 	return (S_ISREG(inode->i_mode) || inode->i_mode == 0) &&
@@ -60,8 +60,8 @@ int vvp_object_invariant(const struct cl_object *obj)
 static int vvp_object_print(const struct lu_env *env, void *cookie,
 			    lu_printer_t p, const struct lu_object *o)
 {
-	struct vvp_object    *obj   = lu2vvp(o);
-	struct inode	 *inode = obj->vob_inode;
+	struct vvp_object *obj = lu2vvp(o);
+	struct inode *inode = obj->vob_inode;
 	struct ll_inode_info *lli;
 
 	(*p)(env, cookie, "(%d %d) inode: %p ",
@@ -209,13 +209,13 @@ static void vvp_req_attr_set(const struct lu_env *env, struct cl_object *obj,
 }
 
 static const struct cl_object_operations vvp_ops = {
-	.coo_page_init = vvp_page_init,
-	.coo_lock_init = vvp_lock_init,
-	.coo_io_init   = vvp_io_init,
-	.coo_attr_get  = vvp_attr_get,
-	.coo_attr_update = vvp_attr_update,
-	.coo_conf_set  = vvp_conf_set,
-	.coo_prune     = vvp_prune,
+	.coo_page_init		= vvp_page_init,
+	.coo_lock_init		= vvp_lock_init,
+	.coo_io_init		= vvp_io_init,
+	.coo_attr_get		= vvp_attr_get,
+	.coo_attr_update	= vvp_attr_update,
+	.coo_conf_set		= vvp_conf_set,
+	.coo_prune		= vvp_prune,
 	.coo_glimpse		= vvp_object_glimpse,
 	.coo_req_attr_set	= vvp_req_attr_set
 };
@@ -235,8 +235,8 @@ static int vvp_object_init(const struct lu_env *env, struct lu_object *obj,
 {
 	struct vvp_device *dev = lu2vvp_dev(obj->lo_dev);
 	struct vvp_object *vob = lu2vvp(obj);
-	struct lu_object  *below;
-	struct lu_device  *under;
+	struct lu_object *below;
+	struct lu_device *under;
 	int result;
 
 	under = &dev->vdv_next->cd_lu_dev;
@@ -272,8 +272,8 @@ static void vvp_object_free(const struct lu_env *env, struct lu_object *obj)
 struct vvp_object *cl_inode2vvp(struct inode *inode)
 {
 	struct ll_inode_info *lli = ll_i2info(inode);
-	struct cl_object     *obj = lli->lli_clob;
-	struct lu_object     *lu;
+	struct cl_object *obj = lli->lli_clob;
+	struct lu_object *lu;
 
 	lu = lu_object_locate(obj->co_lu.lo_header, &vvp_device_type);
 	LASSERT(lu);
@@ -285,7 +285,7 @@ struct lu_object *vvp_object_alloc(const struct lu_env *env,
 				   struct lu_device *dev)
 {
 	struct vvp_object *vob;
-	struct lu_object  *obj;
+	struct lu_object *obj;
 
 	vob = kmem_cache_zalloc(vvp_object_kmem, GFP_NOFS);
 	if (vob) {
drivers/staging/lustre/lustre/llite/vvp_page.c +44 -44

167 lines not on this page · raw message

drivers/staging/lustre/lustre/llite/xattr.c +24 -24

69 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#12 lore raw

PATCH 12/26 lmv: cleanup white spaces

In reply to James Simmons

The lmv code is very messy and difficult to read. Remove excess white space and properly align data structures so they are easy on the eyes.

---
 drivers/staging/lustre/lustre/lmv/lmv_intent.c |  38 +--
 drivers/staging/lustre/lustre/lmv/lmv_obd.c    | 334 ++++++++++++-------------
 drivers/staging/lustre/lustre/lmv/lproc_lmv.c  |  24 +-
 3 files changed, 198 insertions(+), 198 deletions(-)
drivers/staging/lustre/lustre/lmv/lmv_intent.c +19 -19
index bc364b6..8892426 100644
@@ -54,15 +54,15 @@ static int lmv_intent_remote(struct obd_export *exp, struct lookup_intent *it,
 			     ldlm_blocking_callback cb_blocking,
 			     u64 extra_lock_flags)
 {
-	struct obd_device	*obd = exp->exp_obd;
-	struct lmv_obd		*lmv = &obd->u.lmv;
-	struct ptlrpc_request	*req = NULL;
-	struct lustre_handle	plock;
-	struct md_op_data	*op_data;
-	struct lmv_tgt_desc	*tgt;
-	struct mdt_body		*body;
-	int			pmode;
-	int			rc = 0;
+	struct obd_device *obd = exp->exp_obd;
+	struct lmv_obd *lmv = &obd->u.lmv;
+	struct ptlrpc_request *req = NULL;
+	struct lustre_handle plock;
+	struct md_op_data *op_data;
+	struct lmv_tgt_desc *tgt;
+	struct mdt_body	*body;
+	int pmode;
+	int rc = 0;
 
 	body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY);
 	if (!body)
@@ -264,11 +264,11 @@ static int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data,
 			   ldlm_blocking_callback cb_blocking,
 			   u64 extra_lock_flags)
 {
-	struct obd_device	*obd = exp->exp_obd;
-	struct lmv_obd		*lmv = &obd->u.lmv;
-	struct lmv_tgt_desc	*tgt;
-	struct mdt_body		*body;
-	int			rc;
+	struct obd_device *obd = exp->exp_obd;
+	struct lmv_obd *lmv = &obd->u.lmv;
+	struct lmv_tgt_desc *tgt;
+	struct mdt_body	*body;
+	int rc;
 
 	if (it->it_flags & MDS_OPEN_BY_FID) {
 		LASSERT(fid_is_sane(&op_data->op_fid2));
@@ -356,11 +356,11 @@ static int lmv_intent_lookup(struct obd_export *exp,
 			     u64 extra_lock_flags)
 {
 	struct lmv_stripe_md *lsm = op_data->op_mea1;
-	struct obd_device      *obd = exp->exp_obd;
-	struct lmv_obd	 *lmv = &obd->u.lmv;
-	struct lmv_tgt_desc    *tgt = NULL;
+	struct obd_device *obd = exp->exp_obd;
+	struct lmv_obd *lmv = &obd->u.lmv;
+	struct lmv_tgt_desc *tgt = NULL;
 	struct mdt_body	*body;
-	int		     rc = 0;
+	int rc = 0;
 
 	/*
 	 * If it returns ERR_PTR(-EBADFD) then it is an unknown hash type
@@ -477,7 +477,7 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
 		    ldlm_blocking_callback cb_blocking,
 		    u64 extra_lock_flags)
 {
-	int		rc;
+	int rc;
 
 	LASSERT(fid_is_sane(&op_data->op_fid1));
 
drivers/staging/lustre/lustre/lmv/lmv_obd.c +167 -167

669 lines not on this page · raw message

drivers/staging/lustre/lustre/lmv/lproc_lmv.c +12 -12
index 4e30026..e40473c 100644
@@ -78,8 +78,8 @@ static ssize_t desc_uuid_show(struct kobject *kobj, struct attribute *attr,
 
 static void *lmv_tgt_seq_start(struct seq_file *p, loff_t *pos)
 {
-	struct obd_device       *dev = p->private;
-	struct lmv_obd	  *lmv = &dev->u.lmv;
+	struct obd_device *dev = p->private;
+	struct lmv_obd *lmv = &dev->u.lmv;
 
 	while (*pos < lmv->tgts_size) {
 		if (lmv->tgts[*pos])
@@ -96,8 +96,8 @@ static void lmv_tgt_seq_stop(struct seq_file *p, void *v)
 
 static void *lmv_tgt_seq_next(struct seq_file *p, void *v, loff_t *pos)
 {
-	struct obd_device       *dev = p->private;
-	struct lmv_obd	  *lmv = &dev->u.lmv;
+	struct obd_device *dev = p->private;
+	struct lmv_obd *lmv = &dev->u.lmv;
 
 	++*pos;
 	while (*pos < lmv->tgts_size) {
@@ -106,12 +106,12 @@ static void *lmv_tgt_seq_next(struct seq_file *p, void *v, loff_t *pos)
 		++*pos;
 	}
 
-	return  NULL;
+	return NULL;
 }
 
 static int lmv_tgt_seq_show(struct seq_file *p, void *v)
 {
-	struct lmv_tgt_desc     *tgt = v;
+	struct lmv_tgt_desc *tgt = v;
 
 	if (!tgt)
 		return 0;
@@ -123,16 +123,16 @@ static int lmv_tgt_seq_show(struct seq_file *p, void *v)
 }
 
 static const struct seq_operations lmv_tgt_sops = {
-	.start		 = lmv_tgt_seq_start,
-	.stop		  = lmv_tgt_seq_stop,
-	.next		  = lmv_tgt_seq_next,
-	.show		  = lmv_tgt_seq_show,
+	.start		= lmv_tgt_seq_start,
+	.stop		= lmv_tgt_seq_stop,
+	.next		= lmv_tgt_seq_next,
+	.show		= lmv_tgt_seq_show,
 };
 
 static int lmv_target_seq_open(struct inode *inode, struct file *file)
 {
-	struct seq_file	 *seq;
-	int		     rc;
+	struct seq_file *seq;
+	int rc;
 
 	rc = seq_open(file, &lmv_tgt_sops);
 	if (rc)
Signature · 1 line
1.8.3.1
#13 lore raw

PATCH 13/26 lov: cleanup white spaces

In reply to James Simmons

The lov code is very messy and difficult to read. Remove excess white space and properly align data structures so they are easy on the eyes.

---
 .../staging/lustre/lustre/lov/lov_cl_internal.h    |  50 +++----
 drivers/staging/lustre/lustre/lov/lov_dev.c        |  62 ++++-----
 drivers/staging/lustre/lustre/lov/lov_internal.h   |  56 ++++----
 drivers/staging/lustre/lustre/lov/lov_io.c         | 136 +++++++++---------
 drivers/staging/lustre/lustre/lov/lov_lock.c       |  34 ++---
 drivers/staging/lustre/lustre/lov/lov_obd.c        |  21 ++-
 drivers/staging/lustre/lustre/lov/lov_object.c     | 154 ++++++++++-----------
 drivers/staging/lustre/lustre/lov/lov_offset.c     |   6 +-
 drivers/staging/lustre/lustre/lov/lov_pack.c       |   4 +-
 drivers/staging/lustre/lustre/lov/lov_page.c       |  18 +--
 drivers/staging/lustre/lustre/lov/lov_pool.c       |  20 +--
 drivers/staging/lustre/lustre/lov/lov_request.c    |  12 +-
 drivers/staging/lustre/lustre/lov/lovsub_dev.c     |  32 ++---
 drivers/staging/lustre/lustre/lov/lovsub_lock.c    |   4 +-
 drivers/staging/lustre/lustre/lov/lovsub_object.c  |  29 ++--
 drivers/staging/lustre/lustre/lov/lovsub_page.c    |   2 +-
 drivers/staging/lustre/lustre/lov/lproc_lov.c      |  18 +--
 17 files changed, 328 insertions(+), 330 deletions(-)
drivers/staging/lustre/lustre/lov/lov_cl_internal.h +25 -25
index d83b8de..22ef7b2 100644
@@ -95,12 +95,12 @@ struct lov_device {
 	/*
 	 * XXX Locking of lov-private data is missing.
 	 */
-	struct cl_device	  ld_cl;
-	struct lov_obd	   *ld_lov;
+	struct cl_device	ld_cl;
+	struct lov_obd	       *ld_lov;
 	/** size of lov_device::ld_target[] array */
-	u32		     ld_target_nr;
-	struct lovsub_device    **ld_target;
-	u32		     ld_flags;
+	u32			ld_target_nr;
+	struct lovsub_device  **ld_target;
+	u32			ld_flags;
 };
 
 /**
@@ -180,7 +180,7 @@ struct lov_layout_raid0 {
  * function corresponding to the current layout type.
  */
 struct lov_object {
-	struct cl_object       lo_cl;
+	struct cl_object	lo_cl;
 	/**
 	 * Serializes object operations with transitions between layout types.
 	 *
@@ -203,15 +203,15 @@ struct lov_object {
 	 * How many IOs are on going on this object. Layout can be changed
 	 * only if there is no active IO.
 	 */
-	atomic_t	       lo_active_ios;
+	atomic_t		lo_active_ios;
 	/**
 	 * Waitq - wait for no one else is using lo_lsm
 	 */
-	wait_queue_head_t	       lo_waitq;
+	wait_queue_head_t	lo_waitq;
 	/**
 	 * Layout metadata. NULL if empty layout.
 	 */
-	struct lov_stripe_md  *lo_lsm;
+	struct lov_stripe_md	*lo_lsm;
 
 	union lov_layout_state {
 		struct lov_layout_state_empty {
@@ -259,9 +259,9 @@ struct lov_lock_sub {
  * lov-specific lock state.
  */
 struct lov_lock {
-	struct cl_lock_slice   lls_cl;
+	struct cl_lock_slice	lls_cl;
 	/** Number of sub-locks in this lock */
-	int		    lls_nr;
+	int			lls_nr;
 	/** sublock array */
 	struct lov_lock_sub     lls_sub[0];
 };
@@ -277,43 +277,43 @@ struct lov_page {
  */
 
 struct lovsub_device {
-	struct cl_device   acid_cl;
-	struct cl_device  *acid_next;
+	struct cl_device	acid_cl;
+	struct cl_device       *acid_next;
 };
 
 struct lovsub_object {
 	struct cl_object_header lso_header;
 	struct cl_object	lso_cl;
 	struct lov_object      *lso_super;
-	int		     lso_index;
+	int			lso_index;
 };
 
 /**
  * Lock state at lovsub layer.
  */
 struct lovsub_lock {
-	struct cl_lock_slice  lss_cl;
+	struct cl_lock_slice	lss_cl;
 };
 
 /**
  * Describe the environment settings for sublocks.
  */
 struct lov_sublock_env {
-	const struct lu_env *lse_env;
-	struct cl_io	*lse_io;
+	const struct lu_env	*lse_env;
+	struct cl_io		*lse_io;
 };
 
 struct lovsub_page {
-	struct cl_page_slice lsb_cl;
+	struct cl_page_slice	lsb_cl;
 };
 
 struct lov_thread_info {
 	struct cl_object_conf   lti_stripe_conf;
-	struct lu_fid	   lti_fid;
-	struct ost_lvb	  lti_lvb;
+	struct lu_fid		lti_fid;
+	struct ost_lvb		lti_lvb;
 	struct cl_2queue	lti_cl2q;
 	struct cl_page_list     lti_plist;
-	wait_queue_entry_t	  lti_waiter;
+	wait_queue_entry_t	lti_waiter;
 };
 
 /**
@@ -354,12 +354,12 @@ struct lov_io_sub {
  */
 struct lov_io {
 	/** super-class */
-	struct cl_io_slice lis_cl;
+	struct cl_io_slice	lis_cl;
 	/**
 	 * Pointer to the object slice. This is a duplicate of
 	 * lov_io::lis_cl::cis_object.
 	 */
-	struct lov_object *lis_object;
+	struct lov_object	*lis_object;
 	/**
 	 * Original end-of-io position for this IO, set by the upper layer as
 	 * cl_io::u::ci_rw::pos + cl_io::u::ci_rw::count. lov remembers this,
@@ -401,8 +401,8 @@ struct lov_io {
 };
 
 struct lov_session {
-	struct lov_io	  ls_io;
-	struct lov_sublock_env ls_subenv;
+	struct lov_io		ls_io;
+	struct lov_sublock_env	ls_subenv;
 };
 
 extern struct lu_device_type lov_device_type;
drivers/staging/lustre/lustre/lov/lov_dev.c +31 -31

129 lines not on this page · raw message

drivers/staging/lustre/lustre/lov/lov_internal.h +28 -28

78 lines not on this page · raw message

drivers/staging/lustre/lustre/lov/lov_io.c +68 -68

218 lines not on this page · raw message

drivers/staging/lustre/lustre/lov/lov_lock.c +17 -17
index 9a46424..039c902 100644
@@ -54,9 +54,9 @@ static struct lov_sublock_env *lov_sublock_env_get(const struct lu_env *env,
 						   struct lov_lock_sub *lls)
 {
 	struct lov_sublock_env *subenv;
-	struct lov_io	  *lio    = lov_env_io(env);
-	struct cl_io	   *io     = lio->lis_cl.cis_io;
-	struct lov_io_sub      *sub;
+	struct lov_io *lio = lov_env_io(env);
+	struct cl_io *io = lio->lis_cl.cis_io;
+	struct lov_io_sub *sub;
 
 	subenv = &lov_env_session(env)->ls_subenv;
 
@@ -71,7 +71,7 @@ static struct lov_sublock_env *lov_sublock_env_get(const struct lu_env *env,
 	 */
 	if (!io || !cl_object_same(io->ci_obj, parent->cll_descr.cld_obj)) {
 		subenv->lse_env = env;
-		subenv->lse_io  = io;
+		subenv->lse_io = io;
 	} else {
 		sub = lov_sub_get(env, lio, lls->sub_index);
 		if (!IS_ERR(sub)) {
@@ -154,7 +154,7 @@ static struct lov_lock *lov_lock_sub_init(const struct lu_env *env,
 	 */
 
 	lovlck = kvzalloc(offsetof(struct lov_lock, lls_sub[nr]),
-				 GFP_NOFS);
+			  GFP_NOFS);
 	if (!lovlck)
 		return ERR_PTR(-ENOMEM);
 
@@ -178,11 +178,11 @@ static struct lov_lock *lov_lock_sub_init(const struct lu_env *env,
 				continue;
 
 			LASSERT(!descr->cld_obj);
-			descr->cld_obj   = lovsub2cl(r0->lo_sub[i]);
+			descr->cld_obj = lovsub2cl(r0->lo_sub[i]);
 			descr->cld_start = cl_index(descr->cld_obj, start);
-			descr->cld_end   = cl_index(descr->cld_obj, end);
-			descr->cld_mode  = lock->cll_descr.cld_mode;
-			descr->cld_gid   = lock->cll_descr.cld_gid;
+			descr->cld_end = cl_index(descr->cld_obj, end);
+			descr->cld_mode = lock->cll_descr.cld_mode;
+			descr->cld_gid = lock->cll_descr.cld_gid;
 			descr->cld_enq_flags = lock->cll_descr.cld_enq_flags;
 
 			lls->sub_index = lov_comp_index(index, i);
@@ -244,7 +244,7 @@ static int lov_lock_enqueue(const struct lu_env *env,
 	int rc = 0;
 
 	for (i = 0; i < lovlck->lls_nr; ++i) {
-		struct lov_lock_sub  *lls = &lovlck->lls_sub[i];
+		struct lov_lock_sub *lls = &lovlck->lls_sub[i];
 		struct lov_sublock_env *subenv;
 
 		subenv = lov_sublock_env_get(env, lock, lls);
@@ -293,7 +293,7 @@ static int lov_lock_print(const struct lu_env *env, void *cookie,
 			  lu_printer_t p, const struct cl_lock_slice *slice)
 {
 	struct lov_lock *lck = cl2lov_lock(slice);
-	int	      i;
+	int i;
 
 	(*p)(env, cookie, "%d\n", lck->lls_nr);
 	for (i = 0; i < lck->lls_nr; ++i) {
@@ -307,10 +307,10 @@ static int lov_lock_print(const struct lu_env *env, void *cookie,
 }
 
 static const struct cl_lock_operations lov_lock_ops = {
-	.clo_fini      = lov_lock_fini,
-	.clo_enqueue   = lov_lock_enqueue,
-	.clo_cancel    = lov_lock_cancel,
-	.clo_print     = lov_lock_print
+	.clo_fini	= lov_lock_fini,
+	.clo_enqueue	= lov_lock_enqueue,
+	.clo_cancel	= lov_lock_cancel,
+	.clo_print	= lov_lock_print
 };
 
 int lov_lock_init_composite(const struct lu_env *env, struct cl_object *obj,
@@ -345,8 +345,8 @@ static int lov_empty_lock_print(const struct lu_env *env, void *cookie,
 
 /* XXX: more methods will be added later. */
 static const struct cl_lock_operations lov_empty_lock_ops = {
-	.clo_fini  = lov_empty_lock_fini,
-	.clo_print = lov_empty_lock_print
+	.clo_fini	= lov_empty_lock_fini,
+	.clo_print	= lov_empty_lock_print
 };
 
 int lov_lock_init_empty(const struct lu_env *env, struct cl_object *obj,
drivers/staging/lustre/lustre/lov/lov_obd.c +10 -11
index 109dd69..04d0a9e 100644
@@ -425,7 +425,7 @@ static int lov_set_osc_active(struct obd_device *obd, struct obd_uuid *uuid,
 		CERROR("Unknown event(%d) for uuid %s", ev, uuid->uuid);
 	}
 
- out:
+out:
 	lov_tgts_putref(obd);
 	return index;
 }
@@ -925,7 +925,7 @@ int lov_process_config_base(struct obd_device *obd, struct lustre_cfg *lcfg,
 static int lov_statfs_async(struct obd_export *exp, struct obd_info *oinfo,
 			    u64 max_age, struct ptlrpc_request_set *rqset)
 {
-	struct obd_device      *obd = class_exp2obd(exp);
+	struct obd_device *obd = class_exp2obd(exp);
 	struct lov_request_set *set;
 	struct lov_request *req;
 	struct lov_obd *lov;
@@ -997,7 +997,7 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
 	case IOC_OBD_STATFS: {
 		struct obd_ioctl_data *data = karg;
 		struct obd_device *osc_obd;
-		struct obd_statfs stat_buf = {0};
+		struct obd_statfs stat_buf = { 0 };
 		u32 index;
 		u32 flags;
 
@@ -1281,11 +1281,11 @@ void lov_stripe_unlock(struct lov_stripe_md *md)
 static int lov_quotactl(struct obd_device *obd, struct obd_export *exp,
 			struct obd_quotactl *oqctl)
 {
-	struct lov_obd      *lov = &obd->u.lov;
+	struct lov_obd *lov = &obd->u.lov;
 	struct lov_tgt_desc *tgt;
-	u64		curspace = 0;
-	u64		bhardlimit = 0;
-	int		  i, rc = 0;
+	u64 curspace = 0;
+	u64 bhardlimit = 0;
+	int i, rc = 0;
 
 	if (oqctl->qc_cmd != Q_GETOQUOTA &&
 	    oqctl->qc_cmd != LUSTRE_Q_SETQUOTA) {
@@ -1336,10 +1336,9 @@ static int lov_quotactl(struct obd_device *obd, struct obd_export *exp,
 }
 
 static struct obd_ops lov_obd_ops = {
-	.owner          = THIS_MODULE,
-	.setup          = lov_setup,
-	.cleanup        = lov_cleanup,
-	/*.process_config       = lov_process_config,*/
+	.owner		= THIS_MODULE,
+	.setup		= lov_setup,
+	.cleanup	= lov_cleanup,
 	.connect        = lov_connect,
 	.disconnect     = lov_disconnect,
 	.statfs         = lov_statfs,
drivers/staging/lustre/lustre/lov/lov_object.c +77 -77

238 lines not on this page · raw message

drivers/staging/lustre/lustre/lov/lov_offset.c +3 -3
index ab02c34..26f5066 100644
@@ -135,7 +135,7 @@ pgoff_t lov_stripe_pgoff(struct lov_stripe_md *lsm, int index,
 int lov_stripe_offset(struct lov_stripe_md *lsm, int index, u64 lov_off,
 		      int stripeno, u64 *obdoff)
 {
-	unsigned long ssize  = lsm->lsm_entries[index]->lsme_stripe_size;
+	unsigned long ssize = lsm->lsm_entries[index]->lsme_stripe_size;
 	u64 stripe_off, this_stripe, swidth;
 	int ret = 0;
 
@@ -188,7 +188,7 @@ int lov_stripe_offset(struct lov_stripe_md *lsm, int index, u64 lov_off,
 u64 lov_size_to_stripe(struct lov_stripe_md *lsm, int index, u64 file_size,
 		       int stripeno)
 {
-	unsigned long ssize  = lsm->lsm_entries[index]->lsme_stripe_size;
+	unsigned long ssize = lsm->lsm_entries[index]->lsme_stripe_size;
 	u64 stripe_off, this_stripe, swidth;
 
 	if (file_size == OBD_OBJECT_EOF)
@@ -270,7 +270,7 @@ int lov_stripe_intersects(struct lov_stripe_md *lsm, int index, int stripeno,
 /* compute which stripe number "lov_off" will be written into */
 int lov_stripe_number(struct lov_stripe_md *lsm, int index, u64 lov_off)
 {
-	unsigned long ssize  = lsm->lsm_entries[index]->lsme_stripe_size;
+	unsigned long ssize = lsm->lsm_entries[index]->lsme_stripe_size;
 	u64 stripe_off, swidth;
 
 	swidth = stripe_width(lsm, index);
drivers/staging/lustre/lustre/lov/lov_pack.c +2 -2
index fde5160..18ce9f9 100644
@@ -52,7 +52,7 @@
 void lov_dump_lmm_common(int level, void *lmmp)
 {
 	struct lov_mds_md *lmm = lmmp;
-	struct ost_id	oi;
+	struct ost_id oi;
 
 	lmm_oi_le_to_cpu(&oi, &lmm->lmm_oi);
 	CDEBUG(level, "objid " DOSTID ", magic 0x%08x, pattern %#x\n",
@@ -76,7 +76,7 @@ static void lov_dump_lmm_objects(int level, struct lov_ost_data *lod,
 	}
 
 	for (i = 0; i < stripe_count; ++i, ++lod) {
-		struct ost_id	oi;
+		struct ost_id oi;
 
 		ostid_le_to_cpu(&lod->l_ost_oi, &oi);
 		CDEBUG(level, "stripe %u idx %u subobj " DOSTID "\n", i,
drivers/staging/lustre/lustre/lov/lov_page.c +9 -9
index 90e2981..08485a9 100644
@@ -62,24 +62,24 @@ static int lov_comp_page_print(const struct lu_env *env,
 }
 
 static const struct cl_page_operations lov_comp_page_ops = {
-	.cpo_print  = lov_comp_page_print
+	.cpo_print	= lov_comp_page_print
 };
 
 int lov_page_init_composite(const struct lu_env *env, struct cl_object *obj,
 			    struct cl_page *page, pgoff_t index)
 {
 	struct lov_object *loo = cl2lov(obj);
-	struct lov_io     *lio = lov_env_io(env);
+	struct lov_io *lio = lov_env_io(env);
 	struct lov_layout_raid0 *r0;
-	struct cl_object  *subobj;
-	struct cl_object  *o;
+	struct cl_object *subobj;
+	struct cl_object *o;
 	struct lov_io_sub *sub;
-	struct lov_page   *lpg = cl_object_page_slice(obj, page);
+	struct lov_page *lpg = cl_object_page_slice(obj, page);
 	u64 offset;
-	u64	    suboff;
-	int		stripe;
+	u64 suboff;
+	int stripe;
 	int entry;
-	int		rc;
+	int rc;
 
 	offset = cl_offset(obj, index);
 	entry = lov_lsm_entry(loo->lo_lsm, offset);
@@ -127,7 +127,7 @@ static int lov_empty_page_print(const struct lu_env *env,
 }
 
 static const struct cl_page_operations lov_empty_page_ops = {
-	.cpo_print = lov_empty_page_print
+	.cpo_print	= lov_empty_page_print
 };
 
 int lov_page_init_empty(const struct lu_env *env, struct cl_object *obj,
drivers/staging/lustre/lustre/lov/lov_pool.c +10 -10
index 177f5a5..833fac9 100644
@@ -96,9 +96,9 @@ void lov_pool_putref(struct pool_desc *pool)
  */
 #define POOL_IT_MAGIC 0xB001CEA0
 struct pool_iterator {
-	int magic;
-	struct pool_desc *pool;
-	int idx;	/* from 0 to pool_tgt_size - 1 */
+	int			magic;
+	struct pool_desc	*pool;
+	int			idx;	/* from 0 to pool_tgt_size - 1 */
 };
 
 static void *pool_proc_next(struct seq_file *s, void *v, loff_t *pos)
@@ -204,10 +204,10 @@ static int pool_proc_show(struct seq_file *s, void *v)
 }
 
 static const struct seq_operations pool_proc_ops = {
-	.start	  = pool_proc_start,
-	.next	   = pool_proc_next,
-	.stop	   = pool_proc_stop,
-	.show	   = pool_proc_show,
+	.start		= pool_proc_start,
+	.next		= pool_proc_next,
+	.stop		= pool_proc_stop,
+	.show		= pool_proc_show,
 };
 
 static int pool_proc_open(struct inode *inode, struct file *file)
@@ -224,9 +224,9 @@ static int pool_proc_open(struct inode *inode, struct file *file)
 }
 
 static const struct file_operations pool_proc_operations = {
-	.open	   = pool_proc_open,
-	.read	   = seq_read,
-	.llseek	 = seq_lseek,
+	.open		= pool_proc_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
 	.release	= seq_release,
 };
 
drivers/staging/lustre/lustre/lov/lov_request.c +6 -6
index 45dca36..7f591ba 100644
@@ -137,12 +137,12 @@ static int lov_check_and_wait_active(struct lov_obd *lov, int ost_idx)
 }
 
 #define LOV_U64_MAX ((u64)~0ULL)
-#define LOV_SUM_MAX(tot, add)					   \
-	do {							    \
-		if ((tot) + (add) < (tot))			      \
-			(tot) = LOV_U64_MAX;			    \
-		else						    \
-			(tot) += (add);				 \
+#define LOV_SUM_MAX(tot, add)			\
+	do {					\
+		if ((tot) + (add) < (tot))	\
+			(tot) = LOV_U64_MAX;	\
+		else				\
+			(tot) += (add);		\
 	} while (0)
 
 static int lov_fini_statfs(struct obd_device *obd, struct obd_statfs *osfs,
drivers/staging/lustre/lustre/lov/lovsub_dev.c +16 -16
index 7e89a2e..69380fc 100644
@@ -52,7 +52,7 @@
 static int lovsub_device_init(const struct lu_env *env, struct lu_device *d,
 			      const char *name, struct lu_device *next)
 {
-	struct lovsub_device  *lsd = lu2lovsub_dev(d);
+	struct lovsub_device *lsd = lu2lovsub_dev(d);
 	struct lu_device_type *ldt;
 	int rc;
 
@@ -85,8 +85,8 @@ static struct lu_device *lovsub_device_fini(const struct lu_env *env,
 static struct lu_device *lovsub_device_free(const struct lu_env *env,
 					    struct lu_device *d)
 {
-	struct lovsub_device *lsd  = lu2lovsub_dev(d);
-	struct lu_device     *next = cl2lu_dev(lsd->acid_next);
+	struct lovsub_device *lsd = lu2lovsub_dev(d);
+	struct lu_device *next = cl2lu_dev(lsd->acid_next);
 
 	if (atomic_read(&d->ld_ref) && d->ld_site) {
 		LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_ERROR, NULL);
@@ -98,16 +98,16 @@ static struct lu_device *lovsub_device_free(const struct lu_env *env,
 }
 
 static const struct lu_device_operations lovsub_lu_ops = {
-	.ldo_object_alloc      = lovsub_object_alloc,
-	.ldo_process_config    = NULL,
-	.ldo_recovery_complete = NULL
+	.ldo_object_alloc		= lovsub_object_alloc,
+	.ldo_process_config		= NULL,
+	.ldo_recovery_complete		= NULL
 };
 
 static struct lu_device *lovsub_device_alloc(const struct lu_env *env,
 					     struct lu_device_type *t,
 					     struct lustre_cfg *cfg)
 {
-	struct lu_device     *d;
+	struct lu_device *d;
 	struct lovsub_device *lsd;
 
 	lsd = kzalloc(sizeof(*lsd), GFP_NOFS);
@@ -117,7 +117,7 @@ static struct lu_device *lovsub_device_alloc(const struct lu_env *env,
 		result = cl_device_init(&lsd->acid_cl, t);
 		if (result == 0) {
 			d = lovsub2lu_dev(lsd);
-			d->ld_ops	 = &lovsub_lu_ops;
+			d->ld_ops = &lovsub_lu_ops;
 		} else {
 			d = ERR_PTR(result);
 		}
@@ -128,20 +128,20 @@ static struct lu_device *lovsub_device_alloc(const struct lu_env *env,
 }
 
 static const struct lu_device_type_operations lovsub_device_type_ops = {
-	.ldto_device_alloc = lovsub_device_alloc,
-	.ldto_device_free  = lovsub_device_free,
+	.ldto_device_alloc	= lovsub_device_alloc,
+	.ldto_device_free	= lovsub_device_free,
 
-	.ldto_device_init    = lovsub_device_init,
-	.ldto_device_fini    = lovsub_device_fini
+	.ldto_device_init	= lovsub_device_init,
+	.ldto_device_fini	= lovsub_device_fini
 };
 
 #define LUSTRE_LOVSUB_NAME	 "lovsub"
 
 struct lu_device_type lovsub_device_type = {
-	.ldt_tags     = LU_DEVICE_CL,
-	.ldt_name     = LUSTRE_LOVSUB_NAME,
-	.ldt_ops      = &lovsub_device_type_ops,
-	.ldt_ctx_tags = LCT_CL_THREAD
+	.ldt_tags		= LU_DEVICE_CL,
+	.ldt_name		= LUSTRE_LOVSUB_NAME,
+	.ldt_ops		= &lovsub_device_type_ops,
+	.ldt_ctx_tags		= LCT_CL_THREAD
 };
 
 /** @} lov */
drivers/staging/lustre/lustre/lov/lovsub_lock.c +2 -2
index ea492be..7b67c92 100644
@@ -52,14 +52,14 @@
 static void lovsub_lock_fini(const struct lu_env *env,
 			     struct cl_lock_slice *slice)
 {
-	struct lovsub_lock   *lsl;
+	struct lovsub_lock *lsl;
 
 	lsl = cl2lovsub_lock(slice);
 	kmem_cache_free(lovsub_lock_kmem, lsl);
 }
 
 static const struct cl_lock_operations lovsub_lock_ops = {
-	.clo_fini    = lovsub_lock_fini,
+	.clo_fini	= lovsub_lock_fini,
 };
 
 int lovsub_lock_init(const struct lu_env *env, struct cl_object *obj,
drivers/staging/lustre/lustre/lov/lovsub_object.c +14 -15
index da4b7f1..6ba09f1 100644
@@ -52,10 +52,9 @@
 int lovsub_object_init(const struct lu_env *env, struct lu_object *obj,
 		       const struct lu_object_conf *conf)
 {
-	struct lovsub_device  *dev   = lu2lovsub_dev(obj->lo_dev);
-	struct lu_object      *below;
-	struct lu_device      *under;
-
+	struct lovsub_device *dev = lu2lovsub_dev(obj->lo_dev);
+	struct lu_object *below;
+	struct lu_device *under;
 	int result;
 
 	under = &dev->acid_next->cd_lu_dev;
@@ -73,7 +72,7 @@ int lovsub_object_init(const struct lu_env *env, struct lu_object *obj,
 static void lovsub_object_free(const struct lu_env *env, struct lu_object *obj)
 {
 	struct lovsub_object *los = lu2lovsub(obj);
-	struct lov_object    *lov = los->lso_super;
+	struct lov_object *lov = los->lso_super;
 
 	/* We can't assume lov was assigned here, because of the shadow
 	 * object handling in lu_object_find.
@@ -146,20 +145,20 @@ static void lovsub_req_attr_set(const struct lu_env *env, struct cl_object *obj,
 }
 
 static const struct cl_object_operations lovsub_ops = {
-	.coo_page_init = lovsub_page_init,
-	.coo_lock_init = lovsub_lock_init,
-	.coo_attr_update = lovsub_attr_update,
+	.coo_page_init		= lovsub_page_init,
+	.coo_lock_init		= lovsub_lock_init,
+	.coo_attr_update	= lovsub_attr_update,
 	.coo_glimpse		= lovsub_object_glimpse,
 	.coo_req_attr_set	= lovsub_req_attr_set
 };
 
 static const struct lu_object_operations lovsub_lu_obj_ops = {
-	.loo_object_init      = lovsub_object_init,
-	.loo_object_delete    = NULL,
-	.loo_object_release   = NULL,
-	.loo_object_free      = lovsub_object_free,
-	.loo_object_print     = lovsub_object_print,
-	.loo_object_invariant = NULL
+	.loo_object_init	= lovsub_object_init,
+	.loo_object_delete	= NULL,
+	.loo_object_release	= NULL,
+	.loo_object_free	= lovsub_object_free,
+	.loo_object_print	= lovsub_object_print,
+	.loo_object_invariant	= NULL
 };
 
 struct lu_object *lovsub_object_alloc(const struct lu_env *env,
@@ -167,7 +166,7 @@ struct lu_object *lovsub_object_alloc(const struct lu_env *env,
 				      struct lu_device *dev)
 {
 	struct lovsub_object *los;
-	struct lu_object     *obj;
+	struct lu_object *obj;
 
 	los = kmem_cache_zalloc(lovsub_object_kmem, GFP_NOFS);
 	if (los) {
drivers/staging/lustre/lustre/lov/lovsub_page.c +1 -1
index 915520b..a8aa583 100644
@@ -53,7 +53,7 @@ static void lovsub_page_fini(const struct lu_env *env,
 }
 
 static const struct cl_page_operations lovsub_page_ops = {
-	.cpo_fini   = lovsub_page_fini
+	.cpo_fini	= lovsub_page_fini
 };
 
 int lovsub_page_init(const struct lu_env *env, struct cl_object *obj,
drivers/staging/lustre/lustre/lov/lproc_lov.c +9 -9
index 771c6f8..fc53f23 100644
@@ -239,10 +239,10 @@ static int lov_tgt_seq_show(struct seq_file *p, void *v)
 }
 
 static const struct seq_operations lov_tgt_sops = {
-	.start = lov_tgt_seq_start,
-	.stop = lov_tgt_seq_stop,
-	.next = lov_tgt_seq_next,
-	.show = lov_tgt_seq_show,
+	.start		= lov_tgt_seq_start,
+	.stop		= lov_tgt_seq_stop,
+	.next		= lov_tgt_seq_next,
+	.show		= lov_tgt_seq_show,
 };
 
 static int lov_target_seq_open(struct inode *inode, struct file *file)
@@ -260,11 +260,11 @@ static int lov_target_seq_open(struct inode *inode, struct file *file)
 }
 
 static const struct file_operations lov_debugfs_target_fops = {
-	.owner   = THIS_MODULE,
-	.open    = lov_target_seq_open,
-	.read    = seq_read,
-	.llseek  = seq_lseek,
-	.release = lprocfs_seq_release,
+	.owner		= THIS_MODULE,
+	.open		= lov_target_seq_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= lprocfs_seq_release,
 };
 
 static struct attribute *lov_attrs[] = {
Signature · 1 line
1.8.3.1
#14 lore raw

PATCH 14/26 mdc: cleanup white spaces

In reply to James Simmons

The mdc code is very messy and difficult to read. Remove excess white space and properly align data structures so they are easy on the eyes.

---
 drivers/staging/lustre/lustre/mdc/mdc_lib.c     | 126 ++++++-------
 drivers/staging/lustre/lustre/mdc/mdc_locks.c   |  80 ++++-----
 drivers/staging/lustre/lustre/mdc/mdc_reint.c   |   2 +-
 drivers/staging/lustre/lustre/mdc/mdc_request.c | 228 ++++++++++++------------
 4 files changed, 218 insertions(+), 218 deletions(-)
drivers/staging/lustre/lustre/mdc/mdc_lib.c +63 -63
index 3dfc863..55d2ea1 100644
@@ -153,30 +153,30 @@ void mdc_create_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
 		     uid_t uid, gid_t gid, kernel_cap_t cap_effective,
 		     u64 rdev)
 {
-	struct mdt_rec_create	*rec;
-	char			*tmp;
-	u64			 flags;
+	struct mdt_rec_create *rec;
+	char *tmp;
+	u64 flags;
 
 	BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != sizeof(struct mdt_rec_create));
 	rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT);
 
-	rec->cr_opcode   = REINT_CREATE;
-	rec->cr_fsuid    = uid;
-	rec->cr_fsgid    = gid;
-	rec->cr_cap      = cap_effective.cap[0];
-	rec->cr_fid1     = op_data->op_fid1;
-	rec->cr_fid2     = op_data->op_fid2;
-	rec->cr_mode     = mode;
-	rec->cr_rdev     = rdev;
-	rec->cr_time     = op_data->op_mod_time;
+	rec->cr_opcode = REINT_CREATE;
+	rec->cr_fsuid = uid;
+	rec->cr_fsgid = gid;
+	rec->cr_cap = cap_effective.cap[0];
+	rec->cr_fid1 = op_data->op_fid1;
+	rec->cr_fid2 = op_data->op_fid2;
+	rec->cr_mode = mode;
+	rec->cr_rdev = rdev;
+	rec->cr_time = op_data->op_mod_time;
 	rec->cr_suppgid1 = op_data->op_suppgids[0];
 	rec->cr_suppgid2 = op_data->op_suppgids[1];
 	flags = 0;
 	if (op_data->op_bias & MDS_CREATE_VOLATILE)
 		flags |= MDS_OPEN_VOLATILE;
 	set_mrc_cr_flags(rec, flags);
-	rec->cr_bias     = op_data->op_bias;
-	rec->cr_umask    = current_umask();
+	rec->cr_bias = op_data->op_bias;
+	rec->cr_umask = current_umask();
 
 	mdc_pack_name(req, &RMF_NAME, op_data->op_name, op_data->op_namelen);
 	if (data) {
@@ -229,21 +229,21 @@ void mdc_open_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
 	rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT);
 
 	/* XXX do something about time, uid, gid */
-	rec->cr_opcode   = REINT_OPEN;
-	rec->cr_fsuid    = from_kuid(&init_user_ns, current_fsuid());
-	rec->cr_fsgid    = from_kgid(&init_user_ns, current_fsgid());
-	rec->cr_cap      = current_cap().cap[0];
+	rec->cr_opcode = REINT_OPEN;
+	rec->cr_fsuid = from_kuid(&init_user_ns, current_fsuid());
+	rec->cr_fsgid = from_kgid(&init_user_ns, current_fsgid());
+	rec->cr_cap = current_cap().cap[0];
 	rec->cr_fid1 = op_data->op_fid1;
 	rec->cr_fid2 = op_data->op_fid2;
 
-	rec->cr_mode     = mode;
+	rec->cr_mode = mode;
 	cr_flags = mds_pack_open_flags(flags);
-	rec->cr_rdev     = rdev;
-	rec->cr_time     = op_data->op_mod_time;
+	rec->cr_rdev = rdev;
+	rec->cr_time = op_data->op_mod_time;
 	rec->cr_suppgid1 = op_data->op_suppgids[0];
 	rec->cr_suppgid2 = op_data->op_suppgids[1];
-	rec->cr_bias     = op_data->op_bias;
-	rec->cr_umask    = current_umask();
+	rec->cr_bias = op_data->op_bias;
+	rec->cr_umask = current_umask();
 	rec->cr_old_handle = op_data->op_handle;
 
 	if (op_data->op_name) {
@@ -313,24 +313,24 @@ static inline u64 attr_pack(unsigned int ia_valid, enum op_xvalid ia_xvalid)
 static void mdc_setattr_pack_rec(struct mdt_rec_setattr *rec,
 				 struct md_op_data *op_data)
 {
-	rec->sa_opcode  = REINT_SETATTR;
-	rec->sa_fsuid   = from_kuid(&init_user_ns, current_fsuid());
-	rec->sa_fsgid   = from_kgid(&init_user_ns, current_fsgid());
-	rec->sa_cap     = current_cap().cap[0];
+	rec->sa_opcode = REINT_SETATTR;
+	rec->sa_fsuid = from_kuid(&init_user_ns, current_fsuid());
+	rec->sa_fsgid = from_kgid(&init_user_ns, current_fsgid());
+	rec->sa_cap = current_cap().cap[0];
 	rec->sa_suppgid = -1;
 
-	rec->sa_fid    = op_data->op_fid1;
+	rec->sa_fid = op_data->op_fid1;
 	rec->sa_valid  = attr_pack(op_data->op_attr.ia_valid,
 				   op_data->op_xvalid);
-	rec->sa_mode   = op_data->op_attr.ia_mode;
-	rec->sa_uid    = from_kuid(&init_user_ns, op_data->op_attr.ia_uid);
-	rec->sa_gid    = from_kgid(&init_user_ns, op_data->op_attr.ia_gid);
+	rec->sa_mode = op_data->op_attr.ia_mode;
+	rec->sa_uid = from_kuid(&init_user_ns, op_data->op_attr.ia_uid);
+	rec->sa_gid = from_kgid(&init_user_ns, op_data->op_attr.ia_gid);
 	rec->sa_projid = op_data->op_projid;
-	rec->sa_size   = op_data->op_attr.ia_size;
+	rec->sa_size = op_data->op_attr.ia_size;
 	rec->sa_blocks = op_data->op_attr_blocks;
-	rec->sa_atime  = op_data->op_attr.ia_atime.tv_sec;
-	rec->sa_mtime  = op_data->op_attr.ia_mtime.tv_sec;
-	rec->sa_ctime  = op_data->op_attr.ia_ctime.tv_sec;
+	rec->sa_atime = op_data->op_attr.ia_atime.tv_sec;
+	rec->sa_mtime = op_data->op_attr.ia_mtime.tv_sec;
+	rec->sa_ctime = op_data->op_attr.ia_ctime.tv_sec;
 	rec->sa_attr_flags = op_data->op_attr_flags;
 	if ((op_data->op_attr.ia_valid & ATTR_GID) &&
 	    in_group_p(op_data->op_attr.ia_gid))
@@ -383,18 +383,18 @@ void mdc_unlink_pack(struct ptlrpc_request *req, struct md_op_data *op_data)
 	BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != sizeof(struct mdt_rec_unlink));
 	rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT);
 
-	rec->ul_opcode   = op_data->op_cli_flags & CLI_RM_ENTRY ?
-					REINT_RMENTRY : REINT_UNLINK;
-	rec->ul_fsuid    = op_data->op_fsuid;
-	rec->ul_fsgid    = op_data->op_fsgid;
-	rec->ul_cap      = op_data->op_cap.cap[0];
-	rec->ul_mode     = op_data->op_mode;
+	rec->ul_opcode = op_data->op_cli_flags & CLI_RM_ENTRY ?
+			 REINT_RMENTRY : REINT_UNLINK;
+	rec->ul_fsuid = op_data->op_fsuid;
+	rec->ul_fsgid = op_data->op_fsgid;
+	rec->ul_cap = op_data->op_cap.cap[0];
+	rec->ul_mode = op_data->op_mode;
 	rec->ul_suppgid1 = op_data->op_suppgids[0];
 	rec->ul_suppgid2 = -1;
-	rec->ul_fid1     = op_data->op_fid1;
-	rec->ul_fid2     = op_data->op_fid2;
-	rec->ul_time     = op_data->op_mod_time;
-	rec->ul_bias     = op_data->op_bias;
+	rec->ul_fid1 = op_data->op_fid1;
+	rec->ul_fid2 = op_data->op_fid2;
+	rec->ul_time = op_data->op_mod_time;
+	rec->ul_bias = op_data->op_bias;
 
 	mdc_pack_name(req, &RMF_NAME, op_data->op_name, op_data->op_namelen);
 }
@@ -406,16 +406,16 @@ void mdc_link_pack(struct ptlrpc_request *req, struct md_op_data *op_data)
 	BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != sizeof(struct mdt_rec_link));
 	rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT);
 
-	rec->lk_opcode   = REINT_LINK;
-	rec->lk_fsuid    = op_data->op_fsuid; /* current->fsuid; */
-	rec->lk_fsgid    = op_data->op_fsgid; /* current->fsgid; */
-	rec->lk_cap      = op_data->op_cap.cap[0]; /* current->cap_effective; */
+	rec->lk_opcode = REINT_LINK;
+	rec->lk_fsuid = op_data->op_fsuid; /* current->fsuid; */
+	rec->lk_fsgid = op_data->op_fsgid; /* current->fsgid; */
+	rec->lk_cap = op_data->op_cap.cap[0]; /* current->cap_effective; */
 	rec->lk_suppgid1 = op_data->op_suppgids[0];
 	rec->lk_suppgid2 = op_data->op_suppgids[1];
-	rec->lk_fid1     = op_data->op_fid1;
-	rec->lk_fid2     = op_data->op_fid2;
-	rec->lk_time     = op_data->op_mod_time;
-	rec->lk_bias     = op_data->op_bias;
+	rec->lk_fid1 = op_data->op_fid1;
+	rec->lk_fid2 = op_data->op_fid2;
+	rec->lk_time = op_data->op_mod_time;
+	rec->lk_bias = op_data->op_bias;
 
 	mdc_pack_name(req, &RMF_NAME, op_data->op_name, op_data->op_namelen);
 }
@@ -455,18 +455,18 @@ void mdc_rename_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
 	rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT);
 
 	/* XXX do something about time, uid, gid */
-	rec->rn_opcode	 = op_data->op_cli_flags & CLI_MIGRATE ?
-				REINT_MIGRATE : REINT_RENAME;
-	rec->rn_fsuid    = op_data->op_fsuid;
-	rec->rn_fsgid    = op_data->op_fsgid;
-	rec->rn_cap      = op_data->op_cap.cap[0];
+	rec->rn_opcode = op_data->op_cli_flags & CLI_MIGRATE ?
+			 REINT_MIGRATE : REINT_RENAME;
+	rec->rn_fsuid = op_data->op_fsuid;
+	rec->rn_fsgid = op_data->op_fsgid;
+	rec->rn_cap = op_data->op_cap.cap[0];
 	rec->rn_suppgid1 = op_data->op_suppgids[0];
 	rec->rn_suppgid2 = op_data->op_suppgids[1];
-	rec->rn_fid1     = op_data->op_fid1;
-	rec->rn_fid2     = op_data->op_fid2;
-	rec->rn_time     = op_data->op_mod_time;
-	rec->rn_mode     = op_data->op_mode;
-	rec->rn_bias     = op_data->op_bias;
+	rec->rn_fid1 = op_data->op_fid1;
+	rec->rn_fid2 = op_data->op_fid2;
+	rec->rn_time = op_data->op_mod_time;
+	rec->rn_mode = op_data->op_mode;
+	rec->rn_bias = op_data->op_bias;
 
 	mdc_pack_name(req, &RMF_NAME, old, oldlen);
 
drivers/staging/lustre/lustre/mdc/mdc_locks.c +40 -40

151 lines not on this page · raw message

drivers/staging/lustre/lustre/mdc/mdc_reint.c +1 -1
index 765c908..e0e7b00 100644
@@ -223,7 +223,7 @@ int mdc_create(struct obd_export *exp, struct md_op_data *op_data,
 		req->rq_sent = ktime_get_real_seconds() + resends;
 	}
 	level = LUSTRE_IMP_FULL;
- resend:
+resend:
 	rc = mdc_reint(req, level);
 
 	/* Resend if we were told to. */
drivers/staging/lustre/lustre/mdc/mdc_request.c +114 -114

440 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#15 lore raw

PATCH 15/26 mgc: cleanup white spaces

In reply to James Simmons

The mgc code is very messy and difficult to read. Remove excess white space and properly align data structures so they are easy on the eyes.

---
 drivers/staging/lustre/lustre/mgc/mgc_request.c | 85 +++++++++++++------------
 1 file changed, 43 insertions(+), 42 deletions(-)
drivers/staging/lustre/lustre/mgc/mgc_request.c +43 -42
index dc80081..a4dfdc0 100644
@@ -193,7 +193,7 @@ struct config_llog_data *do_config_log_add(struct obd_device *obd,
 					   struct super_block *sb)
 {
 	struct config_llog_data *cld;
-	int		      rc;
+	int rc;
 
 	CDEBUG(D_MGC, "do adding config log %s:%p\n", logname,
 	       cfg ? cfg->cfg_instance : NULL);
@@ -267,8 +267,8 @@ struct config_llog_data *do_config_log_add(struct obd_device *obd,
 		       struct super_block *sb, int type,
 		       struct config_llog_instance *cfg)
 {
-	struct config_llog_instance	lcfg = *cfg;
-	struct config_llog_data		*cld;
+	struct config_llog_instance lcfg = *cfg;
+	struct config_llog_data	*cld;
 
 	lcfg.cfg_instance = sb ? (void *)sb : (void *)obd;
 
@@ -296,9 +296,9 @@ struct config_llog_data *do_config_log_add(struct obd_device *obd,
 	struct config_llog_data *sptlrpc_cld = NULL;
 	struct config_llog_data *params_cld = NULL;
 	struct config_llog_data *recover_cld = NULL;
-	char			seclogname[32];
-	char			*ptr;
-	int			rc;
+	char seclogname[32];
+	char *ptr;
+	int rc;
 
 	CDEBUG(D_MGC, "adding config log %s:%p\n", logname, cfg->cfg_instance);
 
@@ -459,8 +459,8 @@ static int config_log_end(char *logname, struct config_llog_instance *cfg)
 
 int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data)
 {
-	struct obd_device       *obd = data;
-	struct obd_import       *imp;
+	struct obd_device *obd = data;
+	struct obd_import *imp;
 	struct obd_connect_data *ocd;
 	struct config_llog_data *cld;
 	int rc;
@@ -491,13 +491,14 @@ int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data)
 }
 
 /* reenqueue any lost locks */
-#define RQ_RUNNING 0x1
-#define RQ_NOW     0x2
-#define RQ_LATER   0x4
-#define RQ_STOP    0x8
-#define RQ_PRECLEANUP  0x10
+#define RQ_RUNNING	0x01
+#define RQ_NOW		0x02
+#define RQ_LATER	0x04
+#define RQ_STOP		0x08
+#define RQ_PRECLEANUP	0x10
+
 static int rq_state;
-static wait_queue_head_t	    rq_waitq;
+static wait_queue_head_t rq_waitq;
 static DECLARE_COMPLETION(rq_exit);
 static DECLARE_COMPLETION(rq_start);
 
@@ -620,7 +621,7 @@ static int mgc_requeue_thread(void *data)
 	return 0;
 }
 
-/* Add a cld to the list to requeue.  Start the requeue thread if needed.
+/* Add a cld to the list to requeue. Start the requeue thread if needed.
  * We are responsible for dropping the config log reference from here on out.
  */
 static void mgc_requeue_add(struct config_llog_data *cld)
@@ -647,8 +648,8 @@ static void mgc_requeue_add(struct config_llog_data *cld)
 
 static int mgc_llog_init(const struct lu_env *env, struct obd_device *obd)
 {
-	struct llog_ctxt	*ctxt;
-	int			 rc;
+	struct llog_ctxt *ctxt;
+	int rc;
 
 	/* setup only remote ctxt, the local disk context is switched per each
 	 * filesystem during mgc_fs_setup()
@@ -941,9 +942,9 @@ static void mgc_notify_active(struct obd_device *unused)
 static int mgc_target_register(struct obd_export *exp,
 			       struct mgs_target_info *mti)
 {
-	struct ptlrpc_request  *req;
+	struct ptlrpc_request *req;
 	struct mgs_target_info *req_mti, *rep_mti;
-	int		     rc;
+	int rc;
 
 	req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp),
 					&RQF_MGS_TARGET_REG, LUSTRE_MGS_VERSION,
@@ -1009,8 +1010,8 @@ static int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
 		return rc;
 	}
 	if (KEY_IS(KEY_MGSSEC)) {
-		struct client_obd     *cli = &exp->exp_obd->u.cli;
-		struct sptlrpc_flavor  flvr;
+		struct client_obd *cli = &exp->exp_obd->u.cli;
+		struct sptlrpc_flavor flvr;
 
 		/*
 		 * empty string means using current flavor, if which haven't
@@ -1040,7 +1041,7 @@ static int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
 			cli->cl_flvr_mgc = flvr;
 		} else if (memcmp(&cli->cl_flvr_mgc, &flvr,
 				  sizeof(flvr)) != 0) {
-			char    str[20];
+			char str[20];
 
 			sptlrpc_flavor2name(&cli->cl_flvr_mgc,
 					    str, sizeof(str));
@@ -1125,15 +1126,15 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
 {
 	struct config_llog_instance *cfg = &cld->cld_cfg;
 	struct mgs_nidtbl_entry *entry;
-	struct lustre_cfg       *lcfg;
-	struct lustre_cfg_bufs   bufs;
-	u64   prev_version = 0;
+	struct lustre_cfg *lcfg;
+	struct lustre_cfg_bufs bufs;
+	u64 prev_version = 0;
 	char *inst;
 	char *buf;
-	int   bufsz;
-	int   pos;
-	int   rc  = 0;
-	int   off = 0;
+	int bufsz;
+	int pos;
+	int rc = 0;
+	int off = 0;
 
 	LASSERT(cfg->cfg_instance);
 	LASSERT(cfg->cfg_sb == cfg->cfg_instance);
@@ -1149,11 +1150,11 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
 	}
 
 	++pos;
-	buf   = inst + pos;
+	buf = inst + pos;
 	bufsz = PAGE_SIZE - pos;
 
 	while (datalen > 0) {
-		int   entry_len = sizeof(*entry);
+		int entry_len = sizeof(*entry);
 		int is_ost, i;
 		struct obd_device *obd;
 		char *obdname;
@@ -1191,7 +1192,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
 		if (entry->mne_length < entry_len)
 			break;
 
-		off     += entry->mne_length;
+		off += entry->mne_length;
 		datalen -= entry->mne_length;
 		if (datalen < 0)
 			break;
@@ -1323,7 +1324,7 @@ static int mgc_process_recover_log(struct obd_device *obd,
 	struct ptlrpc_request *req = NULL;
 	struct config_llog_instance *cfg = &cld->cld_cfg;
 	struct mgs_config_body *body;
-	struct mgs_config_res  *res;
+	struct mgs_config_res *res;
 	struct ptlrpc_bulk_desc *desc;
 	struct page **pages;
 	int nrpages;
@@ -1380,9 +1381,9 @@ static int mgc_process_recover_log(struct obd_device *obd,
 		goto out;
 	}
 	body->mcb_offset = cfg->cfg_last_idx + 1;
-	body->mcb_type   = cld->cld_type;
-	body->mcb_bits   = PAGE_SHIFT;
-	body->mcb_units  = nrpages;
+	body->mcb_type = cld->cld_type;
+	body->mcb_bits = PAGE_SHIFT;
+	body->mcb_units = nrpages;
 
 	/* allocate bulk transfer descriptor */
 	desc = ptlrpc_prep_bulk_imp(req, nrpages, 1,
@@ -1483,11 +1484,11 @@ static int mgc_process_recover_log(struct obd_device *obd,
 static int mgc_process_cfg_log(struct obd_device *mgc,
 			       struct config_llog_data *cld, int local_only)
 {
-	struct llog_ctxt	*ctxt;
-	struct lustre_sb_info	*lsi = NULL;
-	int			 rc = 0;
-	bool			 sptlrpc_started = false;
-	struct lu_env		*env;
+	struct llog_ctxt *ctxt;
+	struct lustre_sb_info *lsi = NULL;
+	int rc = 0;
+	bool sptlrpc_started = false;
+	struct lu_env *env;
 
 	LASSERT(cld);
 	LASSERT(mutex_is_locked(&cld->cld_lock));
@@ -1570,7 +1571,7 @@ static bool mgc_import_in_recovery(struct obd_import *imp)
  * Get a configuration log from the MGS and process it.
  *
  * This function is called for both clients and servers to process the
- * configuration log from the MGS.  The MGC enqueues a DLM lock on the
+ * configuration log from the MGS. The MGC enqueues a DLM lock on the
  * log from the MGS, and if the lock gets revoked the MGC will be notified
  * by the lock cancellation callback that the config log has changed,
  * and will enqueue another MGS lock on it, and then continue processing
Signature · 1 line
1.8.3.1
#16 lore raw

PATCH 16/26 obdclass: cleanup white spaces

In reply to James Simmons

The obdclass code is very messy and difficult to read. Remove excess white space and properly align data structures so they are easy on the eyes.

---
 .../staging/lustre/lustre/obdclass/cl_internal.h   |   2 +-
 drivers/staging/lustre/lustre/obdclass/cl_io.c     |  28 ++---
 drivers/staging/lustre/lustre/obdclass/cl_lock.c   |   2 +-
 drivers/staging/lustre/lustre/obdclass/cl_object.c |  40 +++---
 drivers/staging/lustre/lustre/obdclass/cl_page.c   |  62 ++++-----
 drivers/staging/lustre/lustre/obdclass/class_obd.c |   6 +-
 drivers/staging/lustre/lustre/obdclass/genops.c    |  16 +--
 .../staging/lustre/lustre/obdclass/kernelcomm.c    |   8 +-
 drivers/staging/lustre/lustre/obdclass/linkea.c    |   6 +-
 drivers/staging/lustre/lustre/obdclass/llog.c      |  40 +++---
 drivers/staging/lustre/lustre/obdclass/llog_cat.c  |   6 +-
 .../staging/lustre/lustre/obdclass/llog_internal.h |  24 ++--
 drivers/staging/lustre/lustre/obdclass/llog_swab.c |  16 +--
 .../lustre/lustre/obdclass/lprocfs_counters.c      |  16 +--
 .../lustre/lustre/obdclass/lprocfs_status.c        | 140 ++++++++++-----------
 drivers/staging/lustre/lustre/obdclass/lu_object.c |  98 +++++++--------
 .../lustre/lustre/obdclass/lustre_handles.c        |   2 +-
 .../staging/lustre/lustre/obdclass/lustre_peer.c   |   8 +-
 .../staging/lustre/lustre/obdclass/obd_config.c    |  35 +++---
 drivers/staging/lustre/lustre/obdclass/obd_mount.c |  15 ++-
 20 files changed, 283 insertions(+), 287 deletions(-)
drivers/staging/lustre/lustre/obdclass/cl_internal.h +1 -1
index 8770e32..dc6bf10 100644
@@ -44,7 +44,7 @@ struct cl_thread_info {
 	/**
 	 * Used for submitting a sync I/O.
 	 */
-	struct cl_sync_io    clt_anchor;
+	struct cl_sync_io	clt_anchor;
 };
 
 struct cl_thread_info *cl_env_info(const struct lu_env *env);
drivers/staging/lustre/lustre/obdclass/cl_io.c +13 -15
index d3f2455..09fd45d 100644
@@ -86,7 +86,7 @@ static int cl_io_invariant(const struct cl_io *io)
  */
 void cl_io_fini(const struct lu_env *env, struct cl_io *io)
 {
-	struct cl_io_slice    *slice;
+	struct cl_io_slice *slice;
 
 	LINVRNT(cl_io_type_is_valid(io->ci_type));
 	LINVRNT(cl_io_invariant(io));
@@ -207,8 +207,8 @@ int cl_io_rw_init(const struct lu_env *env, struct cl_io *io,
 			 "io range: %u [%llu, %llu) %u %u\n",
 			 iot, (u64)pos, (u64)pos + count,
 			 io->u.ci_rw.crw_nonblock, io->u.ci_wr.wr_append);
-	io->u.ci_rw.crw_pos    = pos;
-	io->u.ci_rw.crw_count  = count;
+	io->u.ci_rw.crw_pos = pos;
+	io->u.ci_rw.crw_count = count;
 	return cl_io_init(env, io, iot, io->ci_obj);
 }
 EXPORT_SYMBOL(cl_io_rw_init);
@@ -363,9 +363,9 @@ int cl_io_lock(const struct lu_env *env, struct cl_io *io)
  */
 void cl_io_unlock(const struct lu_env *env, struct cl_io *io)
 {
-	struct cl_lockset	*set;
-	struct cl_io_lock_link   *link;
-	struct cl_io_lock_link   *temp;
+	struct cl_lockset *set;
+	struct cl_io_lock_link *link;
+	struct cl_io_lock_link *temp;
 	const struct cl_io_slice *scan;
 
 	LASSERT(cl_io_is_loopable(io));
@@ -460,7 +460,7 @@ static void cl_io_rw_advance(const struct lu_env *env, struct cl_io *io,
 	LINVRNT(cl_io_is_loopable(io));
 	LINVRNT(cl_io_invariant(io));
 
-	io->u.ci_rw.crw_pos   += nob;
+	io->u.ci_rw.crw_pos += nob;
 	io->u.ci_rw.crw_count -= nob;
 
 	/* layers have to be notified. */
@@ -506,8 +506,8 @@ int cl_io_lock_alloc_add(const struct lu_env *env, struct cl_io *io,
 
 	link = kzalloc(sizeof(*link), GFP_NOFS);
 	if (link) {
-		link->cill_descr     = *descr;
-		link->cill_fini      = cl_free_io_lock_link;
+		link->cill_descr = *descr;
+		link->cill_fini = cl_free_io_lock_link;
 		result = cl_io_lock_add(env, io, link);
 		if (result) /* lock match */
 			link->cill_fini(env, link);
@@ -575,7 +575,7 @@ int cl_io_read_ahead(const struct lu_env *env, struct cl_io *io,
 		     pgoff_t start, struct cl_read_ahead *ra)
 {
 	const struct cl_io_slice *scan;
-	int		       result = 0;
+	int result = 0;
 
 	LINVRNT(io->ci_type == CIT_READ || io->ci_type == CIT_FAULT);
 	LINVRNT(cl_io_invariant(io));
@@ -715,7 +715,7 @@ int cl_io_submit_sync(const struct lu_env *env, struct cl_io *io,
  */
 int cl_io_loop(const struct lu_env *env, struct cl_io *io)
 {
-	int result   = 0;
+	int result = 0;
 
 	LINVRNT(cl_io_is_loopable(io));
 
@@ -725,7 +725,7 @@ int cl_io_loop(const struct lu_env *env, struct cl_io *io)
 		io->ci_continue = 0;
 		result = cl_io_iter_init(env, io);
 		if (result == 0) {
-			nob    = io->ci_nob;
+			nob = io->ci_nob;
 			result = cl_io_lock(env, io);
 			if (result == 0) {
 				/*
@@ -774,7 +774,7 @@ void cl_io_slice_add(struct cl_io *io, struct cl_io_slice *slice,
 		list_empty(linkage));
 
 	list_add_tail(linkage, &io->ci_layers);
-	slice->cis_io  = io;
+	slice->cis_io = io;
 	slice->cis_obj = obj;
 	slice->cis_iop = ops;
 }
@@ -879,7 +879,6 @@ void cl_page_list_splice(struct cl_page_list *list, struct cl_page_list *head)
 }
 EXPORT_SYMBOL(cl_page_list_splice);
 
-
 /**
  * Disowns pages in a queue.
  */
@@ -1102,7 +1101,6 @@ int cl_sync_io_wait(const struct lu_env *env, struct cl_sync_io *anchor,
 	while (unlikely(atomic_read(&anchor->csi_barrier) != 0))
 		cpu_relax();
 
-
 	return rc;
 }
 EXPORT_SYMBOL(cl_sync_io_wait);
drivers/staging/lustre/lustre/obdclass/cl_lock.c +1 -1
index 425ca9c..d7bcb8c 100644
@@ -243,7 +243,7 @@ void cl_lock_descr_print(const struct lu_env *env, void *cookie,
 			 lu_printer_t printer,
 			 const struct cl_lock_descr *descr)
 {
-	const struct lu_fid  *fid;
+	const struct lu_fid *fid;
 
 	fid = lu_object_fid(&descr->cld_obj->co_lu);
 	(*printer)(env, cookie, DDESCR "@" DFID, PDESCR(descr), PFID(fid));
drivers/staging/lustre/lustre/obdclass/cl_object.c +20 -20
index 5b59a71..05d784a 100644
@@ -483,8 +483,8 @@ void cl_site_fini(struct cl_site *s)
 EXPORT_SYMBOL(cl_site_fini);
 
 static struct cache_stats cl_env_stats = {
-	.cs_name    = "envs",
-	.cs_stats = { ATOMIC_INIT(0), }
+	.cs_name	= "envs",
+	.cs_stats	= { ATOMIC_INIT(0), }
 };
 
 /**
@@ -495,11 +495,11 @@ int cl_site_stats_print(const struct cl_site *site, struct seq_file *m)
 {
 	size_t i;
 	static const char * const pstate[] = {
-		[CPS_CACHED]  = "c",
-		[CPS_OWNED]   = "o",
-		[CPS_PAGEOUT] = "w",
-		[CPS_PAGEIN]  = "r",
-		[CPS_FREEING] = "f"
+		[CPS_CACHED]	= "c",
+		[CPS_OWNED]	= "o",
+		[CPS_PAGEOUT]	= "w",
+		[CPS_PAGEIN]	= "r",
+		[CPS_FREEING]	= "f"
 	};
 /*
        lookup    hit  total   busy create
@@ -553,9 +553,9 @@ int cl_site_stats_print(const struct cl_site *site, struct seq_file *m)
 } *cl_envs = NULL;
 
 struct cl_env {
-	void	     *ce_magic;
-	struct lu_env     ce_lu;
-	struct lu_context ce_ses;
+	void		       *ce_magic;
+	struct lu_env		ce_lu;
+	struct lu_context	ce_ses;
 
 	/*
 	 * Linkage into global list of all client environments. Used for
@@ -565,12 +565,12 @@ struct cl_env {
 	/*
 	 *
 	 */
-	int	       ce_ref;
+	int			ce_ref;
 	/*
 	 * Debugging field: address of the caller who made original
 	 * allocation.
 	 */
-	void	     *ce_debug;
+	void		       *ce_debug;
 };
 
 static void cl_env_inc(enum cache_stats_item item)
@@ -818,10 +818,10 @@ void cl_env_put(struct lu_env *env, u16 *refcheck)
  */
 void cl_lvb2attr(struct cl_attr *attr, const struct ost_lvb *lvb)
 {
-	attr->cat_size   = lvb->lvb_size;
-	attr->cat_mtime  = lvb->lvb_mtime;
-	attr->cat_atime  = lvb->lvb_atime;
-	attr->cat_ctime  = lvb->lvb_ctime;
+	attr->cat_size = lvb->lvb_size;
+	attr->cat_mtime = lvb->lvb_mtime;
+	attr->cat_atime = lvb->lvb_atime;
+	attr->cat_ctime = lvb->lvb_ctime;
 	attr->cat_blocks = lvb->lvb_blocks;
 }
 EXPORT_SYMBOL(cl_lvb2attr);
@@ -936,7 +936,7 @@ struct cl_device *cl_type_setup(const struct lu_env *env, struct lu_site *site,
 				struct lu_device_type *ldt,
 				struct lu_device *next)
 {
-	const char       *typename;
+	const char *typename;
 	struct lu_device *d;
 
 	typename = ldt->ldt_name;
@@ -983,9 +983,9 @@ struct cl_thread_info *cl_env_info(const struct lu_env *env)
 LU_KEY_INIT_FINI(cl, struct cl_thread_info);
 
 static struct lu_context_key cl_key = {
-	.lct_tags = LCT_CL_THREAD,
-	.lct_init = cl_key_init,
-	.lct_fini = cl_key_fini,
+	.lct_tags	= LCT_CL_THREAD,
+	.lct_init	= cl_key_init,
+	.lct_fini	= cl_key_fini,
 };
 
 static struct lu_kmem_descr cl_object_caches[] = {
drivers/staging/lustre/lustre/obdclass/cl_page.c +31 -31

107 lines not on this page · raw message

drivers/staging/lustre/lustre/obdclass/class_obd.c +3 -3
index e130cf7..b859ab19 100644
@@ -587,9 +587,9 @@ static long obd_class_ioctl(struct file *filp, unsigned int cmd,
 
 /* modules setup */
 static struct miscdevice obd_psdev = {
-	.minor	= MISC_DYNAMIC_MINOR,
-	.name	= OBD_DEV_NAME,
-	.fops	= &obd_psdev_fops,
+	.minor		= MISC_DYNAMIC_MINOR,
+	.name		= OBD_DEV_NAME,
+	.fops		= &obd_psdev_fops,
 };
 
 static int obd_init_checks(void)
drivers/staging/lustre/lustre/obdclass/genops.c +8 -8
index 3d4d6e1..cee144c 100644
@@ -622,9 +622,9 @@ struct obd_device *class_devices_in_group(struct obd_uuid *grp_uuid, int *next)
  */
 int class_notify_sptlrpc_conf(const char *fsname, int namelen)
 {
-	struct obd_device  *obd;
-	const char	 *type;
-	int		 i, rc = 0, rc2;
+	struct obd_device *obd;
+	const char *type;
+	int i, rc = 0, rc2;
 
 	LASSERT(namelen > 0);
 
@@ -693,7 +693,7 @@ int obd_init_caches(void)
 		goto out;
 
 	return 0;
- out:
+out:
 	obd_cleanup_caches();
 	return -ENOMEM;
 }
@@ -772,8 +772,8 @@ static void export_handle_addref(void *export)
 }
 
 static struct portals_handle_ops export_handle_ops = {
-	.hop_addref = export_handle_addref,
-	.hop_free   = NULL,
+	.hop_addref	= export_handle_addref,
+	.hop_free	= NULL,
 };
 
 struct obd_export *class_export_get(struct obd_export *exp)
@@ -967,8 +967,8 @@ static void import_handle_addref(void *import)
 }
 
 static struct portals_handle_ops import_handle_ops = {
-	.hop_addref = import_handle_addref,
-	.hop_free   = NULL,
+	.hop_addref	= import_handle_addref,
+	.hop_free	= NULL,
 };
 
 struct obd_import *class_import_get(struct obd_import *import)
drivers/staging/lustre/lustre/obdclass/kernelcomm.c +4 -4
index 5d81996..925ba52 100644
@@ -89,10 +89,10 @@ int libcfs_kkuc_msg_put(struct file *filp, void *payload)
  */
 /** A single group registration has a uid and a file pointer */
 struct kkuc_reg {
-	struct list_head kr_chain;
-	int		 kr_uid;
-	struct file	*kr_fp;
-	char		 kr_data[0];
+	struct list_head	kr_chain;
+	int			kr_uid;
+	struct file	       *kr_fp;
+	char			kr_data[0];
 };
 
 static struct list_head kkuc_groups[KUC_GRP_MAX + 1];
drivers/staging/lustre/lustre/obdclass/linkea.c +3 -3
index 74c99ee..33594bd 100644
@@ -95,8 +95,8 @@ int linkea_init_with_rec(struct linkea_data *ldata)
 int linkea_entry_pack(struct link_ea_entry *lee, const struct lu_name *lname,
 		      const struct lu_fid *pfid)
 {
-	struct lu_fid   tmpfid;
-	int             reclen;
+	struct lu_fid tmpfid;
+	int reclen;
 
 	tmpfid = *pfid;
 	if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LINKEA_CRASH))
@@ -216,7 +216,7 @@ int linkea_links_find(struct linkea_data *ldata, const struct lu_name *lname,
 		      const struct lu_fid  *pfid)
 {
 	struct lu_name tmpname;
-	struct lu_fid  tmpfid;
+	struct lu_fid tmpfid;
 	int count;
 
 	LASSERT(ldata->ld_leh);
drivers/staging/lustre/lustre/obdclass/llog.c +20 -20
index 8644d34..7aa459b 100644
@@ -151,8 +151,8 @@ int llog_init_handle(const struct lu_env *env, struct llog_handle *handle,
 {
 	int chunk_size = handle->lgh_ctxt->loc_chunk_size;
 	enum llog_flag fmt = flags & LLOG_F_EXT_MASK;
-	struct llog_log_hdr	*llh;
-	int			 rc;
+	struct llog_log_hdr *llh;
+	int rc;
 
 	LASSERT(!handle->lgh_hdr);
 
@@ -223,16 +223,16 @@ int llog_init_handle(const struct lu_env *env, struct llog_handle *handle,
 
 static int llog_process_thread(void *arg)
 {
-	struct llog_process_info	*lpi = arg;
-	struct llog_handle		*loghandle = lpi->lpi_loghandle;
-	struct llog_log_hdr		*llh = loghandle->lgh_hdr;
-	struct llog_process_cat_data	*cd  = lpi->lpi_catdata;
-	char				*buf;
+	struct llog_process_info *lpi = arg;
+	struct llog_handle *loghandle = lpi->lpi_loghandle;
+	struct llog_log_hdr *llh = loghandle->lgh_hdr;
+	struct llog_process_cat_data *cd  = lpi->lpi_catdata;
+	char *buf;
 	u64 cur_offset, tmp_offset;
 	int chunk_size;
-	int				 rc = 0, index = 1, last_index;
-	int				 saved_index = 0;
-	int				 last_called_index = 0;
+	int rc = 0, index = 1, last_index;
+	int saved_index = 0;
+	int last_called_index = 0;
 
 	if (!llh)
 		return -EINVAL;
@@ -394,9 +394,9 @@ static int llog_process_thread(void *arg)
 
 static int llog_process_thread_daemonize(void *arg)
 {
-	struct llog_process_info	*lpi = arg;
-	struct lu_env			 env;
-	int				 rc;
+	struct llog_process_info *lpi = arg;
+	struct lu_env env;
+	int rc;
 
 	unshare_fs_struct();
 
@@ -419,15 +419,15 @@ int llog_process_or_fork(const struct lu_env *env,
 			 llog_cb_t cb, void *data, void *catdata, bool fork)
 {
 	struct llog_process_info *lpi;
-	int		      rc;
+	int rc;
 
 	lpi = kzalloc(sizeof(*lpi), GFP_KERNEL);
 	if (!lpi)
 		return -ENOMEM;
 	lpi->lpi_loghandle = loghandle;
-	lpi->lpi_cb	= cb;
-	lpi->lpi_cbdata    = data;
-	lpi->lpi_catdata   = catdata;
+	lpi->lpi_cb = cb;
+	lpi->lpi_cbdata = data;
+	lpi->lpi_catdata = catdata;
 
 	if (fork) {
 		struct task_struct *task;
@@ -469,7 +469,7 @@ int llog_open(const struct lu_env *env, struct llog_ctxt *ctxt,
 	      char *name, enum llog_open_param open_param)
 {
 	const struct cred *old_cred = NULL;
-	int	 rc;
+	int rc;
 
 	LASSERT(ctxt);
 	LASSERT(ctxt->loc_logops);
@@ -507,8 +507,8 @@ int llog_open(const struct lu_env *env, struct llog_ctxt *ctxt,
 
 int llog_close(const struct lu_env *env, struct llog_handle *loghandle)
 {
-	struct llog_operations	*lop;
-	int			 rc;
+	struct llog_operations *lop;
+	int rc;
 
 	rc = llog_handle2ops(loghandle, &lop);
 	if (rc)
drivers/staging/lustre/lustre/obdclass/llog_cat.c +3 -3
index 172a368..b61c858 100644
@@ -63,9 +63,9 @@ static int llog_cat_id2handle(const struct lu_env *env,
 			      struct llog_handle **res,
 			      struct llog_logid *logid)
 {
-	struct llog_handle	*loghandle;
+	struct llog_handle *loghandle;
 	enum llog_flag fmt;
-	int			 rc = 0;
+	int rc = 0;
 
 	if (!cathandle)
 		return -EBADF;
@@ -125,7 +125,7 @@ static int llog_cat_id2handle(const struct lu_env *env,
 
 int llog_cat_close(const struct lu_env *env, struct llog_handle *cathandle)
 {
-	struct llog_handle	*loghandle, *n;
+	struct llog_handle *loghandle, *n;
 
 	list_for_each_entry_safe(loghandle, n, &cathandle->u.chd.chd_head,
 				 u.phd.phd_entry) {
drivers/staging/lustre/lustre/obdclass/llog_internal.h +12 -12
index 4991d4e..545119e 100644
@@ -37,23 +37,23 @@
 #include <lustre_log.h>
 
 struct llog_process_info {
-	struct llog_handle *lpi_loghandle;
-	llog_cb_t	   lpi_cb;
-	void	       *lpi_cbdata;
-	void	       *lpi_catdata;
-	int		 lpi_rc;
+	struct llog_handle     *lpi_loghandle;
+	llog_cb_t		lpi_cb;
+	void		       *lpi_cbdata;
+	void		       *lpi_catdata;
+	int			lpi_rc;
 	struct completion	lpi_completion;
-	const struct lu_env	*lpi_env;
+	const struct lu_env    *lpi_env;
 
 };
 
 struct llog_thread_info {
-	struct lu_attr			 lgi_attr;
-	struct lu_fid			 lgi_fid;
-	struct lu_buf			 lgi_buf;
-	loff_t				 lgi_off;
-	struct llog_rec_hdr		 lgi_lrh;
-	struct llog_rec_tail		 lgi_tail;
+	struct lu_attr		lgi_attr;
+	struct lu_fid		lgi_fid;
+	struct lu_buf		lgi_buf;
+	loff_t			lgi_off;
+	struct llog_rec_hdr	lgi_lrh;
+	struct llog_rec_tail	lgi_tail;
 };
 
 extern struct lu_context_key llog_thread_key;
drivers/staging/lustre/lustre/obdclass/llog_swab.c +8 -8
index fddc1ea..57dadec 100644
@@ -358,14 +358,14 @@ void lustre_swab_lustre_cfg(struct lustre_cfg *lcfg)
 
 /* used only for compatibility with old on-disk cfg_marker data */
 struct cfg_marker32 {
-	u32   cm_step;
-	u32   cm_flags;
-	u32   cm_vers;
-	u32   padding;
-	u32   cm_createtime;
-	u32   cm_canceltime;
-	char    cm_tgtname[MTI_NAME_MAXLEN];
-	char    cm_comment[MTI_NAME_MAXLEN];
+	u32	cm_step;
+	u32	cm_flags;
+	u32	cm_vers;
+	u32	padding;
+	u32	cm_createtime;
+	u32	cm_canceltime;
+	char	cm_tgtname[MTI_NAME_MAXLEN];
+	char	cm_comment[MTI_NAME_MAXLEN];
 };
 
 #define MTI_NAMELEN32    (MTI_NAME_MAXLEN - \
drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c +8 -8
index 77bc66f..c7bf1ee 100644
@@ -45,10 +45,10 @@
 
 void lprocfs_counter_add(struct lprocfs_stats *stats, int idx, long amount)
 {
-	struct lprocfs_counter		*percpu_cntr;
-	struct lprocfs_counter_header	*header;
-	int				smp_id;
-	unsigned long			flags = 0;
+	struct lprocfs_counter *percpu_cntr;
+	struct lprocfs_counter_header *header;
+	int smp_id;
+	unsigned long flags = 0;
 
 	if (!stats)
 		return;
@@ -94,10 +94,10 @@ void lprocfs_counter_add(struct lprocfs_stats *stats, int idx, long amount)
 
 void lprocfs_counter_sub(struct lprocfs_stats *stats, int idx, long amount)
 {
-	struct lprocfs_counter		*percpu_cntr;
-	struct lprocfs_counter_header	*header;
-	int				smp_id;
-	unsigned long			flags = 0;
+	struct lprocfs_counter *percpu_cntr;
+	struct lprocfs_counter_header *header;
+	int smp_id;
+	unsigned long flags = 0;
 
 	if (!stats)
 		return;
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +70 -70

261 lines not on this page · raw message

drivers/staging/lustre/lustre/obdclass/lu_object.c +49 -49

214 lines not on this page · raw message

drivers/staging/lustre/lustre/obdclass/lustre_handles.c +1 -1
index b296877..0674afb 100644
@@ -47,7 +47,7 @@
 static spinlock_t handle_base_lock;
 
 static struct handle_bucket {
-	spinlock_t	lock;
+	spinlock_t		lock;
 	struct list_head	head;
 } *handle_hash;
 
drivers/staging/lustre/lustre/obdclass/lustre_peer.c +4 -4
index 8e7f3a8..0c3e0ca 100644
@@ -44,10 +44,10 @@
 #define NIDS_MAX	32
 
 struct uuid_nid_data {
-	struct list_head       un_list;
-	struct obd_uuid  un_uuid;
-	int	      un_nid_count;
-	lnet_nid_t       un_nids[NIDS_MAX];
+	struct list_head	un_list;
+	struct obd_uuid		un_uuid;
+	int			un_nid_count;
+	lnet_nid_t		un_nids[NIDS_MAX];
 };
 
 /* FIXME: This should probably become more elegant than a global linked list */
drivers/staging/lustre/lustre/obdclass/obd_config.c +17 -18
index 887afda..0cdadea4 100644
@@ -189,8 +189,8 @@ static int class_parse_value(char *buf, int opc, void *value, char **endh,
 			     int quiet)
 {
 	char *endp;
-	char  tmp;
-	int   rc = 0;
+	char tmp;
+	int rc = 0;
 
 	if (!buf)
 		return 1;
@@ -249,7 +249,7 @@ char *lustre_cfg_string(struct lustre_cfg *lcfg, u32 index)
 
 	/*
 	 * make sure it's NULL terminated, even if this kills a char
-	 * of data.  Try to use the padding first though.
+	 * of data. Try to use the padding first though.
 	 */
 	if (s[lcfg->lcfg_buflens[index] - 1] != '\0') {
 		size_t last = ALIGN(lcfg->lcfg_buflens[index], 8) - 1;
@@ -388,7 +388,6 @@ static int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 
 	/* create an uuid-export lustre hash */
 	err = rhashtable_init(&obd->obd_uuid_hash, &uuid_hash_params);
-
 	if (err)
 		goto err_hash;
 
@@ -1407,7 +1406,7 @@ int class_config_llog_handler(const struct lu_env *env,
 		}
 
 		lustre_cfg_init(lcfg_new, lcfg->lcfg_command, &bufs);
-		lcfg_new->lcfg_num   = lcfg->lcfg_num;
+		lcfg_new->lcfg_num = lcfg->lcfg_num;
 		lcfg_new->lcfg_flags = lcfg->lcfg_flags;
 
 		/* XXX Hack to try to remain binary compatible with
@@ -1454,9 +1453,9 @@ int class_config_parse_llog(const struct lu_env *env, struct llog_ctxt *ctxt,
 	struct llog_process_cat_data cd = {
 		.lpcd_first_idx = 0,
 	};
-	struct llog_handle		*llh;
-	llog_cb_t			 callback;
-	int				 rc;
+	struct llog_handle *llh;
+	llog_cb_t callback;
+	int rc;
 
 	CDEBUG(D_INFO, "looking up llog %s\n", name);
 	rc = llog_open(env, ctxt, &llh, NULL, name, LLOG_OPEN_EXISTS);
@@ -1499,10 +1498,10 @@ int class_config_parse_llog(const struct lu_env *env, struct llog_ctxt *ctxt,
 static int class_config_parse_rec(struct llog_rec_hdr *rec, char *buf,
 				  int size)
 {
-	struct lustre_cfg	*lcfg = (struct lustre_cfg *)(rec + 1);
-	char			*ptr = buf;
-	char			*end = buf + size;
-	int			 rc = 0;
+	struct lustre_cfg *lcfg = (struct lustre_cfg *)(rec + 1);
+	char *ptr = buf;
+	char *end = buf + size;
+	int rc = 0;
 
 	LASSERT(rec->lrh_type == OBD_CFG_REC);
 	rc = lustre_cfg_sanity_check(lcfg, rec->lrh_len);
@@ -1549,8 +1548,8 @@ int class_config_dump_handler(const struct lu_env *env,
 			      struct llog_handle *handle,
 			      struct llog_rec_hdr *rec, void *data)
 {
-	char	*outstr;
-	int	 rc = 0;
+	char *outstr;
+	int rc = 0;
 
 	outstr = kzalloc(256, GFP_NOFS);
 	if (!outstr)
@@ -1573,10 +1572,10 @@ int class_config_dump_handler(const struct lu_env *env,
  */
 int class_manual_cleanup(struct obd_device *obd)
 {
-	char		    flags[3] = "";
-	struct lustre_cfg      *lcfg;
-	struct lustre_cfg_bufs  bufs;
-	int		     rc;
+	char flags[3] = "";
+	struct lustre_cfg *lcfg;
+	struct lustre_cfg_bufs bufs;
+	int rc;
 
 	if (!obd) {
 		CERROR("empty cleanup\n");
drivers/staging/lustre/lustre/obdclass/obd_mount.c +7 -8
index eab3216..33aa790 100644
@@ -150,7 +150,7 @@ static int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd,
 		   char *s1, char *s2, char *s3, char *s4)
 {
 	struct lustre_cfg_bufs bufs;
-	struct lustre_cfg     *lcfg = NULL;
+	struct lustre_cfg *lcfg = NULL;
 	int rc;
 
 	CDEBUG(D_TRACE, "lcfg %s %#x %s %s %s %s\n", cfgname,
@@ -801,8 +801,8 @@ static int lmd_make_exclusion(struct lustre_mount_data *lmd, const char *ptr)
 
 static int lmd_parse_mgssec(struct lustre_mount_data *lmd, char *ptr)
 {
-	char   *tail;
-	int     length;
+	char *tail;
+	int length;
 
 	kfree(lmd->lmd_mgssec);
 	lmd->lmd_mgssec = NULL;
@@ -845,8 +845,8 @@ static int lmd_parse_network(struct lustre_mount_data *lmd, char *ptr)
 
 static int lmd_parse_string(char **handle, char *ptr)
 {
-	char   *tail;
-	int     length;
+	char *tail;
+	int length;
 
 	if (!handle || !ptr)
 		return -EINVAL;
@@ -876,8 +876,8 @@ static int lmd_parse_mgs(struct lustre_mount_data *lmd, char **ptr)
 	lnet_nid_t nid;
 	char *tail = *ptr;
 	char *mgsnid;
-	int   length;
-	int   oldlen = 0;
+	int length;
+	int oldlen = 0;
 
 	/* Find end of nidlist */
 	while (class_parse_nid_quiet(tail, &nid, &tail) == 0)
@@ -1252,4 +1252,3 @@ int lmd_parse(char *options, struct lustre_mount_data *lmd)
 	return -EINVAL;
 }
 EXPORT_SYMBOL(lmd_parse);
-
Signature · 1 line
1.8.3.1
#17 lore raw

PATCH 17/26 obdecho: cleanup white spaces

In reply to James Simmons

The obdecho code is very messy and difficult to read. Remove excess white space and properly align data structures so they are easy on the eyes.

---
 .../staging/lustre/lustre/obdecho/echo_client.c    | 280 ++++++++++-----------
 .../staging/lustre/lustre/obdecho/echo_internal.h  |   4 +-
 2 files changed, 142 insertions(+), 142 deletions(-)
drivers/staging/lustre/lustre/obdecho/echo_client.c +140 -140
index 4f9dbc4..1ebd985 100644
@@ -52,41 +52,41 @@
  */
 
 struct echo_device {
-	struct cl_device	ed_cl;
-	struct echo_client_obd *ed_ec;
+	struct cl_device		ed_cl;
+	struct echo_client_obd	       *ed_ec;
 
-	struct cl_site	  ed_site_myself;
-	struct lu_site		*ed_site;
-	struct lu_device       *ed_next;
+	struct cl_site			ed_site_myself;
+	struct lu_site		       *ed_site;
+	struct lu_device	       *ed_next;
 };
 
 struct echo_object {
-	struct cl_object	eo_cl;
-	struct cl_object_header eo_hdr;
-
-	struct echo_device     *eo_dev;
-	struct list_head	      eo_obj_chain;
-	struct lov_oinfo       *eo_oinfo;
-	atomic_t	    eo_npages;
-	int		     eo_deleted;
+	struct cl_object		eo_cl;
+	struct cl_object_header		eo_hdr;
+
+	struct echo_device	       *eo_dev;
+	struct list_head		eo_obj_chain;
+	struct lov_oinfo	       *eo_oinfo;
+	atomic_t			eo_npages;
+	int				eo_deleted;
 };
 
 struct echo_object_conf {
-	struct cl_object_conf  eoc_cl;
-	struct lov_oinfo      **eoc_oinfo;
+	struct cl_object_conf		eoc_cl;
+	struct lov_oinfo	      **eoc_oinfo;
 };
 
 struct echo_page {
-	struct cl_page_slice   ep_cl;
-	unsigned long		ep_lock;
+	struct cl_page_slice		ep_cl;
+	unsigned long			ep_lock;
 };
 
 struct echo_lock {
-	struct cl_lock_slice   el_cl;
-	struct list_head	     el_chain;
-	struct echo_object    *el_object;
-	u64		  el_cookie;
-	atomic_t	   el_refcount;
+	struct cl_lock_slice		el_cl;
+	struct list_head		el_chain;
+	struct echo_object	       *el_object;
+	u64				el_cookie;
+	atomic_t			el_refcount;
 };
 
 static int echo_client_setup(const struct lu_env *env,
@@ -159,19 +159,19 @@ static int cl_echo_object_brw(struct echo_object *eco, int rw, u64 offset,
 			      struct page **pages, int npages, int async);
 
 struct echo_thread_info {
-	struct echo_object_conf eti_conf;
-	struct lustre_md	eti_md;
-
-	struct cl_2queue	eti_queue;
-	struct cl_io	    eti_io;
-	struct cl_lock          eti_lock;
-	struct lu_fid	   eti_fid;
-	struct lu_fid		eti_fid2;
+	struct echo_object_conf		eti_conf;
+	struct lustre_md		eti_md;
+
+	struct cl_2queue		eti_queue;
+	struct cl_io			eti_io;
+	struct cl_lock			eti_lock;
+	struct lu_fid			eti_fid;
+	struct lu_fid			eti_fid2;
 };
 
 /* No session used right now */
 struct echo_session_info {
-	unsigned long dummy;
+	unsigned long			dummy;
 };
 
 static struct kmem_cache *echo_lock_kmem;
@@ -288,20 +288,20 @@ static int echo_page_print(const struct lu_env *env,
 }
 
 static const struct cl_page_operations echo_page_ops = {
-	.cpo_own	   = echo_page_own,
-	.cpo_disown	= echo_page_disown,
-	.cpo_discard       = echo_page_discard,
-	.cpo_fini	  = echo_page_fini,
-	.cpo_print	 = echo_page_print,
-	.cpo_is_vmlocked   = echo_page_is_vmlocked,
+	.cpo_own		= echo_page_own,
+	.cpo_disown		= echo_page_disown,
+	.cpo_discard		= echo_page_discard,
+	.cpo_fini		= echo_page_fini,
+	.cpo_print		= echo_page_print,
+	.cpo_is_vmlocked	= echo_page_is_vmlocked,
 	.io = {
 		[CRT_READ] = {
 			.cpo_prep	= echo_page_prep,
-			.cpo_completion  = echo_page_completion,
+			.cpo_completion	= echo_page_completion,
 		},
 		[CRT_WRITE] = {
 			.cpo_prep	= echo_page_prep,
-			.cpo_completion  = echo_page_completion,
+			.cpo_completion	= echo_page_completion,
 		}
 	}
 };
@@ -324,7 +324,7 @@ static void echo_lock_fini(const struct lu_env *env,
 }
 
 static const struct cl_lock_operations echo_lock_ops = {
-	.clo_fini      = echo_lock_fini,
+	.clo_fini		= echo_lock_fini,
 };
 
 /** @} echo_lock */
@@ -383,10 +383,10 @@ static int echo_conf_set(const struct lu_env *env, struct cl_object *obj,
 }
 
 static const struct cl_object_operations echo_cl_obj_ops = {
-	.coo_page_init = echo_page_init,
-	.coo_lock_init = echo_lock_init,
-	.coo_io_init   = echo_io_init,
-	.coo_conf_set  = echo_conf_set
+	.coo_page_init		= echo_page_init,
+	.coo_lock_init		= echo_lock_init,
+	.coo_io_init		= echo_io_init,
+	.coo_conf_set		= echo_conf_set
 };
 
 /** @} echo_cl_ops */
@@ -400,15 +400,15 @@ static int echo_conf_set(const struct lu_env *env, struct cl_object *obj,
 static int echo_object_init(const struct lu_env *env, struct lu_object *obj,
 			    const struct lu_object_conf *conf)
 {
-	struct echo_device *ed	 = cl2echo_dev(lu2cl_dev(obj->lo_dev));
-	struct echo_client_obd *ec     = ed->ed_ec;
+	struct echo_device *ed = cl2echo_dev(lu2cl_dev(obj->lo_dev));
+	struct echo_client_obd *ec = ed->ed_ec;
 	struct echo_object *eco	= cl2echo_obj(lu2cl(obj));
 	const struct cl_object_conf *cconf;
 	struct echo_object_conf *econf;
 
 	if (ed->ed_next) {
-		struct lu_object  *below;
-		struct lu_device  *under;
+		struct lu_object *below;
+		struct lu_device *under;
 
 		under = ed->ed_next;
 		below = under->ld_ops->ldo_object_alloc(env, obj->lo_header,
@@ -442,7 +442,7 @@ static int echo_object_init(const struct lu_env *env, struct lu_object *obj,
 
 static void echo_object_free(const struct lu_env *env, struct lu_object *obj)
 {
-	struct echo_object *eco    = cl2echo_obj(lu2cl(obj));
+	struct echo_object *eco = cl2echo_obj(lu2cl(obj));
 	struct echo_client_obd *ec = eco->eo_dev->ed_ec;
 
 	LASSERT(atomic_read(&eco->eo_npages) == 0);
@@ -467,12 +467,12 @@ static int echo_object_print(const struct lu_env *env, void *cookie,
 }
 
 static const struct lu_object_operations echo_lu_obj_ops = {
-	.loo_object_init      = echo_object_init,
-	.loo_object_delete    = NULL,
-	.loo_object_release   = NULL,
-	.loo_object_free      = echo_object_free,
-	.loo_object_print     = echo_object_print,
-	.loo_object_invariant = NULL
+	.loo_object_init	= echo_object_init,
+	.loo_object_delete	= NULL,
+	.loo_object_release	= NULL,
+	.loo_object_free	= echo_object_free,
+	.loo_object_print	= echo_object_print,
+	.loo_object_invariant	= NULL
 };
 
 /** @} echo_lu_ops */
@@ -504,13 +504,13 @@ static struct lu_object *echo_object_alloc(const struct lu_env *env,
 		lu_object_add_top(&hdr->coh_lu, obj);
 
 		eco->eo_cl.co_ops = &echo_cl_obj_ops;
-		obj->lo_ops       = &echo_lu_obj_ops;
+		obj->lo_ops = &echo_lu_obj_ops;
 	}
 	return obj;
 }
 
 static const struct lu_device_operations echo_device_lu_ops = {
-	.ldo_object_alloc   = echo_object_alloc,
+	.ldo_object_alloc	= echo_object_alloc,
 };
 
 /** @} echo_lu_dev_ops */
@@ -571,9 +571,9 @@ static void echo_thread_key_fini(const struct lu_context *ctx,
 }
 
 static struct lu_context_key echo_thread_key = {
-	.lct_tags = LCT_CL_THREAD,
-	.lct_init = echo_thread_key_init,
-	.lct_fini = echo_thread_key_fini,
+	.lct_tags		= LCT_CL_THREAD,
+	.lct_init		= echo_thread_key_init,
+	.lct_fini		= echo_thread_key_fini,
 };
 
 static void *echo_session_key_init(const struct lu_context *ctx,
@@ -596,9 +596,9 @@ static void echo_session_key_fini(const struct lu_context *ctx,
 }
 
 static struct lu_context_key echo_session_key = {
-	.lct_tags = LCT_SESSION,
-	.lct_init = echo_session_key_init,
-	.lct_fini = echo_session_key_fini,
+	.lct_tags		= LCT_SESSION,
+	.lct_init		= echo_session_key_init,
+	.lct_fini		= echo_session_key_fini,
 };
 
 LU_TYPE_INIT_FINI(echo, &echo_thread_key, &echo_session_key);
@@ -607,11 +607,11 @@ static struct lu_device *echo_device_alloc(const struct lu_env *env,
 					   struct lu_device_type *t,
 					   struct lustre_cfg *cfg)
 {
-	struct lu_device   *next;
+	struct lu_device *next;
 	struct echo_device *ed;
-	struct cl_device   *cd;
-	struct obd_device  *obd = NULL; /* to keep compiler happy */
-	struct obd_device  *tgt;
+	struct cl_device *cd;
+	struct obd_device *obd = NULL; /* to keep compiler happy */
+	struct obd_device *tgt;
 	const char *tgt_type_name;
 	int rc, err;
 
@@ -729,10 +729,10 @@ static void echo_lock_release(const struct lu_env *env,
 static struct lu_device *echo_device_free(const struct lu_env *env,
 					  struct lu_device *d)
 {
-	struct echo_device     *ed   = cl2echo_dev(lu2cl_dev(d));
-	struct echo_client_obd *ec   = ed->ed_ec;
-	struct echo_object     *eco;
-	struct lu_device       *next = ed->ed_next;
+	struct echo_device *ed = cl2echo_dev(lu2cl_dev(d));
+	struct echo_client_obd *ec = ed->ed_ec;
+	struct echo_object *eco;
+	struct lu_device *next = ed->ed_next;
 
 	CDEBUG(D_INFO, "echo device:%p is going to be freed, next = %p\n",
 	       ed, next);
@@ -786,23 +786,23 @@ static struct lu_device *echo_device_free(const struct lu_env *env,
 }
 
 static const struct lu_device_type_operations echo_device_type_ops = {
-	.ldto_init = echo_type_init,
-	.ldto_fini = echo_type_fini,
+	.ldto_init		= echo_type_init,
+	.ldto_fini		= echo_type_fini,
 
-	.ldto_start = echo_type_start,
-	.ldto_stop  = echo_type_stop,
+	.ldto_start		= echo_type_start,
+	.ldto_stop		= echo_type_stop,
 
-	.ldto_device_alloc = echo_device_alloc,
-	.ldto_device_free  = echo_device_free,
-	.ldto_device_init  = echo_device_init,
-	.ldto_device_fini  = echo_device_fini
+	.ldto_device_alloc	= echo_device_alloc,
+	.ldto_device_free	= echo_device_free,
+	.ldto_device_init	= echo_device_init,
+	.ldto_device_fini	= echo_device_fini
 };
 
 static struct lu_device_type echo_device_type = {
-	.ldt_tags     = LU_DEVICE_CL,
-	.ldt_name     = LUSTRE_ECHO_CLIENT_NAME,
-	.ldt_ops      = &echo_device_type_ops,
-	.ldt_ctx_tags = LCT_CL_THREAD,
+	.ldt_tags		= LU_DEVICE_CL,
+	.ldt_name		= LUSTRE_ECHO_CLIENT_NAME,
+	.ldt_ops		= &echo_device_type_ops,
+	.ldt_ctx_tags		= LCT_CL_THREAD,
 };
 
 /** @} echo_init */
@@ -823,7 +823,7 @@ static struct lu_device *echo_device_free(const struct lu_env *env,
 	struct echo_object_conf *conf;
 	struct lov_oinfo *oinfo = NULL;
 	struct echo_object *eco;
-	struct cl_object   *obj;
+	struct cl_object *obj;
 	struct lu_fid *fid;
 	u16 refcheck;
 	int rc;
@@ -858,7 +858,7 @@ static struct lu_device *echo_device_free(const struct lu_env *env,
 	 */
 	conf->eoc_oinfo = &oinfo;
 
-	fid  = &info->eti_fid;
+	fid = &info->eti_fid;
 	rc = ostid_to_fid(fid, (struct ost_id *)oi, 0);
 	if (rc != 0) {
 		eco = ERR_PTR(rc);
@@ -928,10 +928,10 @@ static int __cl_echo_enqueue(struct lu_env *env, struct echo_object *eco,
 
 	memset(lck, 0, sizeof(*lck));
 	descr = &lck->cll_descr;
-	descr->cld_obj   = obj;
+	descr->cld_obj = obj;
 	descr->cld_start = cl_index(obj, start);
-	descr->cld_end   = cl_index(obj, end);
-	descr->cld_mode  = mode == LCK_PW ? CLM_WRITE : CLM_READ;
+	descr->cld_end = cl_index(obj, end);
+	descr->cld_mode = mode == LCK_PW ? CLM_WRITE : CLM_READ;
 	descr->cld_enq_flags = enqflags;
 	io->ci_obj = obj;
 
@@ -957,7 +957,7 @@ static int __cl_echo_cancel(struct lu_env *env, struct echo_device *ed,
 			    u64 cookie)
 {
 	struct echo_client_obd *ec = ed->ed_ec;
-	struct echo_lock       *ecl = NULL;
+	struct echo_lock *ecl = NULL;
 	int found = 0, still_used = 0;
 
 	spin_lock(&ec->ec_lock);
@@ -997,14 +997,14 @@ static void echo_commit_callback(const struct lu_env *env, struct cl_io *io,
 static int cl_echo_object_brw(struct echo_object *eco, int rw, u64 offset,
 			      struct page **pages, int npages, int async)
 {
-	struct lu_env	   *env;
+	struct lu_env *env;
 	struct echo_thread_info *info;
-	struct cl_object	*obj = echo_obj2cl(eco);
-	struct echo_device      *ed  = eco->eo_dev;
-	struct cl_2queue	*queue;
-	struct cl_io	    *io;
-	struct cl_page	  *clp;
-	struct lustre_handle    lh = { 0 };
+	struct cl_object *obj = echo_obj2cl(eco);
+	struct echo_device *ed  = eco->eo_dev;
+	struct cl_2queue *queue;
+	struct cl_io *io;
+	struct cl_page *clp;
+	struct lustre_handle lh = { 0 };
 	size_t page_size = cl_page_size(obj);
 	u16 refcheck;
 	int rc;
@@ -1016,9 +1016,9 @@ static int cl_echo_object_brw(struct echo_object *eco, int rw, u64 offset,
 	if (IS_ERR(env))
 		return PTR_ERR(env);
 
-	info    = echo_env_info(env);
-	io      = &info->eti_io;
-	queue   = &info->eti_queue;
+	info = echo_env_info(env);
+	io = &info->eti_io;
+	queue = &info->eti_queue;
 
 	cl_2queue_init(queue);
 
@@ -1097,10 +1097,10 @@ static int cl_echo_object_brw(struct echo_object *eco, int rw, u64 offset,
 static int echo_create_object(const struct lu_env *env, struct echo_device *ed,
 			      struct obdo *oa)
 {
-	struct echo_object     *eco;
+	struct echo_object *eco;
 	struct echo_client_obd *ec = ed->ed_ec;
-	int		     rc;
-	int		     created = 0;
+	int rc;
+	int created = 0;
 
 	if (!(oa->o_valid & OBD_MD_FLID) ||
 	    !(oa->o_valid & OBD_MD_FLGROUP) ||
@@ -1133,7 +1133,7 @@ static int echo_create_object(const struct lu_env *env, struct echo_device *ed,
 
 	CDEBUG(D_INFO, "oa oid " DOSTID "\n", POSTID(&oa->o_oi));
 
- failed:
+failed:
 	if (created && rc)
 		obd_destroy(env, ec->ec_exp, oa);
 	if (rc)
@@ -1144,8 +1144,8 @@ static int echo_create_object(const struct lu_env *env, struct echo_device *ed,
 static int echo_get_object(struct echo_object **ecop, struct echo_device *ed,
 			   struct obdo *oa)
 {
-	struct echo_object     *eco;
-	int		     rc;
+	struct echo_object *eco;
+	int rc;
 
 	if (!(oa->o_valid & OBD_MD_FLID) || !(oa->o_valid & OBD_MD_FLGROUP) ||
 	    !ostid_id(&oa->o_oi)) {
@@ -1176,10 +1176,10 @@ static void echo_put_object(struct echo_object *eco)
 echo_client_page_debug_setup(struct page *page, int rw, u64 id,
 			     u64 offset, u64 count)
 {
-	char    *addr;
-	u64	 stripe_off;
-	u64	 stripe_id;
-	int      delta;
+	char *addr;
+	u64 stripe_off;
+	u64 stripe_id;
+	int delta;
 
 	/* no partial pages on the client */
 	LASSERT(count == PAGE_SIZE);
@@ -1204,12 +1204,12 @@ static void echo_put_object(struct echo_object *eco)
 static int echo_client_page_debug_check(struct page *page, u64 id,
 					u64 offset, u64 count)
 {
-	u64	stripe_off;
-	u64	stripe_id;
-	char   *addr;
-	int     delta;
-	int     rc;
-	int     rc2;
+	u64 stripe_off;
+	u64 stripe_id;
+	char *addr;
+	int delta;
+	int rc;
+	int rc2;
 
 	/* no partial pages on the client */
 	LASSERT(count == PAGE_SIZE);
@@ -1237,16 +1237,16 @@ static int echo_client_kbrw(struct echo_device *ed, int rw, struct obdo *oa,
 			    struct echo_object *eco, u64 offset,
 			    u64 count, int async)
 {
-	u32	       npages;
+	u32 npages;
 	struct brw_page	*pga;
 	struct brw_page	*pgp;
-	struct page	    **pages;
-	u64		 off;
-	int		     i;
-	int		     rc;
-	int		     verify;
-	gfp_t		     gfp_mask;
-	int		     brw_flags = 0;
+	struct page **pages;
+	u64 off;
+	int i;
+	int rc;
+	int verify;
+	gfp_t gfp_mask;
+	int brw_flags = 0;
 
 	verify = (ostid_id(&oa->o_oi) != ECHO_PERSISTENT_OBJID &&
 		  (oa->o_valid & OBD_MD_FLFLAGS) != 0 &&
@@ -1301,7 +1301,7 @@ static int echo_client_kbrw(struct echo_device *ed, int rw, struct obdo *oa,
 	LASSERT(ed->ed_next);
 	rc = cl_echo_object_brw(eco, rw, offset, pages, npages, async);
 
- out:
+out:
 	if (rc != 0 || rw != OBD_BRW_READ)
 		verify = 0;
 
@@ -1474,16 +1474,16 @@ static int echo_client_brw_ioctl(const struct lu_env *env, int rw,
 echo_client_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
 		      void *karg, void __user *uarg)
 {
-	struct obd_device      *obd = exp->exp_obd;
-	struct echo_device     *ed = obd2echo_dev(obd);
+	struct obd_device *obd = exp->exp_obd;
+	struct echo_device *ed = obd2echo_dev(obd);
 	struct echo_client_obd *ec = ed->ed_ec;
-	struct echo_object     *eco;
-	struct obd_ioctl_data  *data = karg;
-	struct lu_env	  *env;
-	struct obdo	    *oa;
-	struct lu_fid	   fid;
-	int		     rw = OBD_BRW_READ;
-	int		     rc = 0;
+	struct echo_object *eco;
+	struct obd_ioctl_data *data = karg;
+	struct lu_env *env;
+	struct obdo *oa;
+	struct lu_fid fid;
+	int rw = OBD_BRW_READ;
+	int rc = 0;
 
 	oa = &data->ioc_obdo1;
 	if (!(oa->o_valid & OBD_MD_FLGROUP)) {
@@ -1652,7 +1652,7 @@ static int echo_client_connect(const struct lu_env *env,
 			       struct obd_device *src, struct obd_uuid *cluuid,
 			       struct obd_connect_data *data, void *localdata)
 {
-	int		rc;
+	int rc;
 	struct lustre_handle conn = { 0 };
 
 	rc = class_connect(&conn, src, cluuid);
@@ -1664,7 +1664,7 @@ static int echo_client_connect(const struct lu_env *env,
 
 static int echo_client_disconnect(struct obd_export *exp)
 {
-	int		     rc;
+	int rc;
 
 	if (!exp) {
 		rc = -EINVAL;
@@ -1673,15 +1673,15 @@ static int echo_client_disconnect(struct obd_export *exp)
 
 	rc = class_disconnect(exp);
 	goto out;
- out:
+out:
 	return rc;
 }
 
 static struct obd_ops echo_client_obd_ops = {
-	.owner          = THIS_MODULE,
-	.iocontrol      = echo_client_iocontrol,
-	.connect        = echo_client_connect,
-	.disconnect     = echo_client_disconnect
+	.owner			= THIS_MODULE,
+	.iocontrol		= echo_client_iocontrol,
+	.connect		= echo_client_connect,
+	.disconnect		= echo_client_disconnect
 };
 
 static int echo_client_init(void)
drivers/staging/lustre/lustre/obdecho/echo_internal.h +2 -2
index ac7a209..8094a94 100644
@@ -33,8 +33,8 @@
 #define _ECHO_INTERNAL_H
 
 /* The persistent object (i.e. actually stores stuff!) */
-#define ECHO_PERSISTENT_OBJID    1ULL
-#define ECHO_PERSISTENT_SIZE     ((u64)(1 << 20))
+#define ECHO_PERSISTENT_OBJID	1ULL
+#define ECHO_PERSISTENT_SIZE	((u64)(1 << 20))
 
 /* block size to use for data verification */
 #define OBD_ECHO_BLOCK_SIZE	(4 << 10)
Signature · 1 line
1.8.3.1
#18 lore raw

PATCH 18/26 osc: cleanup white spaces

In reply to James Simmons

The osc code is very messy and difficult to read. Remove excess white space and properly align data structures so they are easy on the eyes.

---
 drivers/staging/lustre/lustre/osc/lproc_osc.c      |  8 +--
 drivers/staging/lustre/lustre/osc/osc_cache.c      | 61 +++++++++++-----------
 .../staging/lustre/lustre/osc/osc_cl_internal.h    |  4 +-
 drivers/staging/lustre/lustre/osc/osc_dev.c        | 42 +++++++--------
 drivers/staging/lustre/lustre/osc/osc_io.c         | 32 ++++++------
 drivers/staging/lustre/lustre/osc/osc_lock.c       | 30 +++++------
 drivers/staging/lustre/lustre/osc/osc_object.c     | 28 +++++-----
 drivers/staging/lustre/lustre/osc/osc_page.c       |  8 +--
 drivers/staging/lustre/lustre/osc/osc_request.c    | 10 ++--
 9 files changed, 111 insertions(+), 112 deletions(-)
drivers/staging/lustre/lustre/osc/lproc_osc.c +4 -4
index 39a2a26..299a69f 100644
@@ -501,7 +501,7 @@ static ssize_t contention_seconds_show(struct kobject *kobj,
 {
 	struct obd_device *obd = container_of(kobj, struct obd_device,
 					      obd_kset.kobj);
-	struct osc_device *od  = obd2osc_dev(obd);
+	struct osc_device *od = obd2osc_dev(obd);
 
 	return sprintf(buf, "%u\n", od->od_contention_time);
 }
@@ -513,7 +513,7 @@ static ssize_t contention_seconds_store(struct kobject *kobj,
 {
 	struct obd_device *obd = container_of(kobj, struct obd_device,
 					      obd_kset.kobj);
-	struct osc_device *od  = obd2osc_dev(obd);
+	struct osc_device *od = obd2osc_dev(obd);
 	unsigned int val;
 	int rc;
 
@@ -533,7 +533,7 @@ static ssize_t lockless_truncate_show(struct kobject *kobj,
 {
 	struct obd_device *obd = container_of(kobj, struct obd_device,
 					      obd_kset.kobj);
-	struct osc_device *od  = obd2osc_dev(obd);
+	struct osc_device *od = obd2osc_dev(obd);
 
 	return sprintf(buf, "%u\n", od->od_lockless_truncate);
 }
@@ -545,7 +545,7 @@ static ssize_t lockless_truncate_store(struct kobject *kobj,
 {
 	struct obd_device *obd = container_of(kobj, struct obd_device,
 					      obd_kset.kobj);
-	struct osc_device *od  = obd2osc_dev(obd);
+	struct osc_device *od = obd2osc_dev(obd);
 	bool val;
 	int rc;
 
drivers/staging/lustre/lustre/osc/osc_cache.c +30 -31

114 lines not on this page · raw message

drivers/staging/lustre/lustre/osc/osc_cl_internal.h +2 -2
index c89c894..8bede94 100644
@@ -407,9 +407,9 @@ void osc_io_unplug(const struct lu_env *env, struct client_obd *cli,
 
 void osc_object_set_contended(struct osc_object *obj);
 void osc_object_clear_contended(struct osc_object *obj);
-int  osc_object_is_contended(struct osc_object *obj);
+int osc_object_is_contended(struct osc_object *obj);
 
-int  osc_lock_is_lockless(const struct osc_lock *olck);
+int osc_lock_is_lockless(const struct osc_lock *olck);
 
 /****************************************************************************
  *
drivers/staging/lustre/lustre/osc/osc_dev.c +21 -21

72 lines not on this page · raw message

drivers/staging/lustre/lustre/osc/osc_io.c +16 -16
index cf5b3cc..0b9ed01 100644
@@ -935,21 +935,21 @@ static void osc_io_end(const struct lu_env *env,
 		[CIT_READ] = {
 			.cio_iter_init	= osc_io_iter_init,
 			.cio_iter_fini	= osc_io_iter_fini,
-			.cio_start  = osc_io_read_start,
-			.cio_fini   = osc_io_fini
+			.cio_start	= osc_io_read_start,
+			.cio_fini	= osc_io_fini
 		},
 		[CIT_WRITE] = {
 			.cio_iter_init	= osc_io_write_iter_init,
 			.cio_iter_fini	= osc_io_write_iter_fini,
-			.cio_start  = osc_io_write_start,
-			.cio_end    = osc_io_end,
-			.cio_fini   = osc_io_fini
+			.cio_start	= osc_io_write_start,
+			.cio_end	= osc_io_end,
+			.cio_fini	= osc_io_fini
 		},
 		[CIT_SETATTR] = {
 			.cio_iter_init	= osc_io_iter_init,
 			.cio_iter_fini	= osc_io_iter_fini,
-			.cio_start  = osc_io_setattr_start,
-			.cio_end    = osc_io_setattr_end
+			.cio_start	= osc_io_setattr_start,
+			.cio_end	= osc_io_setattr_end
 		},
 		[CIT_DATA_VERSION] = {
 			.cio_start	= osc_io_data_version_start,
@@ -958,14 +958,14 @@ static void osc_io_end(const struct lu_env *env,
 		[CIT_FAULT] = {
 			.cio_iter_init	= osc_io_iter_init,
 			.cio_iter_fini	= osc_io_iter_fini,
-			.cio_start  = osc_io_fault_start,
-			.cio_end    = osc_io_end,
-			.cio_fini   = osc_io_fini
+			.cio_start	= osc_io_fault_start,
+			.cio_end	= osc_io_end,
+			.cio_fini	= osc_io_fini
 		},
 		[CIT_FSYNC] = {
-			.cio_start  = osc_io_fsync_start,
-			.cio_end    = osc_io_fsync_end,
-			.cio_fini   = osc_io_fini
+			.cio_start	= osc_io_fsync_start,
+			.cio_end	= osc_io_fsync_end,
+			.cio_fini	= osc_io_fini
 		},
 		[CIT_LADVISE] = {
 			.cio_start	= osc_io_ladvise_start,
@@ -973,12 +973,12 @@ static void osc_io_end(const struct lu_env *env,
 			.cio_fini	= osc_io_fini
 		},
 		[CIT_MISC] = {
-			.cio_fini   = osc_io_fini
+			.cio_fini	= osc_io_fini
 		}
 	},
 	.cio_read_ahead			= osc_io_read_ahead,
-	.cio_submit                 = osc_io_submit,
-	.cio_commit_async           = osc_io_commit_async
+	.cio_submit			= osc_io_submit,
+	.cio_commit_async		= osc_io_commit_async
 };
 
 /*****************************************************************************
drivers/staging/lustre/lustre/osc/osc_lock.c +15 -15
index 06d813e..5a1717c 100644
@@ -676,11 +676,11 @@ static unsigned long osc_lock_weight(const struct lu_env *env,
  */
 unsigned long osc_ldlm_weigh_ast(struct ldlm_lock *dlmlock)
 {
-	struct lu_env           *env;
-	struct osc_object	*obj;
-	struct osc_lock		*oscl;
-	unsigned long            weight;
-	bool			 found = false;
+	struct lu_env *env;
+	struct osc_object *obj;
+	struct osc_lock	*oscl;
+	unsigned long weight;
+	bool found = false;
 	u16 refcheck;
 
 	might_sleep();
@@ -739,9 +739,9 @@ static void osc_lock_build_einfo(const struct lu_env *env,
 				 struct ldlm_enqueue_info *einfo)
 {
 	einfo->ei_type = LDLM_EXTENT;
-	einfo->ei_mode   = osc_cl_lock2ldlm(lock->cll_descr.cld_mode);
+	einfo->ei_mode = osc_cl_lock2ldlm(lock->cll_descr.cld_mode);
 	einfo->ei_cb_bl = osc_ldlm_blocking_ast;
-	einfo->ei_cb_cp  = ldlm_completion_ast;
+	einfo->ei_cb_cp = ldlm_completion_ast;
 	einfo->ei_cb_gl = osc_ldlm_glimpse_ast;
 	einfo->ei_cbdata = osc; /* value to be put into ->l_ast_data */
 }
@@ -814,9 +814,9 @@ static bool osc_lock_compatible(const struct osc_lock *qing,
 	if (qed->ols_state < OLS_GRANTED)
 		return true;
 
-	if (qed_descr->cld_mode  >= qing_descr->cld_mode &&
+	if (qed_descr->cld_mode >= qing_descr->cld_mode &&
 	    qed_descr->cld_start <= qing_descr->cld_start &&
-	    qed_descr->cld_end   >= qing_descr->cld_end)
+	    qed_descr->cld_end >= qing_descr->cld_end)
 		return true;
 
 	return false;
@@ -865,7 +865,7 @@ static int osc_lock_enqueue_wait(const struct lu_env *env,
 
 		descr = &tmp_oscl->ols_cl.cls_lock->cll_descr;
 		if (descr->cld_start > need->cld_end ||
-		    descr->cld_end   < need->cld_start)
+		    descr->cld_end < need->cld_start)
 			continue;
 
 		/* We're not supposed to give up group lock */
@@ -1053,7 +1053,7 @@ static void osc_lock_detach(const struct lu_env *env, struct osc_lock *olck)
 static void osc_lock_cancel(const struct lu_env *env,
 			    const struct cl_lock_slice *slice)
 {
-	struct osc_object *obj  = cl2osc(slice->cls_obj);
+	struct osc_object *obj = cl2osc(slice->cls_obj);
 	struct osc_lock *oscl = cl2osc_lock(slice);
 
 	LINVRNT(osc_lock_invariant(oscl));
@@ -1078,10 +1078,10 @@ static int osc_lock_print(const struct lu_env *env, void *cookie,
 }
 
 static const struct cl_lock_operations osc_lock_ops = {
-	.clo_fini    = osc_lock_fini,
-	.clo_enqueue = osc_lock_enqueue,
-	.clo_cancel  = osc_lock_cancel,
-	.clo_print   = osc_lock_print,
+	.clo_fini	= osc_lock_fini,
+	.clo_enqueue	= osc_lock_enqueue,
+	.clo_cancel	= osc_lock_cancel,
+	.clo_print	= osc_lock_print,
 };
 
 static void osc_lock_lockless_cancel(const struct lu_env *env,
drivers/staging/lustre/lustre/osc/osc_object.c +14 -14
index 1097380..98a0b6c 100644
@@ -198,8 +198,8 @@ static int osc_object_ast_clear(struct ldlm_lock *lock, void *data)
 
 static int osc_object_prune(const struct lu_env *env, struct cl_object *obj)
 {
-	struct osc_object       *osc = cl2osc(obj);
-	struct ldlm_res_id      *resname = &osc_env_info(env)->oti_resname;
+	struct osc_object *osc = cl2osc(obj);
+	struct ldlm_res_id *resname = &osc_env_info(env)->oti_resname;
 
 	/* DLM locks don't hold a reference of osc_object so we have to
 	 * clear it before the object is being destroyed.
@@ -413,23 +413,23 @@ static void osc_req_attr_set(const struct lu_env *env, struct cl_object *obj,
 }
 
 static const struct cl_object_operations osc_ops = {
-	.coo_page_init = osc_page_init,
-	.coo_lock_init = osc_lock_init,
-	.coo_io_init   = osc_io_init,
-	.coo_attr_get  = osc_attr_get,
-	.coo_attr_update = osc_attr_update,
-	.coo_glimpse   = osc_object_glimpse,
-	.coo_prune	 = osc_object_prune,
+	.coo_page_init		= osc_page_init,
+	.coo_lock_init		= osc_lock_init,
+	.coo_io_init		= osc_io_init,
+	.coo_attr_get		= osc_attr_get,
+	.coo_attr_update	= osc_attr_update,
+	.coo_glimpse		= osc_object_glimpse,
+	.coo_prune		= osc_object_prune,
 	.coo_fiemap		= osc_object_fiemap,
 	.coo_req_attr_set	= osc_req_attr_set
 };
 
 static const struct lu_object_operations osc_lu_obj_ops = {
-	.loo_object_init      = osc_object_init,
-	.loo_object_release   = NULL,
-	.loo_object_free      = osc_object_free,
-	.loo_object_print     = osc_object_print,
-	.loo_object_invariant = NULL
+	.loo_object_init	= osc_object_init,
+	.loo_object_release	= NULL,
+	.loo_object_free	= osc_object_free,
+	.loo_object_print	= osc_object_print,
+	.loo_object_invariant	= NULL
 };
 
 struct lu_object *osc_object_alloc(const struct lu_env *env,
drivers/staging/lustre/lustre/osc/osc_page.c +4 -4
index e0187fa..71f5485 100644
@@ -227,10 +227,10 @@ static int osc_page_flush(const struct lu_env *env,
 }
 
 static const struct cl_page_operations osc_page_ops = {
-	.cpo_print	 = osc_page_print,
+	.cpo_print	= osc_page_print,
 	.cpo_delete	= osc_page_delete,
-	.cpo_clip	   = osc_page_clip,
-	.cpo_flush	  = osc_page_flush
+	.cpo_clip	= osc_page_clip,
+	.cpo_flush	= osc_page_flush
 };
 
 int osc_page_init(const struct lu_env *env, struct cl_object *obj,
@@ -931,7 +931,7 @@ void osc_dec_unstable_pages(struct ptlrpc_request *req)
  */
 void osc_inc_unstable_pages(struct ptlrpc_request *req)
 {
-	struct client_obd *cli  = &req->rq_import->imp_obd->u.cli;
+	struct client_obd *cli = &req->rq_import->imp_obd->u.cli;
 	struct ptlrpc_bulk_desc *desc = req->rq_bulk;
 	long page_count = desc->bd_iov_count;
 
drivers/staging/lustre/lustre/osc/osc_request.c +5 -5
index e92c8ac..86f9de6 100644
@@ -162,7 +162,7 @@ static int osc_getattr(const struct lu_env *env, struct obd_export *exp,
 	oa->o_blksize = cli_brw_size(exp->exp_obd);
 	oa->o_valid |= OBD_MD_FLBLKSZ;
 
- out:
+out:
 	ptlrpc_req_finished(req);
 	return rc;
 }
@@ -1322,7 +1322,7 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,
 
 	return 0;
 
- out:
+out:
 	ptlrpc_req_finished(req);
 	return rc;
 }
@@ -1753,7 +1753,7 @@ static int brw_interpret(const struct lu_env *env,
 
 	if (rc == 0) {
 		struct obdo *oa = aa->aa_oa;
-		struct cl_attr *attr  = &osc_env_info(env)->oti_attr;
+		struct cl_attr *attr = &osc_env_info(env)->oti_attr;
 		unsigned long valid = 0;
 		struct cl_object *obj;
 		struct osc_async_page *last;
@@ -2260,7 +2260,7 @@ int osc_enqueue_base(struct obd_export *exp, struct ldlm_res_id *res_id,
 			lustre_handle_copy(&aa->oa_lockh, &lockh);
 			aa->oa_upcall = upcall;
 			aa->oa_cookie = cookie;
-			aa->oa_agl    = !!agl;
+			aa->oa_agl = !!agl;
 			if (!agl) {
 				aa->oa_flags = flags;
 				aa->oa_lvb = lvb;
@@ -2474,7 +2474,7 @@ static int osc_statfs(const struct lu_env *env, struct obd_export *exp,
 
 	*osfs = *msfs;
 
- out:
+out:
 	ptlrpc_req_finished(req);
 	return rc;
 }
Signature · 1 line
1.8.3.1
#19 lore raw

PATCH 19/26 ptlrpc: cleanup white spaces

In reply to James Simmons

The ptlrpc code is very messy and difficult to read. Remove excess white space and properly align data structures so they are easy on the eyes.

---
 drivers/staging/lustre/lustre/ptlrpc/client.c      |  45 ++--
 drivers/staging/lustre/lustre/ptlrpc/import.c      |   2 +-
 drivers/staging/lustre/lustre/ptlrpc/layout.c      |   3 -
 .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c    | 278 ++++++++++-----------
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c      |   7 +-
 drivers/staging/lustre/lustre/ptlrpc/nrs.c         |   1 -
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |  14 +-
 drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c     |  20 +-
 drivers/staging/lustre/lustre/ptlrpc/recover.c     |   1 +
 drivers/staging/lustre/lustre/ptlrpc/sec.c         |   4 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c    |  74 +++---
 drivers/staging/lustre/lustre/ptlrpc/sec_config.c  |  22 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_null.c    |  34 +--
 drivers/staging/lustre/lustre/ptlrpc/sec_plain.c   |  68 ++---
 drivers/staging/lustre/lustre/ptlrpc/service.c     |  20 +-
 15 files changed, 293 insertions(+), 300 deletions(-)
drivers/staging/lustre/lustre/ptlrpc/client.c +21 -24
index f4b3875..0831810 100644
@@ -49,14 +49,14 @@
 #include "ptlrpc_internal.h"
 
 const struct ptlrpc_bulk_frag_ops ptlrpc_bulk_kiov_pin_ops = {
-	.add_kiov_frag	= ptlrpc_prep_bulk_page_pin,
-	.release_frags	= ptlrpc_release_bulk_page_pin,
+	.add_kiov_frag		= ptlrpc_prep_bulk_page_pin,
+	.release_frags		= ptlrpc_release_bulk_page_pin,
 };
 EXPORT_SYMBOL(ptlrpc_bulk_kiov_pin_ops);
 
 const struct ptlrpc_bulk_frag_ops ptlrpc_bulk_kiov_nopin_ops = {
-	.add_kiov_frag	= ptlrpc_prep_bulk_page_nopin,
-	.release_frags	= NULL,
+	.add_kiov_frag		= ptlrpc_prep_bulk_page_nopin,
+	.release_frags		= NULL,
 };
 EXPORT_SYMBOL(ptlrpc_bulk_kiov_nopin_ops);
 
@@ -658,15 +658,14 @@ static void __ptlrpc_free_req_to_pool(struct ptlrpc_request *request)
 
 void ptlrpc_add_unreplied(struct ptlrpc_request *req)
 {
-	struct obd_import	*imp = req->rq_import;
-	struct ptlrpc_request	*iter;
+	struct obd_import *imp = req->rq_import;
+	struct ptlrpc_request *iter;
 
 	assert_spin_locked(&imp->imp_lock);
 	LASSERT(list_empty(&req->rq_unreplied_list));
 
 	/* unreplied list is sorted by xid in ascending order */
 	list_for_each_entry_reverse(iter, &imp->imp_unreplied_list, rq_unreplied_list) {
-
 		LASSERT(req->rq_xid != iter->rq_xid);
 		if (req->rq_xid < iter->rq_xid)
 			continue;
@@ -1318,10 +1317,10 @@ static int after_reply(struct ptlrpc_request *req)
 		 * reply).  NB: no need to round up because alloc_repbuf will
 		 * round it up
 		 */
-		req->rq_replen       = req->rq_nob_received;
+		req->rq_replen = req->rq_nob_received;
 		req->rq_nob_received = 0;
 		spin_lock(&req->rq_lock);
-		req->rq_resend       = 1;
+		req->rq_resend = 1;
 		spin_unlock(&req->rq_lock);
 		return 0;
 	}
@@ -1359,7 +1358,7 @@ static int after_reply(struct ptlrpc_request *req)
 		spin_unlock(&req->rq_lock);
 		req->rq_nr_resend++;
 
-		/* Readjust the timeout for current conditions */
+		/* Read just the timeout for current conditions */
 		ptlrpc_at_set_req_timeout(req);
 		/*
 		 * delay resend to give a chance to the server to get ready.
@@ -1620,7 +1619,7 @@ static inline int ptlrpc_set_producer(struct ptlrpc_request_set *set)
 		rc = set->set_producer(set, set->set_producer_arg);
 		if (rc == -ENOENT) {
 			/* no more RPC to produce */
-			set->set_producer     = NULL;
+			set->set_producer = NULL;
 			set->set_producer_arg = NULL;
 			return 0;
 		}
@@ -1654,7 +1653,7 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
 
 		/*
 		 * This schedule point is mainly for the ptlrpcd caller of this
-		 * function.  Most ptlrpc sets are not long-lived and unbounded
+		 * function. Most ptlrpc sets are not long-lived and unbounded
 		 * in length, but at the least the set used by the ptlrpcd is.
 		 * Since the processing time is unbounded, we need to insert an
 		 * explicit schedule point to make the thread well-behaved.
@@ -2130,7 +2129,6 @@ void ptlrpc_expired_set(struct ptlrpc_request_set *set)
 
 	/* A timeout expired. See which reqs it applies to...  */
 	list_for_each_entry(req, &set->set_requests, rq_set_chain) {
-
 		/* don't expire request waiting for context */
 		if (req->rq_wait_ctx)
 			continue;
@@ -2185,7 +2183,6 @@ int ptlrpc_set_next_timeout(struct ptlrpc_request_set *set)
 	time64_t deadline;
 
 	list_for_each_entry(req, &set->set_requests, rq_set_chain) {
-
 		/* Request in-flight? */
 		if (!(((req->rq_phase == RQ_PHASE_RPC) && !req->rq_waiting) ||
 		      (req->rq_phase == RQ_PHASE_BULK) ||
@@ -2568,7 +2565,7 @@ static void ptlrpc_free_request(struct ptlrpc_request *req)
  */
 void ptlrpc_request_committed(struct ptlrpc_request *req, int force)
 {
-	struct obd_import	*imp = req->rq_import;
+	struct obd_import *imp = req->rq_import;
 
 	spin_lock(&imp->imp_lock);
 	if (list_empty(&req->rq_replay_list)) {
@@ -2896,7 +2893,7 @@ static int ptlrpc_replay_interpret(const struct lu_env *env,
 
 	/* continue with recovery */
 	rc = ptlrpc_import_recovery_state_machine(imp);
- out:
+out:
 	req->rq_send_state = aa->praa_old_state;
 
 	if (rc != 0)
@@ -3031,7 +3028,7 @@ void ptlrpc_abort_set(struct ptlrpc_request_set *set)
 /**
  * Initialize the XID for the node.  This is common among all requests on
  * this node, and only requires the property that it is monotonically
- * increasing.  It does not need to be sequential.  Since this is also used
+ * increasing. It does not need to be sequential.  Since this is also used
  * as the RDMA match bits, it is important that a single client NOT have
  * the same match bits for two different in-flight requests, hence we do
  * NOT want to have an XID per target or similar.
@@ -3198,12 +3195,12 @@ struct ptlrpc_work_async_args {
 static void ptlrpcd_add_work_req(struct ptlrpc_request *req)
 {
 	/* re-initialize the req */
-	req->rq_timeout		= obd_timeout;
-	req->rq_sent		= ktime_get_real_seconds();
-	req->rq_deadline	= req->rq_sent + req->rq_timeout;
-	req->rq_phase		= RQ_PHASE_INTERPRET;
-	req->rq_next_phase	= RQ_PHASE_COMPLETE;
-	req->rq_xid		= ptlrpc_next_xid();
+	req->rq_timeout	= obd_timeout;
+	req->rq_sent = ktime_get_real_seconds();
+	req->rq_deadline = req->rq_sent + req->rq_timeout;
+	req->rq_phase = RQ_PHASE_INTERPRET;
+	req->rq_next_phase = RQ_PHASE_COMPLETE;
+	req->rq_xid = ptlrpc_next_xid();
 	req->rq_import_generation = req->rq_import->imp_generation;
 
 	ptlrpcd_add_req(req);
@@ -3241,7 +3238,7 @@ static int ptlrpcd_check_work(struct ptlrpc_request *req)
 void *ptlrpcd_alloc_work(struct obd_import *imp,
 			 int (*cb)(const struct lu_env *, void *), void *cbdata)
 {
-	struct ptlrpc_request	 *req = NULL;
+	struct ptlrpc_request *req = NULL;
 	struct ptlrpc_work_async_args *args;
 
 	might_sleep();
drivers/staging/lustre/lustre/ptlrpc/import.c +1 -1
index 56a0b76..7bb2e06 100644
@@ -51,7 +51,7 @@
 #include "ptlrpc_internal.h"
 
 struct ptlrpc_connect_async_args {
-	 u64 pcaa_peer_committed;
+	u64 pcaa_peer_committed;
 	int pcaa_initial_connect;
 };
 
drivers/staging/lustre/lustre/ptlrpc/layout.c +0 -3
index 2848f2f..f1f7d70 100644
@@ -1907,9 +1907,7 @@ static void *__req_capsule_get(struct req_capsule *pill,
 	void *value;
 	u32 len;
 	u32 offset;
-
 	void *(*getter)(struct lustre_msg *m, u32 n, u32 minlen);
-
 	static const char *rcl_names[RCL_NR] = {
 		[RCL_CLIENT] = "client",
 		[RCL_SERVER] = "server"
@@ -2176,7 +2174,6 @@ void req_capsule_extend(struct req_capsule *pill, const struct req_format *fmt)
 {
 	int i;
 	size_t j;
-
 	const struct req_format *old;
 
 	LASSERT(pill->rc_fmt);
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +139 -139

330 lines not on this page · raw message

drivers/staging/lustre/lustre/ptlrpc/niobuf.c +4 -3
index d3044a7..ea7a7f9 100644
@@ -280,6 +280,7 @@ int ptlrpc_unregister_bulk(struct ptlrpc_request *req, int async)
 		 * timeout lets us CWARN for visibility of sluggish LNDs
 		 */
 		int cnt = 0;
+
 		while (cnt < LONG_UNLINK &&
 		       (rc = wait_event_idle_timeout(*wq,
 						     !ptlrpc_client_bulk_active(req),
@@ -685,7 +686,7 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
 	 * add the network latency for our local timeout.
 	 */
 	request->rq_deadline = request->rq_sent + request->rq_timeout +
-		ptlrpc_at_get_net_latency(request);
+			       ptlrpc_at_get_net_latency(request);
 
 	ptlrpc_pinger_sending_on_import(imp);
 
@@ -705,7 +706,7 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
 	if (noreply)
 		goto out;
 
- cleanup_me:
+cleanup_me:
 	/* MEUnlink is safe; the PUT didn't even get off the ground, and
 	 * nobody apart from the PUT's target has the right nid+XID to
 	 * access the reply buffer.
@@ -715,7 +716,7 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
 	/* UNLINKED callback called synchronously */
 	LASSERT(!request->rq_receiving_reply);
 
- cleanup_bulk:
+cleanup_bulk:
 	/* We do sync unlink here as there was no real transfer here so
 	 * the chance to have long unlink to sluggish net is smaller here.
 	 */
drivers/staging/lustre/lustre/ptlrpc/nrs.c +0 -1
index 248ba04..ef7dd5d 100644
@@ -118,7 +118,6 @@ static int nrs_policy_stop_locked(struct ptlrpc_nrs_policy *policy)
 	/* Immediately make it invisible */
 	if (nrs->nrs_policy_primary == policy) {
 		nrs->nrs_policy_primary = NULL;
-
 	} else {
 		LASSERT(nrs->nrs_policy_fallback == policy);
 		nrs->nrs_policy_fallback = NULL;
drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +7 -7
index 10c2520..5383b68 100644
@@ -111,12 +111,12 @@ struct nrs_core {
 	 * Protects nrs_core::nrs_policies, serializes external policy
 	 * registration/unregistration, and NRS core lprocfs operations.
 	 */
-	struct mutex nrs_mutex;
+	struct mutex		nrs_mutex;
 	/**
 	 * List of all policy descriptors registered with NRS core; protected
 	 * by nrs_core::nrs_mutex.
 	 */
-	struct list_head nrs_policies;
+	struct list_head	nrs_policies;
 
 };
 
@@ -251,15 +251,15 @@ struct ptlrpc_reply_state *
 void ptlrpc_pinger_wake_up(void);
 
 /* sec_null.c */
-int  sptlrpc_null_init(void);
+int sptlrpc_null_init(void);
 void sptlrpc_null_fini(void);
 
 /* sec_plain.c */
-int  sptlrpc_plain_init(void);
+int sptlrpc_plain_init(void);
 void sptlrpc_plain_fini(void);
 
 /* sec_bulk.c */
-int  sptlrpc_enc_pool_init(void);
+int sptlrpc_enc_pool_init(void);
 void sptlrpc_enc_pool_fini(void);
 int sptlrpc_proc_enc_pool_seq_show(struct seq_file *m, void *v);
 
@@ -277,11 +277,11 @@ void sptlrpc_conf_choose_flavor(enum lustre_sec_part from,
 				struct obd_uuid *target,
 				lnet_nid_t nid,
 				struct sptlrpc_flavor *sf);
-int  sptlrpc_conf_init(void);
+int sptlrpc_conf_init(void);
 void sptlrpc_conf_fini(void);
 
 /* sec.c */
-int  sptlrpc_init(void);
+int sptlrpc_init(void);
 void sptlrpc_fini(void);
 
 /* layout.c */
drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c +10 -10
index e39c38a..f0ac296 100644
@@ -69,13 +69,13 @@
 
 /* One of these per CPT. */
 struct ptlrpcd {
-	int pd_size;
-	int pd_index;
-	int pd_cpt;
-	int pd_cursor;
-	int pd_nthreads;
-	int pd_groupsize;
-	struct ptlrpcd_ctl pd_threads[0];
+	int			pd_size;
+	int			pd_index;
+	int			pd_cpt;
+	int			pd_cursor;
+	int			pd_nthreads;
+	int			pd_groupsize;
+	struct ptlrpcd_ctl	pd_threads[0];
 };
 
 /*
@@ -171,9 +171,9 @@ void ptlrpcd_wake(struct ptlrpc_request *req)
 static struct ptlrpcd_ctl *
 ptlrpcd_select_pc(struct ptlrpc_request *req)
 {
-	struct ptlrpcd	*pd;
-	int		cpt;
-	int		idx;
+	struct ptlrpcd *pd;
+	int cpt;
+	int idx;
 
 	if (req && req->rq_send_state != LUSTRE_IMP_FULL)
 		return &ptlrpcd_rcv;
drivers/staging/lustre/lustre/ptlrpc/recover.c +1 -0
index ed769a4..af672ab 100644
@@ -119,6 +119,7 @@ int ptlrpc_replay_next(struct obd_import *imp, int *inflight)
 	 */
 	if (!req) {
 		struct ptlrpc_request *tmp;
+
 		list_for_each_entry_safe(tmp, pos, &imp->imp_replay_list,
 					 rq_replay_list) {
 			if (tmp->rq_transno > last_transno) {
drivers/staging/lustre/lustre/ptlrpc/sec.c +2 -2
index 165082a..6dc7731 100644
@@ -171,7 +171,7 @@ u32 sptlrpc_name2flavor_base(const char *name)
 
 const char *sptlrpc_flavor2name_base(u32 flvr)
 {
-	u32   base = SPTLRPC_FLVR_BASE(flvr);
+	u32 base = SPTLRPC_FLVR_BASE(flvr);
 
 	if (base == SPTLRPC_FLVR_BASE(SPTLRPC_FLVR_NULL))
 		return "null";
@@ -365,7 +365,7 @@ int sptlrpc_req_get_ctx(struct ptlrpc_request *req)
 {
 	struct obd_import *imp = req->rq_import;
 	struct ptlrpc_sec *sec;
-	int		rc;
+	int rc;
 
 	LASSERT(!req->rq_cli_ctx);
 	LASSERT(imp);
drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c +37 -37

127 lines not on this page · raw message

drivers/staging/lustre/lustre/ptlrpc/sec_config.c +11 -11
index 1844ada..54130ae 100644
@@ -408,19 +408,19 @@ static int sptlrpc_rule_set_choose(struct sptlrpc_rule_set *rset,
  **********************************/
 
 struct sptlrpc_conf_tgt {
-	struct list_head	      sct_list;
-	char		    sct_name[MAX_OBD_NAME];
-	struct sptlrpc_rule_set sct_rset;
+	struct list_head		sct_list;
+	char				sct_name[MAX_OBD_NAME];
+	struct sptlrpc_rule_set		sct_rset;
 };
 
 struct sptlrpc_conf {
-	struct list_head	      sc_list;
-	char		    sc_fsname[MTI_NAME_MAXLEN];
-	unsigned int	    sc_modified;  /* modified during updating */
-	unsigned int	    sc_updated:1, /* updated copy from MGS */
-				sc_local:1;   /* local copy from target */
-	struct sptlrpc_rule_set sc_rset;      /* fs general rules */
-	struct list_head	      sc_tgts;      /* target-specific rules */
+	struct list_head		sc_list;
+	char				sc_fsname[MTI_NAME_MAXLEN];
+	unsigned int			sc_modified;	/* modified during updating */
+	unsigned int			sc_updated:1,	/* updated copy from MGS */
+					sc_local:1;	/* local copy from target */
+	struct sptlrpc_rule_set		sc_rset;	/* fs general rules */
+	struct list_head		sc_tgts;	/* target-specific rules */
 };
 
 static struct mutex sptlrpc_conf_lock;
@@ -801,7 +801,7 @@ void sptlrpc_conf_choose_flavor(enum lustre_sec_part from,
 	flavor_set_flags(sf, from, to, 1);
 }
 
-#define SEC_ADAPT_DELAY	 (10)
+#define SEC_ADAPT_DELAY		(10)
 
 /**
  * called by client devices, notify the sptlrpc config has changed and
drivers/staging/lustre/lustre/ptlrpc/sec_null.c +17 -17
index 6933a53..df6ef4f 100644
@@ -277,8 +277,8 @@ int null_enlarge_reqbuf(struct ptlrpc_sec *sec,
 }
 
 static struct ptlrpc_svc_ctx null_svc_ctx = {
-	.sc_refcount    = ATOMIC_INIT(1),
-	.sc_policy      = &null_policy,
+	.sc_refcount	= ATOMIC_INIT(1),
+	.sc_policy	= &null_policy,
 };
 
 static
@@ -373,33 +373,33 @@ int null_authorize(struct ptlrpc_request *req)
 
 static struct ptlrpc_ctx_ops null_ctx_ops = {
 	.refresh		= null_ctx_refresh,
-	.sign		   = null_ctx_sign,
-	.verify		 = null_ctx_verify,
+	.sign			= null_ctx_sign,
+	.verify			= null_ctx_verify,
 };
 
 static struct ptlrpc_sec_cops null_sec_cops = {
-	.create_sec	     = null_create_sec,
-	.destroy_sec	    = null_destroy_sec,
-	.lookup_ctx	     = null_lookup_ctx,
+	.create_sec		= null_create_sec,
+	.destroy_sec		= null_destroy_sec,
+	.lookup_ctx		= null_lookup_ctx,
 	.flush_ctx_cache	= null_flush_ctx_cache,
-	.alloc_reqbuf	   = null_alloc_reqbuf,
-	.alloc_repbuf	   = null_alloc_repbuf,
-	.free_reqbuf	    = null_free_reqbuf,
-	.free_repbuf	    = null_free_repbuf,
-	.enlarge_reqbuf	 = null_enlarge_reqbuf,
+	.alloc_reqbuf		= null_alloc_reqbuf,
+	.alloc_repbuf		= null_alloc_repbuf,
+	.free_reqbuf		= null_free_reqbuf,
+	.free_repbuf		= null_free_repbuf,
+	.enlarge_reqbuf		= null_enlarge_reqbuf,
 };
 
 static struct ptlrpc_sec_sops null_sec_sops = {
-	.accept		 = null_accept,
-	.alloc_rs	       = null_alloc_rs,
-	.authorize	      = null_authorize,
+	.accept			= null_accept,
+	.alloc_rs		= null_alloc_rs,
+	.authorize		= null_authorize,
 	.free_rs		= null_free_rs,
 };
 
 static struct ptlrpc_sec_policy null_policy = {
-	.sp_owner	       = THIS_MODULE,
+	.sp_owner		= THIS_MODULE,
 	.sp_name		= "sec.null",
-	.sp_policy	      = SPTLRPC_POLICY_NULL,
+	.sp_policy		= SPTLRPC_POLICY_NULL,
 	.sp_cops		= &null_sec_cops,
 	.sp_sops		= &null_sec_sops,
 };
drivers/staging/lustre/lustre/ptlrpc/sec_plain.c +34 -34

106 lines not on this page · raw message

drivers/staging/lustre/lustre/ptlrpc/service.c +9 -11
index 1030f65..5b97f2a 100644
@@ -173,7 +173,7 @@
 	       svc->srv_name, i, svc->srv_buf_size, svcpt->scp_nrqbds_posted,
 	       svcpt->scp_nrqbds_total, rc);
 
- try_post:
+try_post:
 	if (post && rc == 0)
 		rc = ptlrpc_server_post_idle_rqbds(svcpt);
 
@@ -185,8 +185,8 @@
 struct ptlrpc_hr_thread {
 	int				hrt_id;		/* thread ID */
 	spinlock_t			hrt_lock;
-	wait_queue_head_t			hrt_waitq;
-	struct list_head			hrt_queue;	/* RS queue */
+	wait_queue_head_t		hrt_waitq;
+	struct list_head		hrt_queue;	/* RS queue */
 	struct ptlrpc_hr_partition	*hrt_partition;
 };
 
@@ -212,7 +212,7 @@ struct ptlrpc_hr_service {
 	/* CPU partition table, it's just cfs_cpt_tab for now */
 	struct cfs_cpt_table		*hr_cpt_table;
 	/** controller sleep waitq */
-	wait_queue_head_t			hr_waitq;
+	wait_queue_head_t		hr_waitq;
 	unsigned int			hr_stopping;
 	/** roundrobin rotor for non-affinity service */
 	unsigned int			hr_rotor;
@@ -236,7 +236,6 @@ struct ptlrpc_hr_service {
 	    svcpt->scp_service->srv_cptable == ptlrpc_hr.hr_cpt_table) {
 		/* directly match partition */
 		hrp = ptlrpc_hr.hr_partitions[svcpt->scp_cpt];
-
 	} else {
 		rotor = ptlrpc_hr.hr_rotor++;
 		rotor %= cfs_cpt_number(ptlrpc_hr.hr_cpt_table);
@@ -440,7 +439,7 @@ static void ptlrpc_at_timer(struct timer_list *t)
 		nthrs = max(tc->tc_nthrs_base,
 			    tc->tc_nthrs_max / svc->srv_ncpts);
 	}
- out:
+out:
 	nthrs = max(nthrs, tc->tc_nthrs_init);
 	svc->srv_nthrs_cpt_limit = nthrs;
 	svc->srv_nthrs_cpt_init = init;
@@ -459,7 +458,7 @@ static void ptlrpc_at_timer(struct timer_list *t)
 ptlrpc_service_part_init(struct ptlrpc_service *svc,
 			 struct ptlrpc_service_part *svcpt, int cpt)
 {
-	struct ptlrpc_at_array	*array;
+	struct ptlrpc_at_array *array;
 	int size;
 	int index;
 	int rc;
@@ -1125,7 +1124,6 @@ static int ptlrpc_at_send_early_reply(struct ptlrpc_request *req)
 		goto out_put;
 
 	rc = ptlrpc_send_reply(reqcopy, PTLRPC_REPLY_EARLY);
-
 	if (!rc) {
 		/* Adjust our own deadline to what we told the client */
 		req->rq_deadline = newdl;
@@ -1316,7 +1314,7 @@ static void ptlrpc_server_hpreq_fini(struct ptlrpc_request *req)
 static int ptlrpc_server_request_add(struct ptlrpc_service_part *svcpt,
 				     struct ptlrpc_request *req)
 {
-	int	rc;
+	int rc;
 
 	rc = ptlrpc_server_hpreq_init(svcpt, req);
 	if (rc < 0)
@@ -2412,7 +2410,7 @@ int ptlrpc_start_threads(struct ptlrpc_service *svc)
 	}
 
 	return 0;
- failed:
+failed:
 	CERROR("cannot start %s thread #%d_%d: rc %d\n",
 	       svc->srv_thread_name, i, j, rc);
 	ptlrpc_stop_all_threads(svc);
@@ -2432,7 +2430,7 @@ int ptlrpc_start_thread(struct ptlrpc_service_part *svcpt, int wait)
 	       svc->srv_name, svcpt->scp_cpt, svcpt->scp_nthrs_running,
 	       svc->srv_nthrs_cpt_init, svc->srv_nthrs_cpt_limit);
 
- again:
+again:
 	if (unlikely(svc->srv_is_stopping))
 		return -ESRCH;
 
Signature · 1 line
1.8.3.1
#20 lore raw

PATCH 19/26 ptlrpc: cleanup white spaces

Quoted 78 lines · James Simmons

The ptlrpc code is very messy and difficult to read. Remove excess white space and properly align data structures so they are easy on the eyes.

---
 drivers/staging/lustre/lustre/ptlrpc/client.c      |  45 ++--
 drivers/staging/lustre/lustre/ptlrpc/import.c      |   2 +-
 drivers/staging/lustre/lustre/ptlrpc/layout.c      |   3 -
 .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c    | 278 ++++++++++-----------
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c      |   7 +-
 drivers/staging/lustre/lustre/ptlrpc/nrs.c         |   1 -
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |  14 +-
 drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c     |  20 +-
 drivers/staging/lustre/lustre/ptlrpc/recover.c     |   1 +
 drivers/staging/lustre/lustre/ptlrpc/sec.c         |   4 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c    |  74 +++---
 drivers/staging/lustre/lustre/ptlrpc/sec_config.c  |  22 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_null.c    |  34 +--
 drivers/staging/lustre/lustre/ptlrpc/sec_plain.c   |  68 ++---
 drivers/staging/lustre/lustre/ptlrpc/service.c     |  20 +-
 15 files changed, 293 insertions(+), 300 deletions(-)
drivers/staging/lustre/lustre/ptlrpc/client.c +8 -9
index f4b3875..0831810 100644
@@ -49,14 +49,14 @@
 #include "ptlrpc_internal.h"
 
 const struct ptlrpc_bulk_frag_ops ptlrpc_bulk_kiov_pin_ops = {
-	.add_kiov_frag	= ptlrpc_prep_bulk_page_pin,
-	.release_frags	= ptlrpc_release_bulk_page_pin,
+	.add_kiov_frag		= ptlrpc_prep_bulk_page_pin,
+	.release_frags		= ptlrpc_release_bulk_page_pin,
 };
 EXPORT_SYMBOL(ptlrpc_bulk_kiov_pin_ops);
 
 const struct ptlrpc_bulk_frag_ops ptlrpc_bulk_kiov_nopin_ops = {
-	.add_kiov_frag	= ptlrpc_prep_bulk_page_nopin,
-	.release_frags	= NULL,
+	.add_kiov_frag		= ptlrpc_prep_bulk_page_nopin,
+	.release_frags		= NULL,
 };
 EXPORT_SYMBOL(ptlrpc_bulk_kiov_nopin_ops);
 
@@ -658,15 +658,14 @@ static void __ptlrpc_free_req_to_pool(struct ptlrpc_request *request)
 
 void ptlrpc_add_unreplied(struct ptlrpc_request *req)
 {
-	struct obd_import	*imp = req->rq_import;
-	struct ptlrpc_request	*iter;
+	struct obd_import *imp = req->rq_import;
+	struct ptlrpc_request *iter;
 
 	assert_spin_locked(&imp->imp_lock);
 	LASSERT(list_empty(&req->rq_unreplied_list));
 
 	/* unreplied list is sorted by xid in ascending order */
 	list_for_each_entry_reverse(iter, &imp->imp_unreplied_list, rq_unreplied_list) {
-
 		LASSERT(req->rq_xid != iter->rq_xid);
 		if (req->rq_xid < iter->rq_xid)
 			continue;
@@ -1318,10 +1317,10 @@ static int after_reply(struct ptlrpc_request *req)
 		 * reply).  NB: no need to round up because alloc_repbuf will
 		 * round it up
 		 */
-		req->rq_replen       = req->rq_nob_received;
+		req->rq_replen = req->rq_nob_received;
 		req->rq_nob_received = 0;
 		spin_lock(&req->rq_lock);
-		req->rq_resend       = 1;
+		req->rq_resend = 1;
 		spin_unlock(&req->rq_lock);
 		return 0;
 	}

drivers/staging/lustre/lustre/ptlrpc/client.c static int after_reply(struct ptlrpc_request *req) · line 1364

Quoted 8 lines
drivers/staging/lustre/lustre/ptlrpc/client.c +1 -1
@@ -1359,7 +1358,7 @@ static int after_reply(struct ptlrpc_request *req)
 		spin_unlock(&req->rq_lock);
 		req->rq_nr_resend++;
 
-		/* Readjust the timeout for current conditions */
+		/* Read just the timeout for current conditions */
 		ptlrpc_at_set_req_timeout(req);
 		/*
 		 * delay resend to give a chance to the server to get ready.

Uhmm... I don't think this function us reading anything, not even "just the timeout".
I think it is adjusting the timeout - which has already been done previously.
So this time it is re-adjusting.
??
I've changed this to Re-adjust

There is a similar comment in ptlrpc_replay_req which I've also changed from readjust to re-adjust.

NeilBrown

Quoted 1,093 lines
drivers/staging/lustre/lustre/ptlrpc/client.c +12 -14
@@ -1620,7 +1619,7 @@ static inline int ptlrpc_set_producer(struct ptlrpc_request_set *set)
 		rc = set->set_producer(set, set->set_producer_arg);
 		if (rc == -ENOENT) {
 			/* no more RPC to produce */
-			set->set_producer     = NULL;
+			set->set_producer = NULL;
 			set->set_producer_arg = NULL;
 			return 0;
 		}
@@ -1654,7 +1653,7 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
 
 		/*
 		 * This schedule point is mainly for the ptlrpcd caller of this
-		 * function.  Most ptlrpc sets are not long-lived and unbounded
+		 * function. Most ptlrpc sets are not long-lived and unbounded
 		 * in length, but at the least the set used by the ptlrpcd is.
 		 * Since the processing time is unbounded, we need to insert an
 		 * explicit schedule point to make the thread well-behaved.
@@ -2130,7 +2129,6 @@ void ptlrpc_expired_set(struct ptlrpc_request_set *set)
 
 	/* A timeout expired. See which reqs it applies to...  */
 	list_for_each_entry(req, &set->set_requests, rq_set_chain) {
-
 		/* don't expire request waiting for context */
 		if (req->rq_wait_ctx)
 			continue;
@@ -2185,7 +2183,6 @@ int ptlrpc_set_next_timeout(struct ptlrpc_request_set *set)
 	time64_t deadline;
 
 	list_for_each_entry(req, &set->set_requests, rq_set_chain) {
-
 		/* Request in-flight? */
 		if (!(((req->rq_phase == RQ_PHASE_RPC) && !req->rq_waiting) ||
 		      (req->rq_phase == RQ_PHASE_BULK) ||
@@ -2568,7 +2565,7 @@ static void ptlrpc_free_request(struct ptlrpc_request *req)
  */
 void ptlrpc_request_committed(struct ptlrpc_request *req, int force)
 {
-	struct obd_import	*imp = req->rq_import;
+	struct obd_import *imp = req->rq_import;
 
 	spin_lock(&imp->imp_lock);
 	if (list_empty(&req->rq_replay_list)) {
@@ -2896,7 +2893,7 @@ static int ptlrpc_replay_interpret(const struct lu_env *env,
 
 	/* continue with recovery */
 	rc = ptlrpc_import_recovery_state_machine(imp);
- out:
+out:
 	req->rq_send_state = aa->praa_old_state;
 
 	if (rc != 0)
@@ -3031,7 +3028,7 @@ void ptlrpc_abort_set(struct ptlrpc_request_set *set)
 /**
  * Initialize the XID for the node.  This is common among all requests on
  * this node, and only requires the property that it is monotonically
- * increasing.  It does not need to be sequential.  Since this is also used
+ * increasing. It does not need to be sequential.  Since this is also used
  * as the RDMA match bits, it is important that a single client NOT have
  * the same match bits for two different in-flight requests, hence we do
  * NOT want to have an XID per target or similar.
@@ -3198,12 +3195,12 @@ struct ptlrpc_work_async_args {
 static void ptlrpcd_add_work_req(struct ptlrpc_request *req)
 {
 	/* re-initialize the req */
-	req->rq_timeout		= obd_timeout;
-	req->rq_sent		= ktime_get_real_seconds();
-	req->rq_deadline	= req->rq_sent + req->rq_timeout;
-	req->rq_phase		= RQ_PHASE_INTERPRET;
-	req->rq_next_phase	= RQ_PHASE_COMPLETE;
-	req->rq_xid		= ptlrpc_next_xid();
+	req->rq_timeout	= obd_timeout;
+	req->rq_sent = ktime_get_real_seconds();
+	req->rq_deadline = req->rq_sent + req->rq_timeout;
+	req->rq_phase = RQ_PHASE_INTERPRET;
+	req->rq_next_phase = RQ_PHASE_COMPLETE;
+	req->rq_xid = ptlrpc_next_xid();
 	req->rq_import_generation = req->rq_import->imp_generation;
 
 	ptlrpcd_add_req(req);
@@ -3241,7 +3238,7 @@ static int ptlrpcd_check_work(struct ptlrpc_request *req)
 void *ptlrpcd_alloc_work(struct obd_import *imp,
 			 int (*cb)(const struct lu_env *, void *), void *cbdata)
 {
-	struct ptlrpc_request	 *req = NULL;
+	struct ptlrpc_request *req = NULL;
 	struct ptlrpc_work_async_args *args;
 
 	might_sleep();
drivers/staging/lustre/lustre/ptlrpc/import.c +1 -1
index 56a0b76..7bb2e06 100644
@@ -51,7 +51,7 @@
 #include "ptlrpc_internal.h"
 
 struct ptlrpc_connect_async_args {
-	 u64 pcaa_peer_committed;
+	u64 pcaa_peer_committed;
 	int pcaa_initial_connect;
 };
 
drivers/staging/lustre/lustre/ptlrpc/layout.c +0 -3
index 2848f2f..f1f7d70 100644
@@ -1907,9 +1907,7 @@ static void *__req_capsule_get(struct req_capsule *pill,
 	void *value;
 	u32 len;
 	u32 offset;
-
 	void *(*getter)(struct lustre_msg *m, u32 n, u32 minlen);
-
 	static const char *rcl_names[RCL_NR] = {
 		[RCL_CLIENT] = "client",
 		[RCL_SERVER] = "server"
@@ -2176,7 +2174,6 @@ void req_capsule_extend(struct req_capsule *pill, const struct req_format *fmt)
 {
 	int i;
 	size_t j;
-
 	const struct req_format *old;
 
 	LASSERT(pill->rc_fmt);
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +139 -139
index 92e3e0f..25858b8 100644
@@ -42,115 +42,115 @@
 #include "ptlrpc_internal.h"
 
 static struct ll_rpc_opcode {
-	u32       opcode;
-	const char *opname;
+	u32				opcode;
+	const char			*opname;
 } ll_rpc_opcode_table[LUSTRE_MAX_OPCODES] = {
-	{ OST_REPLY,	"ost_reply" },
-	{ OST_GETATTR,      "ost_getattr" },
-	{ OST_SETATTR,      "ost_setattr" },
-	{ OST_READ,	 "ost_read" },
-	{ OST_WRITE,	"ost_write" },
-	{ OST_CREATE,       "ost_create" },
-	{ OST_DESTROY,      "ost_destroy" },
-	{ OST_GET_INFO,     "ost_get_info" },
-	{ OST_CONNECT,      "ost_connect" },
-	{ OST_DISCONNECT,   "ost_disconnect" },
-	{ OST_PUNCH,	"ost_punch" },
-	{ OST_OPEN,	 "ost_open" },
-	{ OST_CLOSE,	"ost_close" },
-	{ OST_STATFS,       "ost_statfs" },
-	{ 14,		NULL },    /* formerly OST_SAN_READ */
-	{ 15,		NULL },    /* formerly OST_SAN_WRITE */
-	{ OST_SYNC,	 "ost_sync" },
-	{ OST_SET_INFO,     "ost_set_info" },
-	{ OST_QUOTACHECK,   "ost_quotacheck" },
-	{ OST_QUOTACTL,     "ost_quotactl" },
-	{ OST_QUOTA_ADJUST_QUNIT, "ost_quota_adjust_qunit" },
-	{ OST_LADVISE,			"ost_ladvise" },
-	{ MDS_GETATTR,      "mds_getattr" },
-	{ MDS_GETATTR_NAME, "mds_getattr_lock" },
-	{ MDS_CLOSE,	"mds_close" },
-	{ MDS_REINT,	"mds_reint" },
-	{ MDS_READPAGE,     "mds_readpage" },
-	{ MDS_CONNECT,      "mds_connect" },
-	{ MDS_DISCONNECT,   "mds_disconnect" },
-	{ MDS_GET_ROOT,			"mds_get_root" },
-	{ MDS_STATFS,       "mds_statfs" },
-	{ MDS_PIN,	  "mds_pin" },
-	{ MDS_UNPIN,	"mds_unpin" },
-	{ MDS_SYNC,	 "mds_sync" },
-	{ MDS_DONE_WRITING, "mds_done_writing" },
-	{ MDS_SET_INFO,     "mds_set_info" },
-	{ MDS_QUOTACHECK,   "mds_quotacheck" },
-	{ MDS_QUOTACTL,     "mds_quotactl" },
-	{ MDS_GETXATTR,     "mds_getxattr" },
-	{ MDS_SETXATTR,     "mds_setxattr" },
-	{ MDS_WRITEPAGE,    "mds_writepage" },
-	{ MDS_IS_SUBDIR,    "mds_is_subdir" },
-	{ MDS_GET_INFO,     "mds_get_info" },
-	{ MDS_HSM_STATE_GET, "mds_hsm_state_get" },
-	{ MDS_HSM_STATE_SET, "mds_hsm_state_set" },
-	{ MDS_HSM_ACTION,   "mds_hsm_action" },
-	{ MDS_HSM_PROGRESS, "mds_hsm_progress" },
-	{ MDS_HSM_REQUEST,  "mds_hsm_request" },
-	{ MDS_HSM_CT_REGISTER, "mds_hsm_ct_register" },
-	{ MDS_HSM_CT_UNREGISTER, "mds_hsm_ct_unregister" },
-	{ MDS_SWAP_LAYOUTS,	"mds_swap_layouts" },
-	{ LDLM_ENQUEUE,     "ldlm_enqueue" },
-	{ LDLM_CONVERT,     "ldlm_convert" },
-	{ LDLM_CANCEL,      "ldlm_cancel" },
-	{ LDLM_BL_CALLBACK, "ldlm_bl_callback" },
-	{ LDLM_CP_CALLBACK, "ldlm_cp_callback" },
-	{ LDLM_GL_CALLBACK, "ldlm_gl_callback" },
-	{ LDLM_SET_INFO,    "ldlm_set_info" },
-	{ MGS_CONNECT,      "mgs_connect" },
-	{ MGS_DISCONNECT,   "mgs_disconnect" },
-	{ MGS_EXCEPTION,    "mgs_exception" },
-	{ MGS_TARGET_REG,   "mgs_target_reg" },
-	{ MGS_TARGET_DEL,   "mgs_target_del" },
-	{ MGS_SET_INFO,     "mgs_set_info" },
-	{ MGS_CONFIG_READ,  "mgs_config_read" },
-	{ OBD_PING,	 "obd_ping" },
-	{ OBD_LOG_CANCEL,	"llog_cancel" },
-	{ OBD_QC_CALLBACK,  "obd_quota_callback" },
-	{ OBD_IDX_READ,	    "dt_index_read" },
-	{ LLOG_ORIGIN_HANDLE_CREATE,	 "llog_origin_handle_open" },
-	{ LLOG_ORIGIN_HANDLE_NEXT_BLOCK, "llog_origin_handle_next_block" },
-	{ LLOG_ORIGIN_HANDLE_READ_HEADER, "llog_origin_handle_read_header" },
-	{ LLOG_ORIGIN_HANDLE_WRITE_REC,  "llog_origin_handle_write_rec" },
-	{ LLOG_ORIGIN_HANDLE_CLOSE,      "llog_origin_handle_close" },
-	{ LLOG_ORIGIN_CONNECT,	   "llog_origin_connect" },
-	{ LLOG_CATINFO,		  "llog_catinfo" },
-	{ LLOG_ORIGIN_HANDLE_PREV_BLOCK, "llog_origin_handle_prev_block" },
-	{ LLOG_ORIGIN_HANDLE_DESTROY,    "llog_origin_handle_destroy" },
-	{ QUOTA_DQACQ,      "quota_acquire" },
-	{ QUOTA_DQREL,      "quota_release" },
-	{ SEQ_QUERY,	"seq_query" },
-	{ SEC_CTX_INIT,     "sec_ctx_init" },
-	{ SEC_CTX_INIT_CONT, "sec_ctx_init_cont" },
-	{ SEC_CTX_FINI,     "sec_ctx_fini" },
-	{ FLD_QUERY,	"fld_query" },
-	{ FLD_READ,	"fld_read" },
+	{ OST_REPLY,				"ost_reply" },
+	{ OST_GETATTR,				"ost_getattr" },
+	{ OST_SETATTR,				"ost_setattr" },
+	{ OST_READ,				"ost_read" },
+	{ OST_WRITE,				"ost_write" },
+	{ OST_CREATE,				"ost_create" },
+	{ OST_DESTROY,				"ost_destroy" },
+	{ OST_GET_INFO,				"ost_get_info" },
+	{ OST_CONNECT,				"ost_connect" },
+	{ OST_DISCONNECT,			"ost_disconnect" },
+	{ OST_PUNCH,				"ost_punch" },
+	{ OST_OPEN,				"ost_open" },
+	{ OST_CLOSE,				"ost_close" },
+	{ OST_STATFS,				"ost_statfs" },
+	{ 14,					NULL },	/* formerly OST_SAN_READ */
+	{ 15,					NULL }, /* formerly OST_SAN_WRITE */
+	{ OST_SYNC,				"ost_sync" },
+	{ OST_SET_INFO,				"ost_set_info" },
+	{ OST_QUOTACHECK,			"ost_quotacheck" },
+	{ OST_QUOTACTL,				"ost_quotactl" },
+	{ OST_QUOTA_ADJUST_QUNIT,		"ost_quota_adjust_qunit" },
+	{ OST_LADVISE,				"ost_ladvise" },
+	{ MDS_GETATTR,				"mds_getattr" },
+	{ MDS_GETATTR_NAME,			"mds_getattr_lock" },
+	{ MDS_CLOSE,				"mds_close" },
+	{ MDS_REINT,				"mds_reint" },
+	{ MDS_READPAGE,				"mds_readpage" },
+	{ MDS_CONNECT,				"mds_connect" },
+	{ MDS_DISCONNECT,			"mds_disconnect" },
+	{ MDS_GET_ROOT,				"mds_get_root" },
+	{ MDS_STATFS,				"mds_statfs" },
+	{ MDS_PIN,				"mds_pin" },
+	{ MDS_UNPIN,				"mds_unpin" },
+	{ MDS_SYNC,				"mds_sync" },
+	{ MDS_DONE_WRITING,			"mds_done_writing" },
+	{ MDS_SET_INFO,				"mds_set_info" },
+	{ MDS_QUOTACHECK,			"mds_quotacheck" },
+	{ MDS_QUOTACTL,				"mds_quotactl" },
+	{ MDS_GETXATTR,				"mds_getxattr" },
+	{ MDS_SETXATTR,				"mds_setxattr" },
+	{ MDS_WRITEPAGE,			"mds_writepage" },
+	{ MDS_IS_SUBDIR,			"mds_is_subdir" },
+	{ MDS_GET_INFO,				"mds_get_info" },
+	{ MDS_HSM_STATE_GET,			"mds_hsm_state_get" },
+	{ MDS_HSM_STATE_SET,			"mds_hsm_state_set" },
+	{ MDS_HSM_ACTION,			"mds_hsm_action" },
+	{ MDS_HSM_PROGRESS,			"mds_hsm_progress" },
+	{ MDS_HSM_REQUEST,			"mds_hsm_request" },
+	{ MDS_HSM_CT_REGISTER,			"mds_hsm_ct_register" },
+	{ MDS_HSM_CT_UNREGISTER,		"mds_hsm_ct_unregister" },
+	{ MDS_SWAP_LAYOUTS,			"mds_swap_layouts" },
+	{ LDLM_ENQUEUE,				"ldlm_enqueue" },
+	{ LDLM_CONVERT,				"ldlm_convert" },
+	{ LDLM_CANCEL,				"ldlm_cancel" },
+	{ LDLM_BL_CALLBACK,			"ldlm_bl_callback" },
+	{ LDLM_CP_CALLBACK,			"ldlm_cp_callback" },
+	{ LDLM_GL_CALLBACK,			"ldlm_gl_callback" },
+	{ LDLM_SET_INFO,			"ldlm_set_info" },
+	{ MGS_CONNECT,				"mgs_connect" },
+	{ MGS_DISCONNECT,			"mgs_disconnect" },
+	{ MGS_EXCEPTION,			"mgs_exception" },
+	{ MGS_TARGET_REG,			"mgs_target_reg" },
+	{ MGS_TARGET_DEL,			"mgs_target_del" },
+	{ MGS_SET_INFO,				"mgs_set_info" },
+	{ MGS_CONFIG_READ,			"mgs_config_read" },
+	{ OBD_PING,				"obd_ping" },
+	{ OBD_LOG_CANCEL,			"llog_cancel" },
+	{ OBD_QC_CALLBACK,			"obd_quota_callback" },
+	{ OBD_IDX_READ,				"dt_index_read" },
+	{ LLOG_ORIGIN_HANDLE_CREATE,		 "llog_origin_handle_open" },
+	{ LLOG_ORIGIN_HANDLE_NEXT_BLOCK,	"llog_origin_handle_next_block" },
+	{ LLOG_ORIGIN_HANDLE_READ_HEADER,	"llog_origin_handle_read_header" },
+	{ LLOG_ORIGIN_HANDLE_WRITE_REC,		"llog_origin_handle_write_rec" },
+	{ LLOG_ORIGIN_HANDLE_CLOSE,		"llog_origin_handle_close" },
+	{ LLOG_ORIGIN_CONNECT,			"llog_origin_connect" },
+	{ LLOG_CATINFO,				"llog_catinfo" },
+	{ LLOG_ORIGIN_HANDLE_PREV_BLOCK,	"llog_origin_handle_prev_block" },
+	{ LLOG_ORIGIN_HANDLE_DESTROY,		"llog_origin_handle_destroy" },
+	{ QUOTA_DQACQ,				"quota_acquire" },
+	{ QUOTA_DQREL,				"quota_release" },
+	{ SEQ_QUERY,				"seq_query" },
+	{ SEC_CTX_INIT,				"sec_ctx_init" },
+	{ SEC_CTX_INIT_CONT,			"sec_ctx_init_cont" },
+	{ SEC_CTX_FINI,				"sec_ctx_fini" },
+	{ FLD_QUERY,				"fld_query" },
+	{ FLD_READ,				"fld_read" },
 };
 
 static struct ll_eopcode {
-	u32       opcode;
-	const char *opname;
+	u32			opcode;
+	const char		*opname;
 } ll_eopcode_table[EXTRA_LAST_OPC] = {
-	{ LDLM_GLIMPSE_ENQUEUE, "ldlm_glimpse_enqueue" },
-	{ LDLM_PLAIN_ENQUEUE,   "ldlm_plain_enqueue" },
-	{ LDLM_EXTENT_ENQUEUE,  "ldlm_extent_enqueue" },
-	{ LDLM_FLOCK_ENQUEUE,   "ldlm_flock_enqueue" },
-	{ LDLM_IBITS_ENQUEUE,   "ldlm_ibits_enqueue" },
-	{ MDS_REINT_SETATTR,    "mds_reint_setattr" },
-	{ MDS_REINT_CREATE,     "mds_reint_create" },
-	{ MDS_REINT_LINK,       "mds_reint_link" },
-	{ MDS_REINT_UNLINK,     "mds_reint_unlink" },
-	{ MDS_REINT_RENAME,     "mds_reint_rename" },
-	{ MDS_REINT_OPEN,       "mds_reint_open" },
-	{ MDS_REINT_SETXATTR,   "mds_reint_setxattr" },
-	{ BRW_READ_BYTES,       "read_bytes" },
-	{ BRW_WRITE_BYTES,      "write_bytes" },
+	{ LDLM_GLIMPSE_ENQUEUE,			"ldlm_glimpse_enqueue" },
+	{ LDLM_PLAIN_ENQUEUE,			"ldlm_plain_enqueue" },
+	{ LDLM_EXTENT_ENQUEUE,			"ldlm_extent_enqueue" },
+	{ LDLM_FLOCK_ENQUEUE,			"ldlm_flock_enqueue" },
+	{ LDLM_IBITS_ENQUEUE,			"ldlm_ibits_enqueue" },
+	{ MDS_REINT_SETATTR,			"mds_reint_setattr" },
+	{ MDS_REINT_CREATE,			"mds_reint_create" },
+	{ MDS_REINT_LINK,			"mds_reint_link" },
+	{ MDS_REINT_UNLINK,			"mds_reint_unlink" },
+	{ MDS_REINT_RENAME,			"mds_reint_rename" },
+	{ MDS_REINT_OPEN,			"mds_reint_open" },
+	{ MDS_REINT_SETXATTR,			"mds_reint_setxattr" },
+	{ BRW_READ_BYTES,			"read_bytes" },
+	{ BRW_WRITE_BYTES,			"write_bytes" },
 };
 
 const char *ll_opcode2str(u32 opcode)
@@ -450,13 +450,13 @@ static void nrs_policy_get_info_locked(struct ptlrpc_nrs_policy *policy,
 
 	memcpy(info->pi_name, policy->pol_desc->pd_name, NRS_POL_NAME_MAX);
 
-	info->pi_fallback    = !!(policy->pol_flags & PTLRPC_NRS_FL_FALLBACK);
-	info->pi_state	     = policy->pol_state;
+	info->pi_fallback = !!(policy->pol_flags & PTLRPC_NRS_FL_FALLBACK);
+	info->pi_state = policy->pol_state;
 	/**
 	 * XXX: These are accessed without holding
 	 * ptlrpc_service_part::scp_req_lock.
 	 */
-	info->pi_req_queued  = policy->pol_req_queued;
+	info->pi_req_queued = policy->pol_req_queued;
 	info->pi_req_started = policy->pol_req_started;
 }
 
@@ -788,18 +788,18 @@ struct ptlrpc_srh_iterator {
 /* convert position to sequence */
 #define PTLRPC_REQ_POS2SEQ(svc, pos)			\
 	((svc)->srv_cpt_bits == 0 ? (pos) :		\
-	 ((u64)(pos) << (svc)->srv_cpt_bits) |	\
+	 ((u64)(pos) << (svc)->srv_cpt_bits) |		\
 	 ((u64)(pos) >> (64 - (svc)->srv_cpt_bits)))
 
 static void *
 ptlrpc_lprocfs_svc_req_history_start(struct seq_file *s, loff_t *pos)
 {
-	struct ptlrpc_service		*svc = s->private;
-	struct ptlrpc_service_part	*svcpt;
-	struct ptlrpc_srh_iterator	*srhi;
-	unsigned int			cpt;
-	int				rc;
-	int				i;
+	struct ptlrpc_service *svc = s->private;
+	struct ptlrpc_service_part *svcpt;
+	struct ptlrpc_srh_iterator *srhi;
+	unsigned int cpt;
+	int rc;
+	int i;
 
 	if (sizeof(loff_t) != sizeof(u64)) { /* can't support */
 		CWARN("Failed to read request history because size of loff_t %d can't match size of u64\n",
@@ -940,10 +940,10 @@ static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter)
 ptlrpc_lprocfs_svc_req_history_open(struct inode *inode, struct file *file)
 {
 	static const struct seq_operations sops = {
-		.start = ptlrpc_lprocfs_svc_req_history_start,
-		.stop  = ptlrpc_lprocfs_svc_req_history_stop,
-		.next  = ptlrpc_lprocfs_svc_req_history_next,
-		.show  = ptlrpc_lprocfs_svc_req_history_show,
+		.start	= ptlrpc_lprocfs_svc_req_history_start,
+		.stop	= ptlrpc_lprocfs_svc_req_history_stop,
+		.next	= ptlrpc_lprocfs_svc_req_history_next,
+		.show	= ptlrpc_lprocfs_svc_req_history_show,
 	};
 	struct seq_file *seqf;
 	int rc;
@@ -975,9 +975,9 @@ static int ptlrpc_lprocfs_timeouts_seq_show(struct seq_file *m, void *n)
 	}
 
 	ptlrpc_service_for_each_part(svcpt, i, svc) {
-		cur	= at_get(&svcpt->scp_at_estimate);
-		worst	= svcpt->scp_at_estimate.at_worst_ever;
-		worstt	= svcpt->scp_at_estimate.at_worst_time;
+		cur = at_get(&svcpt->scp_at_estimate);
+		worst = svcpt->scp_at_estimate.at_worst_ever;
+		worstt = svcpt->scp_at_estimate.at_worst_time;
 		s2dhms(&ts, ktime_get_real_seconds() - worstt);
 
 		seq_printf(m, "%10s : cur %3u  worst %3u (at %lld, "
@@ -1074,26 +1074,26 @@ void ptlrpc_ldebugfs_register_service(struct dentry *entry,
 				      struct ptlrpc_service *svc)
 {
 	struct lprocfs_vars lproc_vars[] = {
-		{.name       = "req_buffer_history_len",
-		 .fops	     = &ptlrpc_lprocfs_req_history_len_fops,
-		 .data       = svc},
-		{.name       = "req_buffer_history_max",
-		 .fops	     = &ptlrpc_lprocfs_req_history_max_fops,
-		 .data       = svc},
-		{.name       = "timeouts",
-		 .fops	     = &ptlrpc_lprocfs_timeouts_fops,
-		 .data       = svc},
-		{.name       = "nrs_policies",
-		 .fops	     = &ptlrpc_lprocfs_nrs_fops,
-		 .data	     = svc},
-		{NULL}
+		{ .name		= "req_buffer_history_len",
+		  .fops		= &ptlrpc_lprocfs_req_history_len_fops,
+		  .data		= svc },
+		{ .name		= "req_buffer_history_max",
+		  .fops		= &ptlrpc_lprocfs_req_history_max_fops,
+		  .data		= svc },
+		{ .name		= "timeouts",
+		  .fops		= &ptlrpc_lprocfs_timeouts_fops,
+		  .data		= svc },
+		{ .name		= "nrs_policies",
+		  .fops		= &ptlrpc_lprocfs_nrs_fops,
+		  .data		= svc },
+		{ NULL }
 	};
 	static const struct file_operations req_history_fops = {
-		.owner       = THIS_MODULE,
-		.open	= ptlrpc_lprocfs_svc_req_history_open,
-		.read	= seq_read,
-		.llseek      = seq_lseek,
-		.release     = lprocfs_seq_release,
+		.owner		= THIS_MODULE,
+		.open		= ptlrpc_lprocfs_svc_req_history_open,
+		.read		= seq_read,
+		.llseek		= seq_lseek,
+		.release	= lprocfs_seq_release,
 	};
 
 	ptlrpc_ldebugfs_register(entry, svc->srv_name,
drivers/staging/lustre/lustre/ptlrpc/niobuf.c +4 -3
index d3044a7..ea7a7f9 100644
@@ -280,6 +280,7 @@ int ptlrpc_unregister_bulk(struct ptlrpc_request *req, int async)
 		 * timeout lets us CWARN for visibility of sluggish LNDs
 		 */
 		int cnt = 0;
+
 		while (cnt < LONG_UNLINK &&
 		       (rc = wait_event_idle_timeout(*wq,
 						     !ptlrpc_client_bulk_active(req),
@@ -685,7 +686,7 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
 	 * add the network latency for our local timeout.
 	 */
 	request->rq_deadline = request->rq_sent + request->rq_timeout +
-		ptlrpc_at_get_net_latency(request);
+			       ptlrpc_at_get_net_latency(request);
 
 	ptlrpc_pinger_sending_on_import(imp);
 
@@ -705,7 +706,7 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
 	if (noreply)
 		goto out;
 
- cleanup_me:
+cleanup_me:
 	/* MEUnlink is safe; the PUT didn't even get off the ground, and
 	 * nobody apart from the PUT's target has the right nid+XID to
 	 * access the reply buffer.
@@ -715,7 +716,7 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
 	/* UNLINKED callback called synchronously */
 	LASSERT(!request->rq_receiving_reply);
 
- cleanup_bulk:
+cleanup_bulk:
 	/* We do sync unlink here as there was no real transfer here so
 	 * the chance to have long unlink to sluggish net is smaller here.
 	 */
drivers/staging/lustre/lustre/ptlrpc/nrs.c +0 -1
index 248ba04..ef7dd5d 100644
@@ -118,7 +118,6 @@ static int nrs_policy_stop_locked(struct ptlrpc_nrs_policy *policy)
 	/* Immediately make it invisible */
 	if (nrs->nrs_policy_primary == policy) {
 		nrs->nrs_policy_primary = NULL;
-
 	} else {
 		LASSERT(nrs->nrs_policy_fallback == policy);
 		nrs->nrs_policy_fallback = NULL;
drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +7 -7
index 10c2520..5383b68 100644
@@ -111,12 +111,12 @@ struct nrs_core {
 	 * Protects nrs_core::nrs_policies, serializes external policy
 	 * registration/unregistration, and NRS core lprocfs operations.
 	 */
-	struct mutex nrs_mutex;
+	struct mutex		nrs_mutex;
 	/**
 	 * List of all policy descriptors registered with NRS core; protected
 	 * by nrs_core::nrs_mutex.
 	 */
-	struct list_head nrs_policies;
+	struct list_head	nrs_policies;
 
 };
 
@@ -251,15 +251,15 @@ struct ptlrpc_reply_state *
 void ptlrpc_pinger_wake_up(void);
 
 /* sec_null.c */
-int  sptlrpc_null_init(void);
+int sptlrpc_null_init(void);
 void sptlrpc_null_fini(void);
 
 /* sec_plain.c */
-int  sptlrpc_plain_init(void);
+int sptlrpc_plain_init(void);
 void sptlrpc_plain_fini(void);
 
 /* sec_bulk.c */
-int  sptlrpc_enc_pool_init(void);
+int sptlrpc_enc_pool_init(void);
 void sptlrpc_enc_pool_fini(void);
 int sptlrpc_proc_enc_pool_seq_show(struct seq_file *m, void *v);
 
@@ -277,11 +277,11 @@ void sptlrpc_conf_choose_flavor(enum lustre_sec_part from,
 				struct obd_uuid *target,
 				lnet_nid_t nid,
 				struct sptlrpc_flavor *sf);
-int  sptlrpc_conf_init(void);
+int sptlrpc_conf_init(void);
 void sptlrpc_conf_fini(void);
 
 /* sec.c */
-int  sptlrpc_init(void);
+int sptlrpc_init(void);
 void sptlrpc_fini(void);
 
 /* layout.c */
drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c +10 -10
index e39c38a..f0ac296 100644
@@ -69,13 +69,13 @@
 
 /* One of these per CPT. */
 struct ptlrpcd {
-	int pd_size;
-	int pd_index;
-	int pd_cpt;
-	int pd_cursor;
-	int pd_nthreads;
-	int pd_groupsize;
-	struct ptlrpcd_ctl pd_threads[0];
+	int			pd_size;
+	int			pd_index;
+	int			pd_cpt;
+	int			pd_cursor;
+	int			pd_nthreads;
+	int			pd_groupsize;
+	struct ptlrpcd_ctl	pd_threads[0];
 };
 
 /*
@@ -171,9 +171,9 @@ void ptlrpcd_wake(struct ptlrpc_request *req)
 static struct ptlrpcd_ctl *
 ptlrpcd_select_pc(struct ptlrpc_request *req)
 {
-	struct ptlrpcd	*pd;
-	int		cpt;
-	int		idx;
+	struct ptlrpcd *pd;
+	int cpt;
+	int idx;
 
 	if (req && req->rq_send_state != LUSTRE_IMP_FULL)
 		return &ptlrpcd_rcv;
drivers/staging/lustre/lustre/ptlrpc/recover.c +1 -0
index ed769a4..af672ab 100644
@@ -119,6 +119,7 @@ int ptlrpc_replay_next(struct obd_import *imp, int *inflight)
 	 */
 	if (!req) {
 		struct ptlrpc_request *tmp;
+
 		list_for_each_entry_safe(tmp, pos, &imp->imp_replay_list,
 					 rq_replay_list) {
 			if (tmp->rq_transno > last_transno) {
drivers/staging/lustre/lustre/ptlrpc/sec.c +2 -2
index 165082a..6dc7731 100644
@@ -171,7 +171,7 @@ u32 sptlrpc_name2flavor_base(const char *name)
 
 const char *sptlrpc_flavor2name_base(u32 flvr)
 {
-	u32   base = SPTLRPC_FLVR_BASE(flvr);
+	u32 base = SPTLRPC_FLVR_BASE(flvr);
 
 	if (base == SPTLRPC_FLVR_BASE(SPTLRPC_FLVR_NULL))
 		return "null";
@@ -365,7 +365,7 @@ int sptlrpc_req_get_ctx(struct ptlrpc_request *req)
 {
 	struct obd_import *imp = req->rq_import;
 	struct ptlrpc_sec *sec;
-	int		rc;
+	int rc;
 
 	LASSERT(!req->rq_cli_ctx);
 	LASSERT(imp);
drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c +37 -37
index 93dcb6d..74cfdd8 100644
@@ -57,8 +57,8 @@
 #define POINTERS_PER_PAGE	(PAGE_SIZE / sizeof(void *))
 #define PAGES_PER_POOL		(POINTERS_PER_PAGE)
 
-#define IDLE_IDX_MAX	 (100)
-#define IDLE_IDX_WEIGHT	 (3)
+#define IDLE_IDX_MAX		(100)
+#define IDLE_IDX_WEIGHT		(3)
 
 #define CACHE_QUIESCENT_PERIOD  (20)
 
@@ -66,16 +66,16 @@
 	/*
 	 * constants
 	 */
-	unsigned long    epp_max_pages;   /* maximum pages can hold, const */
-	unsigned int     epp_max_pools;   /* number of pools, const */
+	unsigned long		epp_max_pages;	/* maximum pages can hold, const */
+	unsigned int		epp_max_pools;	/* number of pools, const */
 
 	/*
 	 * wait queue in case of not enough free pages.
 	 */
-	wait_queue_head_t      epp_waitq;       /* waiting threads */
-	unsigned int     epp_waitqlen;    /* wait queue length */
-	unsigned long    epp_pages_short; /* # of pages wanted of in-q users */
-	unsigned int     epp_growing:1;   /* during adding pages */
+	wait_queue_head_t	epp_waitq;	/* waiting threads */
+	unsigned int		epp_waitqlen;	/* wait queue length */
+	unsigned long		epp_pages_short; /* # of pages wanted of in-q users */
+	unsigned int		epp_growing:1;	/* during adding pages */
 
 	/*
 	 * indicating how idle the pools are, from 0 to MAX_IDLE_IDX
@@ -84,36 +84,36 @@
 	 * is idled for a while but the idle_idx might still be low if no
 	 * activities happened in the pools.
 	 */
-	unsigned long    epp_idle_idx;
+	unsigned long		epp_idle_idx;
 
 	/* last shrink time due to mem tight */
-	time64_t         epp_last_shrink;
-	time64_t         epp_last_access;
+	time64_t		epp_last_shrink;
+	time64_t		epp_last_access;
 
 	/*
 	 * in-pool pages bookkeeping
 	 */
-	spinlock_t	 epp_lock;	   /* protect following fields */
-	unsigned long    epp_total_pages; /* total pages in pools */
-	unsigned long    epp_free_pages;  /* current pages available */
+	spinlock_t		epp_lock;	 /* protect following fields */
+	unsigned long		epp_total_pages; /* total pages in pools */
+	unsigned long		epp_free_pages;	 /* current pages available */
 
 	/*
 	 * statistics
 	 */
-	unsigned long    epp_st_max_pages;      /* # of pages ever reached */
-	unsigned int     epp_st_grows;	  /* # of grows */
-	unsigned int     epp_st_grow_fails;     /* # of add pages failures */
-	unsigned int     epp_st_shrinks;	/* # of shrinks */
-	unsigned long    epp_st_access;	 /* # of access */
-	unsigned long    epp_st_missings;       /* # of cache missing */
-	unsigned long    epp_st_lowfree;	/* lowest free pages reached */
-	unsigned int     epp_st_max_wqlen;      /* highest waitqueue length */
-	unsigned long       epp_st_max_wait;       /* in jiffies */
-	unsigned long	 epp_st_outofmem;	/* # of out of mem requests */
+	unsigned long		epp_st_max_pages;	/* # of pages ever reached */
+	unsigned int		epp_st_grows;		/* # of grows */
+	unsigned int		epp_st_grow_fails;	/* # of add pages failures */
+	unsigned int		epp_st_shrinks;		/* # of shrinks */
+	unsigned long		epp_st_access;		/* # of access */
+	unsigned long		epp_st_missings;	/* # of cache missing */
+	unsigned long		epp_st_lowfree;		/* lowest free pages reached */
+	unsigned int		epp_st_max_wqlen;	/* highest waitqueue length */
+	unsigned long		epp_st_max_wait;	/* in jiffies */
+	unsigned long		epp_st_outofmem;	/* # of out of mem requests */
 	/*
 	 * pointers to pools
 	 */
-	struct page    ***epp_pools;
+	struct page		***epp_pools;
 } page_pools;
 
 /*
@@ -394,9 +394,9 @@ static inline void enc_pools_free(void)
 }
 
 static struct shrinker pools_shrinker = {
-	.count_objects	= enc_pools_shrink_count,
-	.scan_objects	= enc_pools_shrink_scan,
-	.seeks		= DEFAULT_SEEKS,
+	.count_objects		= enc_pools_shrink_count,
+	.scan_objects		= enc_pools_shrink_scan,
+	.seeks			= DEFAULT_SEEKS,
 };
 
 int sptlrpc_enc_pool_init(void)
@@ -475,14 +475,14 @@ void sptlrpc_enc_pool_fini(void)
 }
 
 static int cfs_hash_alg_id[] = {
-	[BULK_HASH_ALG_NULL]	= CFS_HASH_ALG_NULL,
-	[BULK_HASH_ALG_ADLER32]	= CFS_HASH_ALG_ADLER32,
-	[BULK_HASH_ALG_CRC32]	= CFS_HASH_ALG_CRC32,
-	[BULK_HASH_ALG_MD5]	= CFS_HASH_ALG_MD5,
-	[BULK_HASH_ALG_SHA1]	= CFS_HASH_ALG_SHA1,
-	[BULK_HASH_ALG_SHA256]	= CFS_HASH_ALG_SHA256,
-	[BULK_HASH_ALG_SHA384]	= CFS_HASH_ALG_SHA384,
-	[BULK_HASH_ALG_SHA512]	= CFS_HASH_ALG_SHA512,
+	[BULK_HASH_ALG_NULL]		= CFS_HASH_ALG_NULL,
+	[BULK_HASH_ALG_ADLER32]		= CFS_HASH_ALG_ADLER32,
+	[BULK_HASH_ALG_CRC32]		= CFS_HASH_ALG_CRC32,
+	[BULK_HASH_ALG_MD5]		= CFS_HASH_ALG_MD5,
+	[BULK_HASH_ALG_SHA1]		= CFS_HASH_ALG_SHA1,
+	[BULK_HASH_ALG_SHA256]		= CFS_HASH_ALG_SHA256,
+	[BULK_HASH_ALG_SHA384]		= CFS_HASH_ALG_SHA384,
+	[BULK_HASH_ALG_SHA512]		= CFS_HASH_ALG_SHA512,
 };
 
 const char *sptlrpc_get_hash_name(u8 hash_alg)
@@ -498,7 +498,7 @@ u8 sptlrpc_get_hash_alg(const char *algname)
 int bulk_sec_desc_unpack(struct lustre_msg *msg, int offset, int swabbed)
 {
 	struct ptlrpc_bulk_sec_desc *bsd;
-	int			  size = msg->lm_buflens[offset];
+	int size = msg->lm_buflens[offset];
 
 	bsd = lustre_msg_buf(msg, offset, sizeof(*bsd));
 	if (!bsd) {
drivers/staging/lustre/lustre/ptlrpc/sec_config.c +11 -11
index 1844ada..54130ae 100644
@@ -408,19 +408,19 @@ static int sptlrpc_rule_set_choose(struct sptlrpc_rule_set *rset,
  **********************************/
 
 struct sptlrpc_conf_tgt {
-	struct list_head	      sct_list;
-	char		    sct_name[MAX_OBD_NAME];
-	struct sptlrpc_rule_set sct_rset;
+	struct list_head		sct_list;
+	char				sct_name[MAX_OBD_NAME];
+	struct sptlrpc_rule_set		sct_rset;
 };
 
 struct sptlrpc_conf {
-	struct list_head	      sc_list;
-	char		    sc_fsname[MTI_NAME_MAXLEN];
-	unsigned int	    sc_modified;  /* modified during updating */
-	unsigned int	    sc_updated:1, /* updated copy from MGS */
-				sc_local:1;   /* local copy from target */
-	struct sptlrpc_rule_set sc_rset;      /* fs general rules */
-	struct list_head	      sc_tgts;      /* target-specific rules */
+	struct list_head		sc_list;
+	char				sc_fsname[MTI_NAME_MAXLEN];
+	unsigned int			sc_modified;	/* modified during updating */
+	unsigned int			sc_updated:1,	/* updated copy from MGS */
+					sc_local:1;	/* local copy from target */
+	struct sptlrpc_rule_set		sc_rset;	/* fs general rules */
+	struct list_head		sc_tgts;	/* target-specific rules */
 };
 
 static struct mutex sptlrpc_conf_lock;
@@ -801,7 +801,7 @@ void sptlrpc_conf_choose_flavor(enum lustre_sec_part from,
 	flavor_set_flags(sf, from, to, 1);
 }
 
-#define SEC_ADAPT_DELAY	 (10)
+#define SEC_ADAPT_DELAY		(10)
 
 /**
  * called by client devices, notify the sptlrpc config has changed and
drivers/staging/lustre/lustre/ptlrpc/sec_null.c +17 -17
index 6933a53..df6ef4f 100644
@@ -277,8 +277,8 @@ int null_enlarge_reqbuf(struct ptlrpc_sec *sec,
 }
 
 static struct ptlrpc_svc_ctx null_svc_ctx = {
-	.sc_refcount    = ATOMIC_INIT(1),
-	.sc_policy      = &null_policy,
+	.sc_refcount	= ATOMIC_INIT(1),
+	.sc_policy	= &null_policy,
 };
 
 static
@@ -373,33 +373,33 @@ int null_authorize(struct ptlrpc_request *req)
 
 static struct ptlrpc_ctx_ops null_ctx_ops = {
 	.refresh		= null_ctx_refresh,
-	.sign		   = null_ctx_sign,
-	.verify		 = null_ctx_verify,
+	.sign			= null_ctx_sign,
+	.verify			= null_ctx_verify,
 };
 
 static struct ptlrpc_sec_cops null_sec_cops = {
-	.create_sec	     = null_create_sec,
-	.destroy_sec	    = null_destroy_sec,
-	.lookup_ctx	     = null_lookup_ctx,
+	.create_sec		= null_create_sec,
+	.destroy_sec		= null_destroy_sec,
+	.lookup_ctx		= null_lookup_ctx,
 	.flush_ctx_cache	= null_flush_ctx_cache,
-	.alloc_reqbuf	   = null_alloc_reqbuf,
-	.alloc_repbuf	   = null_alloc_repbuf,
-	.free_reqbuf	    = null_free_reqbuf,
-	.free_repbuf	    = null_free_repbuf,
-	.enlarge_reqbuf	 = null_enlarge_reqbuf,
+	.alloc_reqbuf		= null_alloc_reqbuf,
+	.alloc_repbuf		= null_alloc_repbuf,
+	.free_reqbuf		= null_free_reqbuf,
+	.free_repbuf		= null_free_repbuf,
+	.enlarge_reqbuf		= null_enlarge_reqbuf,
 };
 
 static struct ptlrpc_sec_sops null_sec_sops = {
-	.accept		 = null_accept,
-	.alloc_rs	       = null_alloc_rs,
-	.authorize	      = null_authorize,
+	.accept			= null_accept,
+	.alloc_rs		= null_alloc_rs,
+	.authorize		= null_authorize,
 	.free_rs		= null_free_rs,
 };
 
 static struct ptlrpc_sec_policy null_policy = {
-	.sp_owner	       = THIS_MODULE,
+	.sp_owner		= THIS_MODULE,
 	.sp_name		= "sec.null",
-	.sp_policy	      = SPTLRPC_POLICY_NULL,
+	.sp_policy		= SPTLRPC_POLICY_NULL,
 	.sp_cops		= &null_sec_cops,
 	.sp_sops		= &null_sec_sops,
 };
drivers/staging/lustre/lustre/ptlrpc/sec_plain.c +34 -34
index 0a31ff4..021bf7f 100644
@@ -46,9 +46,9 @@
 #include "ptlrpc_internal.h"
 
 struct plain_sec {
-	struct ptlrpc_sec       pls_base;
-	rwlock_t	    pls_lock;
-	struct ptlrpc_cli_ctx  *pls_ctx;
+	struct ptlrpc_sec	 pls_base;
+	rwlock_t		 pls_lock;
+	struct ptlrpc_cli_ctx	*pls_ctx;
 };
 
 static inline struct plain_sec *sec2plsec(struct ptlrpc_sec *sec)
@@ -65,15 +65,15 @@ static inline struct plain_sec *sec2plsec(struct ptlrpc_sec *sec)
 /*
  * for simplicity, plain policy rpc use fixed layout.
  */
-#define PLAIN_PACK_SEGMENTS	     (4)
+#define PLAIN_PACK_SEGMENTS	(4)
 
-#define PLAIN_PACK_HDR_OFF	      (0)
-#define PLAIN_PACK_MSG_OFF	      (1)
-#define PLAIN_PACK_USER_OFF	     (2)
-#define PLAIN_PACK_BULK_OFF	     (3)
+#define PLAIN_PACK_HDR_OFF	(0)
+#define PLAIN_PACK_MSG_OFF	(1)
+#define PLAIN_PACK_USER_OFF	(2)
+#define PLAIN_PACK_BULK_OFF	(3)
 
-#define PLAIN_FL_USER		   (0x01)
-#define PLAIN_FL_BULK		   (0x02)
+#define PLAIN_FL_USER		(0x01)
+#define PLAIN_FL_BULK		(0x02)
 
 struct plain_header {
 	u8	    ph_ver;	    /* 0 */
@@ -711,8 +711,8 @@ int plain_enlarge_reqbuf(struct ptlrpc_sec *sec,
  ****************************************/
 
 static struct ptlrpc_svc_ctx plain_svc_ctx = {
-	.sc_refcount    = ATOMIC_INIT(1),
-	.sc_policy      = &plain_policy,
+	.sc_refcount	= ATOMIC_INIT(1),
+	.sc_policy	= &plain_policy,
 };
 
 static
@@ -961,40 +961,40 @@ int plain_svc_wrap_bulk(struct ptlrpc_request *req,
 
 static struct ptlrpc_ctx_ops plain_ctx_ops = {
 	.refresh		= plain_ctx_refresh,
-	.validate	       = plain_ctx_validate,
-	.sign		   = plain_ctx_sign,
-	.verify		 = plain_ctx_verify,
-	.wrap_bulk	      = plain_cli_wrap_bulk,
-	.unwrap_bulk	    = plain_cli_unwrap_bulk,
+	.validate		= plain_ctx_validate,
+	.sign			= plain_ctx_sign,
+	.verify			= plain_ctx_verify,
+	.wrap_bulk		= plain_cli_wrap_bulk,
+	.unwrap_bulk		= plain_cli_unwrap_bulk,
 };
 
 static struct ptlrpc_sec_cops plain_sec_cops = {
-	.create_sec	     = plain_create_sec,
-	.destroy_sec	    = plain_destroy_sec,
-	.kill_sec	       = plain_kill_sec,
-	.lookup_ctx	     = plain_lookup_ctx,
-	.release_ctx	    = plain_release_ctx,
+	.create_sec		= plain_create_sec,
+	.destroy_sec		= plain_destroy_sec,
+	.kill_sec		= plain_kill_sec,
+	.lookup_ctx		= plain_lookup_ctx,
+	.release_ctx		= plain_release_ctx,
 	.flush_ctx_cache	= plain_flush_ctx_cache,
-	.alloc_reqbuf	   = plain_alloc_reqbuf,
-	.free_reqbuf	    = plain_free_reqbuf,
-	.alloc_repbuf	   = plain_alloc_repbuf,
-	.free_repbuf	    = plain_free_repbuf,
-	.enlarge_reqbuf	 = plain_enlarge_reqbuf,
+	.alloc_reqbuf		= plain_alloc_reqbuf,
+	.free_reqbuf		= plain_free_reqbuf,
+	.alloc_repbuf		= plain_alloc_repbuf,
+	.free_repbuf		= plain_free_repbuf,
+	.enlarge_reqbuf		= plain_enlarge_reqbuf,
 };
 
 static struct ptlrpc_sec_sops plain_sec_sops = {
-	.accept		 = plain_accept,
-	.alloc_rs	       = plain_alloc_rs,
-	.authorize	      = plain_authorize,
+	.accept			= plain_accept,
+	.alloc_rs		= plain_alloc_rs,
+	.authorize		= plain_authorize,
 	.free_rs		= plain_free_rs,
-	.unwrap_bulk	    = plain_svc_unwrap_bulk,
-	.wrap_bulk	      = plain_svc_wrap_bulk,
+	.unwrap_bulk		= plain_svc_unwrap_bulk,
+	.wrap_bulk		= plain_svc_wrap_bulk,
 };
 
 static struct ptlrpc_sec_policy plain_policy = {
-	.sp_owner	       = THIS_MODULE,
+	.sp_owner		= THIS_MODULE,
 	.sp_name		= "plain",
-	.sp_policy	      = SPTLRPC_POLICY_PLAIN,
+	.sp_policy		= SPTLRPC_POLICY_PLAIN,
 	.sp_cops		= &plain_sec_cops,
 	.sp_sops		= &plain_sec_sops,
 };
drivers/staging/lustre/lustre/ptlrpc/service.c +9 -11
index 1030f65..5b97f2a 100644
@@ -173,7 +173,7 @@
 	       svc->srv_name, i, svc->srv_buf_size, svcpt->scp_nrqbds_posted,
 	       svcpt->scp_nrqbds_total, rc);
 
- try_post:
+try_post:
 	if (post && rc == 0)
 		rc = ptlrpc_server_post_idle_rqbds(svcpt);
 
@@ -185,8 +185,8 @@
 struct ptlrpc_hr_thread {
 	int				hrt_id;		/* thread ID */
 	spinlock_t			hrt_lock;
-	wait_queue_head_t			hrt_waitq;
-	struct list_head			hrt_queue;	/* RS queue */
+	wait_queue_head_t		hrt_waitq;
+	struct list_head		hrt_queue;	/* RS queue */
 	struct ptlrpc_hr_partition	*hrt_partition;
 };
 
@@ -212,7 +212,7 @@ struct ptlrpc_hr_service {
 	/* CPU partition table, it's just cfs_cpt_tab for now */
 	struct cfs_cpt_table		*hr_cpt_table;
 	/** controller sleep waitq */
-	wait_queue_head_t			hr_waitq;
+	wait_queue_head_t		hr_waitq;
 	unsigned int			hr_stopping;
 	/** roundrobin rotor for non-affinity service */
 	unsigned int			hr_rotor;
@@ -236,7 +236,6 @@ struct ptlrpc_hr_service {
 	    svcpt->scp_service->srv_cptable == ptlrpc_hr.hr_cpt_table) {
 		/* directly match partition */
 		hrp = ptlrpc_hr.hr_partitions[svcpt->scp_cpt];
-
 	} else {
 		rotor = ptlrpc_hr.hr_rotor++;
 		rotor %= cfs_cpt_number(ptlrpc_hr.hr_cpt_table);
@@ -440,7 +439,7 @@ static void ptlrpc_at_timer(struct timer_list *t)
 		nthrs = max(tc->tc_nthrs_base,
 			    tc->tc_nthrs_max / svc->srv_ncpts);
 	}
- out:
+out:
 	nthrs = max(nthrs, tc->tc_nthrs_init);
 	svc->srv_nthrs_cpt_limit = nthrs;
 	svc->srv_nthrs_cpt_init = init;
@@ -459,7 +458,7 @@ static void ptlrpc_at_timer(struct timer_list *t)
 ptlrpc_service_part_init(struct ptlrpc_service *svc,
 			 struct ptlrpc_service_part *svcpt, int cpt)
 {
-	struct ptlrpc_at_array	*array;
+	struct ptlrpc_at_array *array;
 	int size;
 	int index;
 	int rc;
@@ -1125,7 +1124,6 @@ static int ptlrpc_at_send_early_reply(struct ptlrpc_request *req)
 		goto out_put;
 
 	rc = ptlrpc_send_reply(reqcopy, PTLRPC_REPLY_EARLY);
-
 	if (!rc) {
 		/* Adjust our own deadline to what we told the client */
 		req->rq_deadline = newdl;
@@ -1316,7 +1314,7 @@ static void ptlrpc_server_hpreq_fini(struct ptlrpc_request *req)
 static int ptlrpc_server_request_add(struct ptlrpc_service_part *svcpt,
 				     struct ptlrpc_request *req)
 {
-	int	rc;
+	int rc;
 
 	rc = ptlrpc_server_hpreq_init(svcpt, req);
 	if (rc < 0)
@@ -2412,7 +2410,7 @@ int ptlrpc_start_threads(struct ptlrpc_service *svc)
 	}
 
 	return 0;
- failed:
+failed:
 	CERROR("cannot start %s thread #%d_%d: rc %d\n",
 	       svc->srv_thread_name, i, j, rc);
 	ptlrpc_stop_all_threads(svc);
@@ -2432,7 +2430,7 @@ int ptlrpc_start_thread(struct ptlrpc_service_part *svcpt, int wait)
 	       svc->srv_name, svcpt->scp_cpt, svcpt->scp_nthrs_running,
 	       svc->srv_nthrs_cpt_init, svc->srv_nthrs_cpt_limit);
 
- again:
+again:
 	if (unlikely(svc->srv_is_stopping))
 		return -ESRCH;
 
Signature · 1 line
1.8.3.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.lustre.org/pipermail/lustre-devel-lustre.org/attachments/20190204/e62771ca/attachment-0001.sig>

#21 lore raw

PATCH 20/26 lustre: first batch to cleanup white spaces in internal headers

In reply to James Simmons

The internal headers are very messy and difficult to read. Remove excess white space and properly align data structures so they are easy on the eyes. This is the first batch since it covers many lines of changes.

---
 drivers/staging/lustre/lustre/include/cl_object.h  | 338 ++++++++++-----------
 .../staging/lustre/lustre/include/lprocfs_status.h |  77 ++---
 drivers/staging/lustre/lustre/include/lu_object.h  | 322 ++++++++++----------
 .../staging/lustre/lustre/include/lustre_disk.h    |  42 +--
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 256 ++++++++--------
 .../lustre/lustre/include/lustre_dlm_flags.h       | 326 ++++++++++----------
 6 files changed, 682 insertions(+), 679 deletions(-)
drivers/staging/lustre/lustre/include/cl_object.h +169 -169
index 3109c04..b8ae41d 100644
@@ -49,16 +49,16 @@
  *
  *   - cl_page
  *
- *   - cl_lock     represents an extent lock on an object.
+ *   - cl_lock	represents an extent lock on an object.
  *
- *   - cl_io       represents high-level i/o activity such as whole read/write
- *		 system call, or write-out of pages from under the lock being
- *		 canceled. cl_io has sub-ios that can be stopped and resumed
- *		 independently, thus achieving high degree of transfer
- *		 parallelism. Single cl_io can be advanced forward by
- *		 the multiple threads (although in the most usual case of
- *		 read/write system call it is associated with the single user
- *		 thread, that issued the system call).
+ *   - cl_io	represents high-level i/o activity such as whole read/write
+ *		system call, or write-out of pages from under the lock being
+ *		canceled. cl_io has sub-ios that can be stopped and resumed
+ *		independently, thus achieving high degree of transfer
+ *		parallelism. Single cl_io can be advanced forward by
+ *		the multiple threads (although in the most usual case of
+ *		read/write system call it is associated with the single user
+ *		thread, that issued the system call).
  *
  * Terminology
  *
@@ -135,39 +135,39 @@ struct cl_device {
  */
 struct cl_attr {
 	/** Object size, in bytes */
-	loff_t cat_size;
+	loff_t		cat_size;
 	/**
 	 * Known minimal size, in bytes.
 	 *
 	 * This is only valid when at least one DLM lock is held.
 	 */
-	loff_t cat_kms;
+	loff_t		cat_kms;
 	/** Modification time. Measured in seconds since epoch. */
-	time64_t cat_mtime;
+	time64_t	cat_mtime;
 	/** Access time. Measured in seconds since epoch. */
-	time64_t cat_atime;
+	time64_t	cat_atime;
 	/** Change time. Measured in seconds since epoch. */
-	time64_t cat_ctime;
+	time64_t	cat_ctime;
 	/**
 	 * Blocks allocated to this cl_object on the server file system.
 	 *
 	 * \todo XXX An interface for block size is needed.
 	 */
-	u64  cat_blocks;
+	u64		cat_blocks;
 	/**
 	 * User identifier for quota purposes.
 	 */
-	uid_t  cat_uid;
+	uid_t		cat_uid;
 	/**
 	 * Group identifier for quota purposes.
 	 */
-	gid_t  cat_gid;
+	gid_t		cat_gid;
 
 	/* nlink of the directory */
-	u64  cat_nlink;
+	u64		cat_nlink;
 
 	/* Project identifier for quota purpose. */
-	u32	cat_projid;
+	u32		cat_projid;
 };
 
 /**
@@ -223,11 +223,11 @@ enum cl_attr_valid {
  */
 struct cl_object {
 	/** super class */
-	struct lu_object		   co_lu;
+	struct lu_object			co_lu;
 	/** per-object-layer operations */
-	const struct cl_object_operations *co_ops;
+	const struct cl_object_operations	*co_ops;
 	/** offset of page slice in cl_page buffer */
-	int				   co_slice_off;
+	int					co_slice_off;
 };
 
 /**
@@ -237,30 +237,30 @@ struct cl_object {
  */
 struct cl_object_conf {
 	/** Super-class. */
-	struct lu_object_conf     coc_lu;
+	struct lu_object_conf	coc_lu;
 	union {
 		/**
 		 * Object layout. This is consumed by lov.
 		 */
-		struct lu_buf	  coc_layout;
+		struct lu_buf		coc_layout;
 		/**
 		 * Description of particular stripe location in the
 		 * cluster. This is consumed by osc.
 		 */
-		struct lov_oinfo *coc_oinfo;
+		struct lov_oinfo	*coc_oinfo;
 	} u;
 	/**
 	 * VFS inode. This is consumed by vvp.
 	 */
-	struct inode	     *coc_inode;
+	struct inode		*coc_inode;
 	/**
 	 * Layout lock handle.
 	 */
-	struct ldlm_lock	 *coc_lock;
+	struct ldlm_lock	*coc_lock;
 	/**
 	 * Operation to handle layout, OBJECT_CONF_XYZ.
 	 */
-	int			  coc_opc;
+	int			coc_opc;
 };
 
 enum {
@@ -283,13 +283,13 @@ enum {
 
 struct cl_layout {
 	/** the buffer to return the layout in lov_mds_md format. */
-	struct lu_buf	cl_buf;
+	struct lu_buf		cl_buf;
 	/** size of layout in lov_mds_md format. */
-	size_t		cl_size;
+	size_t			cl_size;
 	/** Layout generation. */
-	u32		cl_layout_gen;
+	u32			cl_layout_gen;
 	/** whether layout is a composite one */
-	bool		cl_is_composite;
+	bool			cl_is_composite;
 };
 
 /**
@@ -421,7 +421,7 @@ struct cl_object_header {
 	/** Standard lu_object_header. cl_object::co_lu::lo_header points
 	 * here.
 	 */
-	struct lu_object_header  coh_lu;
+	struct lu_object_header	 coh_lu;
 
 	/**
 	 * Parent object. It is assumed that an object has a well-defined
@@ -454,16 +454,16 @@ struct cl_object_header {
  * Helper macro: iterate over all layers of the object \a obj, assigning every
  * layer top-to-bottom to \a slice.
  */
-#define cl_object_for_each(slice, obj)				      \
-	list_for_each_entry((slice),				    \
-				&(obj)->co_lu.lo_header->loh_layers,	\
-				co_lu.lo_linkage)
+#define cl_object_for_each(slice, obj)					\
+	list_for_each_entry((slice),					\
+			    &(obj)->co_lu.lo_header->loh_layers,	\
+			    co_lu.lo_linkage)
 /**
  * Helper macro: iterate over all layers of the object \a obj, assigning every
  * layer bottom-to-top to \a slice.
  */
-#define cl_object_for_each_reverse(slice, obj)			       \
-	list_for_each_entry_reverse((slice),			     \
+#define cl_object_for_each_reverse(slice, obj)				\
+	list_for_each_entry_reverse((slice),				\
 					&(obj)->co_lu.lo_header->loh_layers, \
 					co_lu.lo_linkage)
 /** @} cl_object */
@@ -717,39 +717,39 @@ enum cl_page_type {
  */
 struct cl_page {
 	/** Reference counter. */
-	atomic_t	     cp_ref;
+	atomic_t			 cp_ref;
 	/** An object this page is a part of. Immutable after creation. */
-	struct cl_object	*cp_obj;
+	struct cl_object		*cp_obj;
 	/** vmpage */
-	struct page		*cp_vmpage;
+	struct page			*cp_vmpage;
 	/** Linkage of pages within group. Pages must be owned */
-	struct list_head	 cp_batch;
+	struct list_head		 cp_batch;
 	/** List of slices. Immutable after creation. */
-	struct list_head	 cp_layers;
+	struct list_head		 cp_layers;
 	/**
 	 * Page state. This field is const to avoid accidental update, it is
 	 * modified only internally within cl_page.c. Protected by a VM lock.
 	 */
-	const enum cl_page_state cp_state;
+	const enum cl_page_state	 cp_state;
 	/**
 	 * Page type. Only CPT_TRANSIENT is used so far. Immutable after
 	 * creation.
 	 */
-	enum cl_page_type	cp_type;
+	enum cl_page_type		 cp_type;
 
 	/**
 	 * Owning IO in cl_page_state::CPS_OWNED state. Sub-page can be owned
 	 * by sub-io. Protected by a VM lock.
 	 */
-	struct cl_io	    *cp_owner;
+	struct cl_io			*cp_owner;
 	/** List of references to this page, for debugging. */
-	struct lu_ref	    cp_reference;
+	struct lu_ref			 cp_reference;
 	/** Link to an object, for debugging. */
-	struct lu_ref_link       cp_obj_ref;
+	struct lu_ref_link		 cp_obj_ref;
 	/** Link to a queue, for debugging. */
-	struct lu_ref_link       cp_queue_ref;
+	struct lu_ref_link		 cp_queue_ref;
 	/** Assigned if doing a sync_io */
-	struct cl_sync_io       *cp_sync_io;
+	struct cl_sync_io		*cp_sync_io;
 };
 
 /**
@@ -758,7 +758,7 @@ struct cl_page {
  * \see vvp_page, lov_page, osc_page
  */
 struct cl_page_slice {
-	struct cl_page		  *cpl_page;
+	struct cl_page			*cpl_page;
 	pgoff_t				 cpl_index;
 	/**
 	 * Object slice corresponding to this page slice. Immutable after
@@ -767,7 +767,7 @@ struct cl_page_slice {
 	struct cl_object		*cpl_obj;
 	const struct cl_page_operations *cpl_ops;
 	/** Linkage into cl_page::cp_layers. Immutable after creation. */
-	struct list_head		       cpl_linkage;
+	struct list_head		 cpl_linkage;
 };
 
 /**
@@ -986,25 +986,25 @@ struct cl_page_operations {
 /**
  * Helper macro, dumping detailed information about \a page into a log.
  */
-#define CL_PAGE_DEBUG(mask, env, page, format, ...)		     \
-do {								    \
-	if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) {		   \
+#define CL_PAGE_DEBUG(mask, env, page, format, ...)			\
+do {									\
+	if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) {			\
 		LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL);	\
 		cl_page_print(env, &msgdata, lu_cdebug_printer, page);  \
-		CDEBUG(mask, format, ## __VA_ARGS__);		  \
-	}							       \
+		CDEBUG(mask, format, ## __VA_ARGS__);			\
+	}								\
 } while (0)
 
 /**
  * Helper macro, dumping shorter information about \a page into a log.
  */
-#define CL_PAGE_HEADER(mask, env, page, format, ...)			  \
-do {									  \
-	if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) {			 \
-		LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL);		\
+#define CL_PAGE_HEADER(mask, env, page, format, ...)			\
+do {									\
+	if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) {			\
+		LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL);	\
 		cl_page_header_print(env, &msgdata, lu_cdebug_printer, page); \
 		CDEBUG(mask, format, ## __VA_ARGS__);			\
-	}								     \
+	}								\
 } while (0)
 
 static inline struct page *cl_page_vmpage(struct cl_page *page)
@@ -1145,24 +1145,24 @@ static inline bool __page_in_use(const struct cl_page *page, int refc)
  */
 struct cl_lock_descr {
 	/** Object this lock is granted for. */
-	struct cl_object *cld_obj;
+	struct cl_object		*cld_obj;
 	/** Index of the first page protected by this lock. */
-	pgoff_t	   cld_start;
+	pgoff_t				cld_start;
 	/** Index of the last page (inclusive) protected by this lock. */
-	pgoff_t	   cld_end;
+	pgoff_t				cld_end;
 	/** Group ID, for group lock */
-	u64	     cld_gid;
+	u64				cld_gid;
 	/** Lock mode. */
-	enum cl_lock_mode cld_mode;
+	enum cl_lock_mode		cld_mode;
 	/**
 	 * flags to enqueue lock. A combination of bit-flags from
 	 * enum cl_enq_flags.
 	 */
-	u32	     cld_enq_flags;
+	u32				cld_enq_flags;
 };
 
 #define DDESCR "%s(%d):[%lu, %lu]:%x"
-#define PDESCR(descr)						   \
+#define PDESCR(descr)							\
 	cl_lock_mode_name((descr)->cld_mode), (descr)->cld_mode,	\
 	(descr)->cld_start, (descr)->cld_end, (descr)->cld_enq_flags
 
@@ -1173,9 +1173,9 @@ struct cl_lock_descr {
  */
 struct cl_lock {
 	/** List of slices. Immutable after creation. */
-	struct list_head	    cll_layers;
+	struct list_head		cll_layers;
 	/** lock attribute, extent, cl_object, etc. */
-	struct cl_lock_descr  cll_descr;
+	struct cl_lock_descr		cll_descr;
 };
 
 /**
@@ -1184,14 +1184,14 @@ struct cl_lock {
  * \see vvp_lock, lov_lock, lovsub_lock, osc_lock
  */
 struct cl_lock_slice {
-	struct cl_lock		  *cls_lock;
+	struct cl_lock			*cls_lock;
 	/** Object slice corresponding to this lock slice. Immutable after
 	 * creation.
 	 */
 	struct cl_object		*cls_obj;
 	const struct cl_lock_operations *cls_ops;
 	/** Linkage into cl_lock::cll_layers. Immutable after creation. */
-	struct list_head		       cls_linkage;
+	struct list_head		 cls_linkage;
 };
 
 /**
@@ -1236,22 +1236,22 @@ struct cl_lock_operations {
 			 const struct cl_lock_slice *slice);
 };
 
-#define CL_LOCK_DEBUG(mask, env, lock, format, ...)		     \
-do {								    \
+#define CL_LOCK_DEBUG(mask, env, lock, format, ...)			\
+do {									\
 	LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL);		\
 									\
-	if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) {		   \
+	if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) {			\
 		cl_lock_print(env, &msgdata, lu_cdebug_printer, lock);  \
-		CDEBUG(mask, format, ## __VA_ARGS__);		  \
-	}							       \
+		CDEBUG(mask, format, ## __VA_ARGS__);			\
+	}								\
 } while (0)
 
-#define CL_LOCK_ASSERT(expr, env, lock) do {			    \
-	if (likely(expr))					       \
-		break;						  \
+#define CL_LOCK_ASSERT(expr, env, lock) do {				\
+	if (likely(expr))						\
+		break;							\
 									\
 	CL_LOCK_DEBUG(D_ERROR, env, lock, "failed at %s.\n", #expr);    \
-	LBUG();							 \
+	LBUG();								\
 } while (0)
 
 /** @} cl_lock */
@@ -1276,9 +1276,9 @@ struct cl_lock_operations {
  * @{
  */
 struct cl_page_list {
-	unsigned int		 pl_nr;
-	struct list_head	   pl_pages;
-	struct task_struct	*pl_owner;
+	unsigned int			pl_nr;
+	struct list_head		pl_pages;
+	struct task_struct		*pl_owner;
 };
 
 /**
@@ -1286,8 +1286,8 @@ struct cl_page_list {
  * contains an incoming page list and an outgoing page list.
  */
 struct cl_2queue {
-	struct cl_page_list c2_qin;
-	struct cl_page_list c2_qout;
+	struct cl_page_list		c2_qin;
+	struct cl_page_list		c2_qout;
 };
 
 /** @} cl_page_list */
@@ -1424,16 +1424,16 @@ enum cl_io_state {
  * \see vvp_io, lov_io, osc_io
  */
 struct cl_io_slice {
-	struct cl_io		  *cis_io;
+	struct cl_io			*cis_io;
 	/** corresponding object slice. Immutable after creation. */
-	struct cl_object	      *cis_obj;
+	struct cl_object		*cis_obj;
 	/** io operations. Immutable after creation. */
-	const struct cl_io_operations *cis_iop;
+	const struct cl_io_operations	*cis_iop;
 	/**
 	 * linkage into a list of all slices for a given cl_io, hanging off
 	 * cl_io::ci_layers. Immutable after creation.
 	 */
-	struct list_head		     cis_linkage;
+	struct list_head		cis_linkage;
 };
 
 typedef void (*cl_commit_cbt)(const struct lu_env *, struct cl_io *,
@@ -1445,16 +1445,16 @@ struct cl_read_ahead {
 	 * This is determined DLM lock coverage, RPC and stripe boundary.
 	 * cra_end is included.
 	 */
-	pgoff_t cra_end;
+	pgoff_t				cra_end;
 	/* optimal RPC size for this read, by pages */
-	unsigned long cra_rpc_size;
+	unsigned long			cra_rpc_size;
 	/*
 	 * Release callback. If readahead holds resources underneath, this
 	 * function should be called to release it.
 	 */
 	void (*cra_release)(const struct lu_env *env, void *cbdata);
 	/* Callback data for cra_release routine */
-	void *cra_cbdata;
+	void				*cra_cbdata;
 };
 
 static inline void cl_read_ahead_release(const struct lu_env *env,
@@ -1594,18 +1594,18 @@ enum cl_enq_flags {
 	 * instruct server to not block, if conflicting lock is found. Instead
 	 * -EWOULDBLOCK is returned immediately.
 	 */
-	CEF_NONBLOCK     = 0x00000001,
+	CEF_NONBLOCK		= 0x00000001,
 	/**
 	 * take lock asynchronously (out of order), as it cannot
 	 * deadlock. This is for LDLM_FL_HAS_INTENT locks used for glimpsing.
 	 */
-	CEF_ASYNC	= 0x00000002,
+	CEF_ASYNC		= 0x00000002,
 	/**
 	 * tell the server to instruct (though a flag in the blocking ast) an
 	 * owner of the conflicting lock, that it can drop dirty pages
 	 * protected by this lock, without sending them to the server.
 	 */
-	CEF_DISCARD_DATA = 0x00000004,
+	CEF_DISCARD_DATA	= 0x00000004,
 	/**
 	 * tell the sub layers that it must be a `real' lock. This is used for
 	 * mmapped-buffer locks and glimpse locks that must be never converted
@@ -1613,7 +1613,7 @@ enum cl_enq_flags {
 	 *
 	 * \see vvp_mmap_locks(), cl_glimpse_lock().
 	 */
-	CEF_MUST	 = 0x00000008,
+	CEF_MUST		= 0x00000008,
 	/**
 	 * tell the sub layers that never request a `real' lock. This flag is
 	 * not used currently.
@@ -1624,24 +1624,24 @@ enum cl_enq_flags {
 	 * object doing IO; however, lock itself may have precise requirements
 	 * that are described by the enqueue flags.
 	 */
-	CEF_NEVER	= 0x00000010,
+	CEF_NEVER		= 0x00000010,
 	/**
 	 * for async glimpse lock.
 	 */
-	CEF_AGL	  = 0x00000020,
+	CEF_AGL			= 0x00000020,
 	/**
 	 * enqueue a lock to test DLM lock existence.
 	 */
-	CEF_PEEK	= 0x00000040,
+	CEF_PEEK		= 0x00000040,
 	/**
 	 * Lock match only. Used by group lock in I/O as group lock
 	 * is known to exist.
 	 */
-	CEF_LOCK_MATCH	= BIT(7),
+	CEF_LOCK_MATCH		= BIT(7),
 	/**
 	 * mask of enq_flags.
 	 */
-	CEF_MASK	= 0x000000ff,
+	CEF_MASK		= 0x000000ff,
 };
 
 /**
@@ -1650,8 +1650,8 @@ enum cl_enq_flags {
  */
 struct cl_io_lock_link {
 	/** linkage into one of cl_lockset lists. */
-	struct list_head	   cill_linkage;
-	struct cl_lock          cill_lock;
+	struct list_head	cill_linkage;
+	struct cl_lock		cill_lock;
 	/** optional destructor */
 	void	       (*cill_fini)(const struct lu_env *env,
 				    struct cl_io_lock_link *link);
@@ -1689,9 +1689,9 @@ struct cl_io_lock_link {
  */
 struct cl_lockset {
 	/** locks to be acquired. */
-	struct list_head  cls_todo;
+	struct list_head	cls_todo;
 	/** locks acquired. */
-	struct list_head  cls_done;
+	struct list_head	cls_done;
 };
 
 /**
@@ -1709,21 +1709,21 @@ enum cl_io_lock_dmd {
 
 enum cl_fsync_mode {
 	/** start writeback, do not wait for them to finish */
-	CL_FSYNC_NONE  = 0,
+	CL_FSYNC_NONE		= 0,
 	/** start writeback and wait for them to finish */
-	CL_FSYNC_LOCAL = 1,
+	CL_FSYNC_LOCAL		= 1,
 	/** discard all of dirty pages in a specific file range */
-	CL_FSYNC_DISCARD = 2,
+	CL_FSYNC_DISCARD	= 2,
 	/** start writeback and make sure they have reached storage before
 	 * return. OST_SYNC RPC must be issued and finished
 	 */
-	CL_FSYNC_ALL   = 3
+	CL_FSYNC_ALL		= 3
 };
 
 struct cl_io_rw_common {
-	loff_t      crw_pos;
-	size_t      crw_count;
-	int	 crw_nonblock;
+	loff_t			crw_pos;
+	size_t			crw_count;
+	int			crw_nonblock;
 };
 
 /**
@@ -1739,65 +1739,65 @@ struct cl_io {
 	/** type of this IO. Immutable after creation. */
 	enum cl_io_type		ci_type;
 	/** current state of cl_io state machine. */
-	enum cl_io_state	       ci_state;
+	enum cl_io_state	ci_state;
 	/** main object this io is against. Immutable after creation. */
-	struct cl_object	      *ci_obj;
+	struct cl_object	*ci_obj;
 	/**
 	 * Upper layer io, of which this io is a part of. Immutable after
 	 * creation.
 	 */
-	struct cl_io		  *ci_parent;
+	struct cl_io		*ci_parent;
 	/** List of slices. Immutable after creation. */
-	struct list_head		     ci_layers;
+	struct list_head	ci_layers;
 	/** list of locks (to be) acquired by this io. */
-	struct cl_lockset	      ci_lockset;
+	struct cl_lockset	ci_lockset;
 	/** lock requirements, this is just a help info for sublayers. */
-	enum cl_io_lock_dmd	    ci_lockreq;
+	enum cl_io_lock_dmd	ci_lockreq;
 	union {
 		struct cl_rd_io {
-			struct cl_io_rw_common rd;
+			struct cl_io_rw_common	rd;
 		} ci_rd;
 		struct cl_wr_io {
-			struct cl_io_rw_common wr;
-			int		    wr_append;
-			int		    wr_sync;
+			struct cl_io_rw_common	wr;
+			int			wr_append;
+			int			wr_sync;
 		} ci_wr;
-		struct cl_io_rw_common ci_rw;
+		struct cl_io_rw_common	ci_rw;
 		struct cl_setattr_io {
-			struct ost_lvb   sa_attr;
-			unsigned int		 sa_attr_flags;
-			unsigned int     sa_avalid;
+			struct ost_lvb		sa_attr;
+			unsigned int		sa_attr_flags;
+			unsigned int		sa_avalid;
 			unsigned int		sa_xvalid; /* OP_XVALID */
-			int		sa_stripe_index;
-			struct ost_layout	 sa_layout;
+			int			sa_stripe_index;
+			struct ost_layout	sa_layout;
 			const struct lu_fid	*sa_parent_fid;
 		} ci_setattr;
 		struct cl_data_version_io {
-			u64 dv_data_version;
-			int dv_flags;
+			u64			dv_data_version;
+			int			dv_flags;
 		} ci_data_version;
 		struct cl_fault_io {
 			/** page index within file. */
-			pgoff_t	 ft_index;
+			pgoff_t			ft_index;
 			/** bytes valid byte on a faulted page. */
-			size_t	     ft_nob;
+			size_t			ft_nob;
 			/** writable page? for nopage() only */
-			int	     ft_writable;
+			int			ft_writable;
 			/** page of an executable? */
-			int	     ft_executable;
+			int			ft_executable;
 			/** page_mkwrite() */
-			int	     ft_mkwrite;
+			int			ft_mkwrite;
 			/** resulting page */
-			struct cl_page *ft_page;
+			struct cl_page		*ft_page;
 		} ci_fault;
 		struct cl_fsync_io {
-			loff_t	     fi_start;
-			loff_t	     fi_end;
+			loff_t			fi_start;
+			loff_t			fi_end;
 			/** file system level fid */
-			struct lu_fid     *fi_fid;
-			enum cl_fsync_mode fi_mode;
+			struct lu_fid		*fi_fid;
+			enum cl_fsync_mode	fi_mode;
 			/* how many pages were written/discarded */
-			unsigned int       fi_nr_written;
+			unsigned int		fi_nr_written;
 		} ci_fsync;
 		struct cl_ladvise_io {
 			u64			li_start;
@@ -1808,30 +1808,30 @@ struct cl_io {
 			u64			li_flags;
 		} ci_ladvise;
 	} u;
-	struct cl_2queue     ci_queue;
-	size_t	       ci_nob;
-	int		  ci_result;
-	unsigned int	 ci_continue:1,
+	struct cl_2queue	ci_queue;
+	size_t			ci_nob;
+	int			ci_result;
+	unsigned int		ci_continue:1,
 	/**
 	 * This io has held grouplock, to inform sublayers that
 	 * don't do lockless i/o.
 	 */
-			     ci_no_srvlock:1,
+				ci_no_srvlock:1,
 	/**
 	 * The whole IO need to be restarted because layout has been changed
 	 */
-			     ci_need_restart:1,
+				ci_need_restart:1,
 	/**
 	 * to not refresh layout - the IO issuer knows that the layout won't
 	 * change(page operations, layout change causes all page to be
 	 * discarded), or it doesn't matter if it changes(sync).
 	 */
-			     ci_ignore_layout:1,
+				ci_ignore_layout:1,
 	/**
 	 * Need MDS intervention to complete a write. This usually means the
 	 * corresponding component is not initialized for the writing extent.
 	 */
-			ci_need_write_intent:1,
+				ci_need_write_intent:1,
 	/**
 	 * Check if layout changed after the IO finishes. Mainly for HSM
 	 * requirement. If IO occurs to openning files, it doesn't need to
@@ -1839,19 +1839,19 @@ struct cl_io {
 	 * Right now, only two operations need to verify layout: glimpse
 	 * and setattr.
 	 */
-			     ci_verify_layout:1,
+				ci_verify_layout:1,
 	/**
 	 * file is released, restore has to be triggered by vvp layer
 	 */
-			     ci_restore_needed:1,
+				ci_restore_needed:1,
 	/**
 	 * O_NOATIME
 	 */
-			     ci_noatime:1;
+				ci_noatime:1;
 	/**
 	 * Number of pages owned by this IO. For invariant checking.
 	 */
-	unsigned int	     ci_owned_nr;
+	unsigned int		ci_owned_nr;
 };
 
 /** @} cl_io */
@@ -1860,14 +1860,14 @@ struct cl_io {
  * Per-transfer attributes.
  */
 struct cl_req_attr {
-	enum cl_req_type cra_type;
-	u64		 cra_flags;
-	struct cl_page	*cra_page;
+	enum cl_req_type	cra_type;
+	u64			cra_flags;
+	struct cl_page	       *cra_page;
 
 	/** Generic attributes for the server consumption. */
-	struct obdo	*cra_oa;
+	struct obdo	       *cra_oa;
 	/** Jobid */
-	char		 cra_jobid[LUSTRE_JOBID_SIZE];
+	char			cra_jobid[LUSTRE_JOBID_SIZE];
 };
 
 enum cache_stats_item {
@@ -1892,8 +1892,8 @@ enum cache_stats_item {
  * Stats for a generic cache (similar to inode, lu_object, etc. caches).
  */
 struct cache_stats {
-	const char    *cs_name;
-	atomic_t   cs_stats[CS_NR];
+	const char	       *cs_name;
+	atomic_t		cs_stats[CS_NR];
 };
 
 /** These are not exported so far */
@@ -1905,7 +1905,7 @@ struct cache_stats {
  * clients to co-exist in the single address space.
  */
 struct cl_site {
-	struct lu_site	cs_lu;
+	struct lu_site		cs_lu;
 	/**
 	 * Statistical counters. Atomics do not scale, something better like
 	 * per-cpu counters is needed.
@@ -1915,8 +1915,8 @@ struct cl_site {
 	 * When interpreting keep in mind that both sub-locks (and sub-pages)
 	 * and top-locks (and top-pages) are accounted here.
 	 */
-	struct cache_stats    cs_pages;
-	atomic_t	  cs_pages_state[CPS_NR];
+	struct cache_stats	cs_pages;
+	atomic_t		cs_pages_state[CPS_NR];
 };
 
 int  cl_site_init(struct cl_site *s, struct cl_device *top);
@@ -2341,13 +2341,13 @@ static inline struct cl_page *cl_page_list_first(struct cl_page_list *plist)
 /**
  * Iterate over pages in a page list.
  */
-#define cl_page_list_for_each(page, list)			       \
+#define cl_page_list_for_each(page, list)				\
 	list_for_each_entry((page), &(list)->pl_pages, cp_batch)
 
 /**
  * Iterate over pages in a page list, taking possible removals into account.
  */
-#define cl_page_list_for_each_safe(page, temp, list)		    \
+#define cl_page_list_for_each_safe(page, temp, list)			\
 	list_for_each_entry_safe((page), (temp), &(list)->pl_pages, cp_batch)
 
 void cl_page_list_init(struct cl_page_list *plist);
@@ -2394,7 +2394,7 @@ struct cl_sync_io {
 	/** barrier of destroy this structure */
 	atomic_t		csi_barrier;
 	/** completion to be signaled when transfer is complete. */
-	wait_queue_head_t		csi_waitq;
+	wait_queue_head_t	csi_waitq;
 	/** callback to invoke when this IO is finished */
 	void			(*csi_end_io)(const struct lu_env *,
 					      struct cl_sync_io *);
drivers/staging/lustre/lustre/include/lprocfs_status.h +40 -37

141 lines not on this page · raw message

drivers/staging/lustre/lustre/include/lu_object.h +161 -161

623 lines not on this page · raw message

drivers/staging/lustre/lustre/include/lustre_disk.h +21 -21

60 lines not on this page · raw message

drivers/staging/lustre/lustre/include/lustre_dlm.h +128 -128

534 lines not on this page · raw message

drivers/staging/lustre/lustre/include/lustre_dlm_flags.h +163 -163

495 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#22 lore raw

PATCH 21/26 lustre: second batch to cleanup white spaces in internal headers

In reply to James Simmons

The internal headers are very messy and difficult to read. Remove excess white space and properly align data structures so they are easy on the eyes. This is the second batch since it covers many lines of changes.

---
 .../staging/lustre/lustre/include/lustre_export.h  |  76 ++--
 drivers/staging/lustre/lustre/include/lustre_fid.h |  12 +-
 drivers/staging/lustre/lustre/include/lustre_fld.h |  14 +-
 .../staging/lustre/lustre/include/lustre_handles.h |   2 +-
 .../staging/lustre/lustre/include/lustre_import.h  | 225 ++++++------
 .../staging/lustre/lustre/include/lustre_intent.h  |  24 +-
 drivers/staging/lustre/lustre/include/lustre_lib.h |   2 -
 drivers/staging/lustre/lustre/include/lustre_log.h |  38 +-
 drivers/staging/lustre/lustre/include/lustre_mdc.h |   2 +-
 drivers/staging/lustre/lustre/include/lustre_mds.h |   4 +-
 drivers/staging/lustre/lustre/include/lustre_net.h | 388 +++++++++++----------
 .../lustre/lustre/include/lustre_nrs_fifo.h        |   4 +-
 .../lustre/lustre/include/lustre_req_layout.h      |   8 +-
 drivers/staging/lustre/lustre/include/lustre_sec.h | 300 ++++++++--------
 14 files changed, 550 insertions(+), 549 deletions(-)
drivers/staging/lustre/lustre/include/lustre_export.h +38 -38
index 1c70259..63fa656 100644
@@ -48,9 +48,9 @@
 #include <lustre_dlm.h>
 
 enum obd_option {
-	OBD_OPT_FORCE =	 0x0001,
-	OBD_OPT_FAILOVER =      0x0002,
-	OBD_OPT_ABORT_RECOV =   0x0004,
+	OBD_OPT_FORCE		= 0x0001,
+	OBD_OPT_FAILOVER	= 0x0002,
+	OBD_OPT_ABORT_RECOV	= 0x0004,
 };
 
 /**
@@ -66,77 +66,77 @@ struct obd_export {
 	 * Subsequent client RPCs contain this handle id to identify
 	 * what export they are talking to.
 	 */
-	struct portals_handle     exp_handle;
-	atomic_t	      exp_refcount;
+	struct portals_handle		exp_handle;
+	atomic_t			exp_refcount;
 	/**
 	 * Set of counters below is to track where export references are
 	 * kept. The exp_rpc_count is used for reconnect handling also,
 	 * the cb_count and locks_count are for debug purposes only for now.
 	 * The sum of them should be less than exp_refcount by 3
 	 */
-	atomic_t	      exp_rpc_count; /* RPC references */
-	atomic_t	      exp_cb_count; /* Commit callback references */
+	atomic_t			exp_rpc_count; /* RPC references */
+	atomic_t			exp_cb_count; /* Commit callback references */
 	/** Number of queued replay requests to be processes */
-	atomic_t		  exp_replay_count;
-	atomic_t	      exp_locks_count; /** Lock references */
+	atomic_t			exp_replay_count;
+	atomic_t			exp_locks_count; /** Lock references */
 #if LUSTRE_TRACKS_LOCK_EXP_REFS
 	struct list_head		exp_locks_list;
-	spinlock_t		  exp_locks_list_guard;
+	spinlock_t			exp_locks_list_guard;
 #endif
 	/** UUID of client connected to this export */
-	struct obd_uuid	   exp_client_uuid;
+	struct obd_uuid			exp_client_uuid;
 	/** To link all exports on an obd device */
 	struct list_head		exp_obd_chain;
 	/** work_struct for destruction of export */
-	struct work_struct	exp_zombie_work;
-	struct rhash_head	exp_uuid_hash; /** uuid-export hash*/
+	struct work_struct		exp_zombie_work;
+	struct rhash_head		exp_uuid_hash; /** uuid-export hash*/
 	/** Obd device of this export */
-	struct obd_device	*exp_obd;
+	struct obd_device		*exp_obd;
 	/**
 	 * "reverse" import to send requests (e.g. from ldlm) back to client
 	 * exp_lock protect its change
 	 */
-	struct obd_import	*exp_imp_reverse;
-	struct lprocfs_stats     *exp_md_stats;
+	struct obd_import		*exp_imp_reverse;
+	struct lprocfs_stats		*exp_md_stats;
 	/** Active connection */
-	struct ptlrpc_connection *exp_connection;
+	struct ptlrpc_connection	*exp_connection;
 	/** Connection count value from last successful reconnect rpc */
-	u32		     exp_conn_cnt;
+	u32				exp_conn_cnt;
 	struct list_head		exp_outstanding_replies;
 	struct list_head		exp_uncommitted_replies;
-	spinlock_t		  exp_uncommitted_replies_lock;
+	spinlock_t			exp_uncommitted_replies_lock;
 	/** Last committed transno for this export */
-	u64		     exp_last_committed;
+	u64				exp_last_committed;
 	/** On replay all requests waiting for replay are linked here */
 	struct list_head		exp_req_replay_queue;
 	/**
 	 * protects exp_flags, exp_outstanding_replies and the change
 	 * of exp_imp_reverse
 	 */
-	spinlock_t		  exp_lock;
+	spinlock_t			exp_lock;
 	/** Compatibility flags for this export are embedded into
 	 *  exp_connect_data
 	 */
-	struct obd_connect_data   exp_connect_data;
-	enum obd_option	   exp_flags;
-	unsigned long	     exp_failed:1,
-				  exp_disconnected:1,
-				  exp_connecting:1,
-				  exp_flvr_changed:1,
-				  exp_flvr_adapt:1;
+	struct obd_connect_data		exp_connect_data;
+	enum obd_option			exp_flags;
+	unsigned long			exp_failed:1,
+					exp_disconnected:1,
+					exp_connecting:1,
+					exp_flvr_changed:1,
+					exp_flvr_adapt:1;
 	/* also protected by exp_lock */
-	enum lustre_sec_part      exp_sp_peer;
-	struct sptlrpc_flavor     exp_flvr;	     /* current */
-	struct sptlrpc_flavor     exp_flvr_old[2];      /* about-to-expire */
-	time64_t		  exp_flvr_expire[2];   /* seconds */
+	enum lustre_sec_part		exp_sp_peer;
+	struct sptlrpc_flavor		exp_flvr;	    /* current */
+	struct sptlrpc_flavor		exp_flvr_old[2];    /* about-to-expire */
+	time64_t			exp_flvr_expire[2]; /* seconds */
 
 	/** protects exp_hp_rpcs */
-	spinlock_t		  exp_rpc_lock;
-	struct list_head		  exp_hp_rpcs;	/* (potential) HP RPCs */
+	spinlock_t			exp_rpc_lock;
+	struct list_head		exp_hp_rpcs;	/* (potential) HP RPCs */
 
 	/** blocking dlm lock list, protected by exp_bl_list_lock */
 	struct list_head		exp_bl_list;
-	spinlock_t		  exp_bl_list_lock;
+	spinlock_t			exp_bl_list_lock;
 };
 
 static inline u64 *exp_connect_flags_ptr(struct obd_export *exp)
@@ -239,9 +239,9 @@ static inline bool imp_connect_disp_stripe(struct obd_import *imp)
 
 #define KKUC_CT_DATA_MAGIC	0x092013cea
 struct kkuc_ct_data {
-	u32		kcd_magic;
-	struct obd_uuid	kcd_uuid;
-	u32		kcd_archive;
+	u32			kcd_magic;
+	struct obd_uuid		kcd_uuid;
+	u32			kcd_archive;
 };
 
 /** @} export */
drivers/staging/lustre/lustre/include/lustre_fid.h +6 -6
index f0afa8d..5108864 100644
@@ -331,13 +331,13 @@ struct lu_client_seq {
 	 * clients, this contains meta-sequence range. And for servers this
 	 * contains super-sequence range.
 	 */
-	struct lu_seq_range	 lcs_space;
+	struct lu_seq_range	lcs_space;
 
 	/* Seq related proc */
 	struct dentry		*lcs_debugfs_entry;
 
 	/* This holds last allocated fid in last obtained seq */
-	struct lu_fid	   lcs_fid;
+	struct lu_fid		lcs_fid;
 
 	/* LUSTRE_SEQ_METADATA or LUSTRE_SEQ_DATA */
 	enum lu_cli_type	lcs_type;
@@ -346,17 +346,17 @@ struct lu_client_seq {
 	 * Service uuid, passed from MDT + seq name to form unique seq name to
 	 * use it with procfs.
 	 */
-	char		    lcs_name[LUSTRE_MDT_MAXNAMELEN];
+	char			lcs_name[LUSTRE_MDT_MAXNAMELEN];
 
 	/*
 	 * Sequence width, that is how many objects may be allocated in one
 	 * sequence. Default value for it is LUSTRE_SEQ_MAX_WIDTH.
 	 */
-	u64		   lcs_width;
+	u64			lcs_width;
 
 	/* wait queue for fid allocation and update indicator */
-	wait_queue_head_t	     lcs_waitq;
-	int		     lcs_update;
+	wait_queue_head_t	lcs_waitq;
+	int			lcs_update;
 };
 
 /* Client methods */
drivers/staging/lustre/lustre/include/lustre_fld.h +7 -7
index 4bcabf7..92074ab 100644
@@ -59,10 +59,10 @@ enum {
 };
 
 struct lu_fld_target {
-	struct list_head	       ft_chain;
-	struct obd_export       *ft_exp;
-	struct lu_server_fld    *ft_srv;
-	u64		    ft_idx;
+	struct list_head	 ft_chain;
+	struct obd_export	*ft_exp;
+	struct lu_server_fld	*ft_srv;
+	u64			 ft_idx;
 };
 
 struct lu_server_fld {
@@ -79,7 +79,7 @@ struct lu_server_fld {
 	struct mutex		lsf_lock;
 
 	/** Fld service name in form "fld-srv-lustre-MDTXXX" */
-	char		     lsf_name[LUSTRE_MDT_MAXNAMELEN];
+	char			lsf_name[LUSTRE_MDT_MAXNAMELEN];
 
 };
 
@@ -88,13 +88,13 @@ struct lu_client_fld {
 	struct dentry		*lcf_debugfs_entry;
 
 	/** List of exports client FLD knows about. */
-	struct list_head	       lcf_targets;
+	struct list_head	 lcf_targets;
 
 	/** Current hash to be used to chose an export. */
 	struct lu_fld_hash      *lcf_hash;
 
 	/** Exports count. */
-	int		      lcf_count;
+	int			 lcf_count;
 
 	/** Lock protecting exports list and fld_hash. */
 	spinlock_t		 lcf_lock;
drivers/staging/lustre/lustre/include/lustre_handles.h +1 -1
index 84f70f3..6836808 100644
@@ -63,7 +63,7 @@ struct portals_handle_ops {
  * to compute the start of the structure based on the handle field.
  */
 struct portals_handle {
-	struct list_head			h_link;
+	struct list_head		h_link;
 	u64				h_cookie;
 	const void			*h_owner;
 	struct portals_handle_ops	*h_ops;
drivers/staging/lustre/lustre/include/lustre_import.h +113 -112

335 lines not on this page · raw message

drivers/staging/lustre/lustre/include/lustre_intent.h +12 -12
index 3f26d7a..f97c318 100644
@@ -39,18 +39,18 @@
 /* intent IT_XXX are defined in lustre/include/obd.h */
 
 struct lookup_intent {
-	int		it_op;
-	int		it_create_mode;
-	u64		it_flags;
-	int		it_disposition;
-	int		it_status;
-	u64		it_lock_handle;
-	u64		it_lock_bits;
-	int		it_lock_mode;
-	int		it_remote_lock_mode;
-	u64	   it_remote_lock_handle;
-	struct ptlrpc_request *it_request;
-	unsigned int    it_lock_set:1;
+	int			it_op;
+	int			it_create_mode;
+	u64			it_flags;
+	int			it_disposition;
+	int			it_status;
+	u64			it_lock_handle;
+	u64			it_lock_bits;
+	int			it_lock_mode;
+	int			it_remote_lock_mode;
+	u64			it_remote_lock_handle;
+	struct ptlrpc_request	*it_request;
+	unsigned int		it_lock_set:1;
 };
 
 static inline int it_disposition(struct lookup_intent *it, int flag)
drivers/staging/lustre/lustre/include/lustre_lib.h +0 -2
index 87748e9..da86e46 100644
@@ -85,8 +85,6 @@ static inline int l_fatal_signal_pending(struct task_struct *p)
 
 /** @} lib */
 
-
-
 /* l_wait_event_abortable() is a bit like wait_event_killable()
  * except there is a fixed set of signals which will abort:
  * LUSTRE_FATAL_SIGS
drivers/staging/lustre/lustre/include/lustre_log.h +19 -19
index 4ba4501..a576d40 100644
@@ -66,15 +66,15 @@ enum llog_open_param {
 };
 
 struct plain_handle_data {
-	struct list_head	  phd_entry;
-	struct llog_handle *phd_cat_handle;
-	struct llog_cookie  phd_cookie; /* cookie of this log in its cat */
+	struct list_head	 phd_entry;
+	struct llog_handle	*phd_cat_handle;
+	struct llog_cookie	 phd_cookie; /* cookie of this log in its cat */
 };
 
 struct cat_handle_data {
-	struct list_head	      chd_head;
+	struct list_head	chd_head;
 	struct llog_handle     *chd_current_log; /* currently open log */
-	struct llog_handle	*chd_next_log; /* llog to be used next */
+	struct llog_handle     *chd_next_log; /* llog to be used next */
 };
 
 struct llog_handle;
@@ -101,28 +101,28 @@ struct llog_process_data {
 	 * Any useful data needed while processing catalog. This is
 	 * passed later to process callback.
 	 */
-	void		*lpd_data;
+	void			*lpd_data;
 	/**
 	 * Catalog process callback function, called for each record
 	 * in catalog.
 	 */
-	llog_cb_t	    lpd_cb;
+	llog_cb_t		lpd_cb;
 	/**
 	 * Start processing the catalog from startcat/startidx
 	 */
-	int		  lpd_startcat;
-	int		  lpd_startidx;
+	int			lpd_startcat;
+	int			lpd_startidx;
 };
 
 struct llog_process_cat_data {
 	/**
 	 * Temporary stored first_idx while scanning log.
 	 */
-	int		  lpcd_first_idx;
+	int			lpcd_first_idx;
 	/**
 	 * Temporary stored last_idx while scanning log.
 	 */
-	int		  lpcd_last_idx;
+	int			lpcd_last_idx;
 };
 
 struct thandle;
@@ -234,23 +234,23 @@ struct llog_handle {
 #define LLOG_CTXT_FLAG_STOP		 0x00000002
 
 struct llog_ctxt {
-	int		      loc_idx; /* my index the obd array of ctxt's */
-	struct obd_device       *loc_obd; /* points back to the containing obd*/
-	struct obd_llog_group   *loc_olg; /* group containing that ctxt */
-	struct obd_export       *loc_exp; /* parent "disk" export (e.g. MDS) */
-	struct obd_import       *loc_imp; /* to use in RPC's: can be backward
+	int			 loc_idx; /* my index the obd array of ctxt's */
+	struct obd_device	*loc_obd; /* points back to the containing obd*/
+	struct obd_llog_group	*loc_olg; /* group containing that ctxt */
+	struct obd_export	*loc_exp; /* parent "disk" export (e.g. MDS) */
+	struct obd_import	*loc_imp; /* to use in RPC's: can be backward
 					   * pointing import
 					   */
 	struct llog_operations  *loc_logops;
 	struct llog_handle      *loc_handle;
 	struct mutex		 loc_mutex; /* protect loc_imp */
-	atomic_t	     loc_refcount;
-	long		     loc_flags; /* flags, see above defines */
+	atomic_t		 loc_refcount;
+	long			 loc_flags; /* flags, see above defines */
 	/*
 	 * llog chunk size, and llog record size can not be bigger than
 	 * loc_chunk_size
 	 */
-	u32			loc_chunk_size;
+	u32			 loc_chunk_size;
 };
 
 #define LLOG_PROC_BREAK 0x0001
drivers/staging/lustre/lustre/include/lustre_mdc.h +1 -1
index c1fb324..90fcbae 100644
@@ -106,7 +106,7 @@ static inline void mdc_get_rpc_lock(struct mdc_rpc_lock *lck,
 	 * Only when all fake requests are finished can normal requests
 	 * be sent, to ensure they are recoverable again.
 	 */
- again:
+again:
 	mutex_lock(&lck->rpcl_mutex);
 
 	if (CFS_FAIL_CHECK_QUIET(OBD_FAIL_MDC_RPCS_SEM)) {
drivers/staging/lustre/lustre/include/lustre_mds.h +2 -2
index f665556..df178cc 100644
@@ -50,8 +50,8 @@
 #include <lustre_export.h>
 
 struct mds_group_info {
-	struct obd_uuid *uuid;
-	int group;
+	struct obd_uuid		*uuid;
+	int			group;
 };
 
 #define MDD_OBD_NAME     "mdd_obd"
drivers/staging/lustre/lustre/include/lustre_net.h +195 -193

754 lines not on this page · raw message

drivers/staging/lustre/lustre/include/lustre_nrs_fifo.h +2 -2
index 0db4345f..1c47c80 100644
@@ -63,8 +63,8 @@ struct nrs_fifo_head {
 };
 
 struct nrs_fifo_req {
-	struct list_head	fr_list;
-	u64			fr_sequence;
+	struct list_head		fr_list;
+	u64				fr_sequence;
 };
 
 /** @} fifo */
drivers/staging/lustre/lustre/include/lustre_req_layout.h +4 -4
index 2aba99f..57ac618 100644
@@ -63,10 +63,10 @@ enum req_location {
 #define REQ_MAX_FIELD_NR 10
 
 struct req_capsule {
-	struct ptlrpc_request   *rc_req;
-	const struct req_format *rc_fmt;
-	enum req_location	rc_loc;
-	u32		    rc_area[RCL_NR][REQ_MAX_FIELD_NR];
+	struct ptlrpc_request		*rc_req;
+	const struct req_format		*rc_fmt;
+	enum req_location		 rc_loc;
+	u32				 rc_area[RCL_NR][REQ_MAX_FIELD_NR];
 };
 
 void req_capsule_init(struct req_capsule *pill, struct ptlrpc_request *req,
drivers/staging/lustre/lustre/include/lustre_sec.h +150 -150

509 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#23 lore raw

PATCH 22/26 lustre: last batch to cleanup white spaces in internal headers

In reply to James Simmons

The internal headers are very messy and difficult to read. Remove excess white space and properly align data structures so they are easy on the eyes. This is the last batch since it covers many lines of changes.

---
 drivers/staging/lustre/lustre/include/obd.h        | 509 +++++++-------
 drivers/staging/lustre/lustre/include/obd_cksum.h  |   4 +-
 drivers/staging/lustre/lustre/include/obd_class.h  |  82 +--
 .../staging/lustre/lustre/include/obd_support.h    | 744 ++++++++++-----------
 drivers/staging/lustre/lustre/include/seq_range.h  |   2 +-
 5 files changed, 671 insertions(+), 670 deletions(-)
drivers/staging/lustre/lustre/include/obd.h +255 -254
index 0bb3cf8..171d2c2 100644
@@ -53,20 +53,20 @@
 #define MAX_OBD_DEVICES 8192
 
 struct osc_async_rc {
-	int     ar_rc;
-	int     ar_force_sync;
-	u64   ar_min_xid;
+	int			ar_rc;
+	int			ar_force_sync;
+	u64			ar_min_xid;
 };
 
-struct lov_oinfo {		 /* per-stripe data structure */
-	struct ost_id   loi_oi;    /* object ID/Sequence on the target OST */
-	int loi_ost_idx;	   /* OST stripe index in lov_tgt_desc->tgts */
-	int loi_ost_gen;	   /* generation of this loi_ost_idx */
+struct lov_oinfo {				/* per-stripe data structure */
+	struct ost_id		loi_oi;		/* object ID/Sequence on the target OST */
+	int			loi_ost_idx;	/* OST stripe index in lov_tgt_desc->tgts */
+	int			loi_ost_gen;	/* generation of this loi_ost_idx */
 
-	unsigned long loi_kms_valid:1;
-	u64 loi_kms;	     /* known minimum size */
-	struct ost_lvb loi_lvb;
-	struct osc_async_rc     loi_ar;
+	unsigned long		loi_kms_valid:1;
+	u64			loi_kms;	/* known minimum size */
+	struct ost_lvb		loi_lvb;
+	struct osc_async_rc	loi_ar;
 };
 
 static inline void loi_kms_set(struct lov_oinfo *oinfo, u64 kms)
@@ -85,7 +85,7 @@ static inline void loi_kms_set(struct lov_oinfo *oinfo, u64 kms)
 /* obd info for a particular level (lov, osc). */
 struct obd_info {
 	/* OBD_STATFS_* flags */
-	u64		   oi_flags;
+	u64			oi_flags;
 	/* lsm data specific for every OSC. */
 	struct lov_stripe_md   *oi_md;
 	/* statfs data specific for every OSC, if needed at all. */
@@ -99,31 +99,31 @@ struct obd_info {
 };
 
 struct obd_type {
-	struct list_head typ_chain;
-	struct obd_ops *typ_dt_ops;
-	struct md_ops *typ_md_ops;
-	struct dentry *typ_debugfs_entry;
-	char *typ_name;
-	int  typ_refcnt;
-	struct lu_device_type *typ_lu;
-	spinlock_t obd_type_lock;
+	struct list_head	 typ_chain;
+	struct obd_ops		*typ_dt_ops;
+	struct md_ops		*typ_md_ops;
+	struct dentry		*typ_debugfs_entry;
+	char			*typ_name;
+	int			 typ_refcnt;
+	struct lu_device_type	*typ_lu;
+	spinlock_t		 obd_type_lock;
 	struct kobject		*typ_kobj;
 };
 
 struct brw_page {
-	u64 off;
-	struct page *pg;
-	unsigned int count;
-	u32 flag;
+	u64			off;
+	struct page	       *pg;
+	unsigned int		count;
+	u32			flag;
 };
 
 struct timeout_item {
-	enum timeout_event ti_event;
-	unsigned long	 ti_timeout;
-	timeout_cb_t       ti_cb;
-	void	      *ti_cb_data;
-	struct list_head	 ti_obd_list;
-	struct list_head	 ti_chain;
+	enum timeout_event	ti_event;
+	unsigned long		ti_timeout;
+	timeout_cb_t		ti_cb;
+	void		       *ti_cb_data;
+	struct list_head	ti_obd_list;
+	struct list_head	ti_chain;
 };
 
 #define OBD_MAX_RIF_DEFAULT	8
@@ -135,9 +135,9 @@ struct timeout_item {
 
 /* possible values for fo_sync_lock_cancel */
 enum {
-	NEVER_SYNC_ON_CANCEL = 0,
-	BLOCKING_SYNC_ON_CANCEL = 1,
-	ALWAYS_SYNC_ON_CANCEL = 2,
+	NEVER_SYNC_ON_CANCEL	= 0,
+	BLOCKING_SYNC_ON_CANCEL	= 1,
+	ALWAYS_SYNC_ON_CANCEL	= 2,
 	NUM_SYNC_ON_CANCEL_STATES
 };
 
@@ -159,10 +159,10 @@ enum obd_cl_sem_lock_class {
 struct mdc_rpc_lock;
 struct obd_import;
 struct client_obd {
-	struct rw_semaphore  cl_sem;
-	struct obd_uuid	  cl_target_uuid;
-	struct obd_import       *cl_import; /* ptlrpc connection state */
-	size_t			 cl_conn_count;
+	struct rw_semaphore	cl_sem;
+	struct obd_uuid		cl_target_uuid;
+	struct obd_import      *cl_import; /* ptlrpc connection state */
+	size_t			cl_conn_count;
 	/*
 	 * Cache maximum and default values for easize. This is
 	 * strictly a performance optimization to minimize calls to
@@ -203,22 +203,22 @@ struct client_obd {
 	 * grant before trying to dirty a page and unreserve the rest.
 	 * See osc_{reserve|unreserve}_grant for details.
 	 */
-	long		 cl_reserved_grant;
-	wait_queue_head_t cl_cache_waiters; /* waiting for cache/grant */
-	unsigned long	 cl_next_shrink_grant;   /* jiffies */
-	struct list_head cl_grant_shrink_list;  /* Timeout event list */
-	int		 cl_grant_shrink_interval; /* seconds */
+	long			cl_reserved_grant;
+	wait_queue_head_t	cl_cache_waiters;	/* waiting for cache/grant */
+	unsigned long		cl_next_shrink_grant;   /* jiffies */
+	struct list_head	cl_grant_shrink_list;	/* Timeout event list */
+	int			cl_grant_shrink_interval; /* seconds */
 
 	/* A chunk is an optimal size used by osc_extent to determine
 	 * the extent size. A chunk is max(PAGE_SIZE, OST block size)
 	 */
-	int		  cl_chunkbits;
+	int			cl_chunkbits;
 	/* extent insertion metadata overhead to be accounted in grant,
 	 * in bytes
 	 */
-	unsigned int	 cl_grant_extent_tax;
+	unsigned int		cl_grant_extent_tax;
 	/* maximum extent size, in number of pages */
-	unsigned int	 cl_max_extent_pages;
+	unsigned int		cl_max_extent_pages;
 
 	/* keep track of objects that have lois that contain pages which
 	 * have been queued for async brw.  this lock also protects the
@@ -238,29 +238,29 @@ struct client_obd {
 	 * NB by Jinshan: though field names are still _loi_, but actually
 	 * osc_object{}s are in the list.
 	 */
-	spinlock_t		       cl_loi_list_lock;
-	struct list_head	       cl_loi_ready_list;
-	struct list_head	       cl_loi_hp_ready_list;
-	struct list_head	       cl_loi_write_list;
-	struct list_head	       cl_loi_read_list;
-	u32			 cl_r_in_flight;
-	u32			 cl_w_in_flight;
+	spinlock_t		cl_loi_list_lock;
+	struct list_head	cl_loi_ready_list;
+	struct list_head	cl_loi_hp_ready_list;
+	struct list_head	cl_loi_write_list;
+	struct list_head	cl_loi_read_list;
+	u32			cl_r_in_flight;
+	u32			cl_w_in_flight;
 	/* just a sum of the loi/lop pending numbers to be exported by sysfs */
-	atomic_t	     cl_pending_w_pages;
-	atomic_t	     cl_pending_r_pages;
-	u32			 cl_max_pages_per_rpc;
-	u32			 cl_max_rpcs_in_flight;
-	struct obd_histogram     cl_read_rpc_hist;
-	struct obd_histogram     cl_write_rpc_hist;
-	struct obd_histogram     cl_read_page_hist;
-	struct obd_histogram     cl_write_page_hist;
-	struct obd_histogram     cl_read_offset_hist;
-	struct obd_histogram     cl_write_offset_hist;
+	atomic_t		cl_pending_w_pages;
+	atomic_t		cl_pending_r_pages;
+	u32			cl_max_pages_per_rpc;
+	u32			cl_max_rpcs_in_flight;
+	struct obd_histogram    cl_read_rpc_hist;
+	struct obd_histogram    cl_write_rpc_hist;
+	struct obd_histogram    cl_read_page_hist;
+	struct obd_histogram    cl_write_page_hist;
+	struct obd_histogram    cl_read_offset_hist;
+	struct obd_histogram    cl_write_offset_hist;
 
 	/* LRU for osc caching pages */
 	struct cl_client_cache	*cl_cache;
 	/** member of cl_cache->ccc_lru */
-	struct list_head	 cl_lru_osc;
+	struct list_head	cl_lru_osc;
 	/** # of available LRU slots left in the per-OSC cache.
 	 * Available LRU slots are shared by all OSCs of the same file system,
 	 * therefore this is a pointer to cl_client_cache::ccc_lru_left.
@@ -270,73 +270,74 @@ struct client_obd {
 	 * queue, or in transfer. Busy pages can't be discarded so they are not
 	 * in LRU cache.
 	 */
-	atomic_long_t		 cl_lru_busy;
+	atomic_long_t		cl_lru_busy;
 	/** # of LRU pages in the cache for this client_obd */
-	atomic_long_t		 cl_lru_in_list;
+	atomic_long_t		cl_lru_in_list;
 	/** # of threads are shrinking LRU cache. To avoid contention, it's not
 	 * allowed to have multiple threads shrinking LRU cache.
 	 */
-	atomic_t		 cl_lru_shrinkers;
+	atomic_t		cl_lru_shrinkers;
 	/** The time when this LRU cache was last used. */
-	time64_t		 cl_lru_last_used;
+	time64_t		cl_lru_last_used;
 	/** stats: how many reclaims have happened for this client_obd.
 	 * reclaim and shrink - shrink is async, voluntarily rebalancing;
 	 * reclaim is sync, initiated by IO thread when the LRU slots are
 	 * in shortage.
 	 */
-	u64			 cl_lru_reclaim;
+	u64			cl_lru_reclaim;
 	/** List of LRU pages for this client_obd */
-	struct list_head	 cl_lru_list;
+	struct list_head	cl_lru_list;
 	/** Lock for LRU page list */
-	spinlock_t		 cl_lru_list_lock;
+	spinlock_t		cl_lru_list_lock;
 	/** # of unstable pages in this client_obd.
 	 * An unstable page is a page state that WRITE RPC has finished but
 	 * the transaction has NOT yet committed.
 	 */
-	atomic_long_t		 cl_unstable_count;
+	atomic_long_t		cl_unstable_count;
 	/** Link to osc_shrinker_list */
-	struct list_head	 cl_shrink_list;
+	struct list_head	cl_shrink_list;
 
 	/* number of in flight destroy rpcs is limited to max_rpcs_in_flight */
-	atomic_t	     cl_destroy_in_flight;
-	wait_queue_head_t	      cl_destroy_waitq;
+	atomic_t		cl_destroy_in_flight;
+	wait_queue_head_t	cl_destroy_waitq;
 
 	struct mdc_rpc_lock     *cl_rpc_lock;
 
 	/* modify rpcs in flight
 	 * currently used for metadata only
 	 */
-	spinlock_t		 cl_mod_rpcs_lock;
-	u16			 cl_max_mod_rpcs_in_flight;
-	u16			 cl_mod_rpcs_in_flight;
-	u16			 cl_close_rpcs_in_flight;
-	wait_queue_head_t	 cl_mod_rpcs_waitq;
-	unsigned long		*cl_mod_tag_bitmap;
-	struct obd_histogram	 cl_mod_rpcs_hist;
+	spinlock_t		cl_mod_rpcs_lock;
+	u16			cl_max_mod_rpcs_in_flight;
+	u16			cl_mod_rpcs_in_flight;
+	u16			cl_close_rpcs_in_flight;
+	wait_queue_head_t	cl_mod_rpcs_waitq;
+	unsigned long	       *cl_mod_tag_bitmap;
+	struct obd_histogram	cl_mod_rpcs_hist;
 
 	/* mgc datastruct */
-	atomic_t	     cl_mgc_refcount;
-	struct obd_export       *cl_mgc_mgsexp;
+	atomic_t		cl_mgc_refcount;
+	struct obd_export      *cl_mgc_mgsexp;
 
 	/* checksumming for data sent over the network */
-	unsigned int		 cl_checksum:1,	/* 0 = disabled, 1 = enabled */
-				 cl_checksum_dump:1; /* same */
+	unsigned int		cl_checksum:1,	/* 0 = disabled, 1 = enabled */
+				cl_checksum_dump:1; /* same */
 	/* supported checksum types that are worked out at connect time */
-	u32		    cl_supp_cksum_types;
+	u32			cl_supp_cksum_types;
 	/* checksum algorithm to be used */
-	enum cksum_type	     cl_cksum_type;
+	enum cksum_type		cl_cksum_type;
 
 	/* also protected by the poorly named _loi_list_lock lock above */
-	struct osc_async_rc      cl_ar;
+	struct osc_async_rc     cl_ar;
 
 	/* sequence manager */
 	struct lu_client_seq    *cl_seq;
-	struct rw_semaphore	 cl_seq_rwsem;
+	struct rw_semaphore	cl_seq_rwsem;
+
+	atomic_t		cl_resends; /* resend count */
 
-	atomic_t	     cl_resends; /* resend count */
 
 	/* ptlrpc work for writeback in ptlrpcd context */
-	void		    *cl_writeback_work;
+	void			*cl_writeback_work;
 	void			*cl_lru_work;
 	/* hash tables for osc_quota_info */
 	struct rhashtable	cl_quota_hash[MAXQUOTAS];
@@ -347,55 +348,55 @@ struct client_obd {
 #define obd2cli_tgt(obd) ((char *)(obd)->u.cli.cl_target_uuid.uuid)
 
 struct obd_id_info {
-	u32   idx;
+	u32	idx;
 	u64	*data;
 };
 
 struct echo_client_obd {
 	struct obd_export	*ec_exp;   /* the local connection to osc/lov */
 	spinlock_t		ec_lock;
-	struct list_head	   ec_objects;
-	struct list_head	   ec_locks;
-	u64		ec_unique;
+	struct list_head	ec_objects;
+	struct list_head	ec_locks;
+	u64			ec_unique;
 };
 
 /* Generic subset of OSTs */
 struct ost_pool {
-	u32	      *op_array;      /* array of index of lov_obd->lov_tgts */
-	unsigned int	op_count;      /* number of OSTs in the array */
-	unsigned int	op_size;       /* allocated size of lp_array */
-	struct rw_semaphore op_rw_sem;     /* to protect ost_pool use */
+	u32			*op_array;  /* array of index of lov_obd->lov_tgts */
+	unsigned int		 op_count;  /* number of OSTs in the array */
+	unsigned int		 op_size;   /* allocated size of lp_array */
+	struct rw_semaphore	 op_rw_sem; /* to protect ost_pool use */
 };
 
 /* allow statfs data caching for 1 second */
 #define OBD_STATFS_CACHE_SECONDS 1
 
 struct lov_tgt_desc {
-	struct list_head	  ltd_kill;
-	struct obd_uuid     ltd_uuid;
-	struct obd_device  *ltd_obd;
-	struct obd_export  *ltd_exp;
-	u32	       ltd_gen;
-	u32	       ltd_index;   /* index in lov_obd->tgts */
-	unsigned long       ltd_active:1,/* is this target up for requests */
-			    ltd_activate:1,/* should  target be activated */
-			    ltd_reap:1;  /* should this target be deleted */
+	struct list_head	ltd_kill;
+	struct obd_uuid		ltd_uuid;
+	struct obd_device      *ltd_obd;
+	struct obd_export      *ltd_exp;
+	u32			ltd_gen;
+	u32			ltd_index;   /* index in lov_obd->tgts */
+	unsigned long		ltd_active:1,/* is this target up for requests */
+				ltd_activate:1,/* should  target be activated */
+				ltd_reap:1;  /* should this target be deleted */
 };
 
 struct lov_obd {
-	struct lov_desc	 desc;
-	struct lov_tgt_desc   **lov_tgts;	      /* sparse array */
-	struct ost_pool	 lov_packed;	    /* all OSTs in a packed array */
+	struct lov_desc		desc;
+	struct lov_tgt_desc   **lov_tgts;	/* sparse array */
+	struct ost_pool		lov_packed;	/* all OSTs in a packed array */
 	struct mutex		lov_lock;
 	struct obd_connect_data lov_ocd;
-	atomic_t	    lov_refcount;
-	u32		   lov_death_row;/* tgts scheduled to be deleted */
-	u32		   lov_tgt_size;   /* size of tgts array */
-	int		     lov_connects;
-	int		     lov_pool_count;
+	atomic_t		lov_refcount;
+	u32			lov_death_row;/* tgts scheduled to be deleted */
+	u32			lov_tgt_size;   /* size of tgts array */
+	int			lov_connects;
+	int			lov_pool_count;
 	struct rhashtable	lov_pools_hash_body; /* used for key access */
 	struct list_head	lov_pool_list; /* used for sequential access */
-	struct dentry		*lov_pool_debugfs_entry;
+	struct dentry	       *lov_pool_debugfs_entry;
 	enum lustre_sec_part    lov_sp_me;
 
 	/* Cached LRU and unstable data from upper layer */
@@ -403,12 +404,12 @@ struct lov_obd {
 
 	struct rw_semaphore     lov_notify_lock;
 
-	struct kobject		*lov_tgts_kobj;
+	struct kobject	       *lov_tgts_kobj;
 };
 
 struct lmv_tgt_desc {
 	struct obd_uuid		ltd_uuid;
-	struct obd_export	*ltd_exp;
+	struct obd_export      *ltd_exp;
 	u32			ltd_idx;
 	struct mutex		ltd_fid_mutex;
 	unsigned long		ltd_active:1; /* target up for requests */
@@ -433,52 +434,52 @@ struct lmv_obd {
 };
 
 struct niobuf_local {
-	u64		lnb_file_offset;
-	u32		lnb_page_offset;
-	u32		lnb_len;
-	u32		lnb_flags;
-	int		lnb_rc;
-	struct page	*lnb_page;
-	void		*lnb_data;
+	u64			lnb_file_offset;
+	u32			lnb_page_offset;
+	u32			lnb_len;
+	u32			lnb_flags;
+	int			lnb_rc;
+	struct page		*lnb_page;
+	void			*lnb_data;
 };
 
-#define LUSTRE_FLD_NAME	 "fld"
-#define LUSTRE_SEQ_NAME	 "seq"
+#define LUSTRE_FLD_NAME		"fld"
+#define LUSTRE_SEQ_NAME		"seq"
 
-#define LUSTRE_MDD_NAME	 "mdd"
+#define LUSTRE_MDD_NAME		"mdd"
 #define LUSTRE_OSD_LDISKFS_NAME	"osd-ldiskfs"
 #define LUSTRE_OSD_ZFS_NAME     "osd-zfs"
-#define LUSTRE_VVP_NAME	 "vvp"
-#define LUSTRE_LMV_NAME	 "lmv"
-#define LUSTRE_SLP_NAME	 "slp"
+#define LUSTRE_VVP_NAME		"vvp"
+#define LUSTRE_LMV_NAME		"lmv"
+#define LUSTRE_SLP_NAME		"slp"
 #define LUSTRE_LOD_NAME		"lod"
 #define LUSTRE_OSP_NAME		"osp"
 #define LUSTRE_LWP_NAME		"lwp"
 
 /* obd device type names */
  /* FIXME all the references to LUSTRE_MDS_NAME should be swapped with LUSTRE_MDT_NAME */
-#define LUSTRE_MDS_NAME	 "mds"
-#define LUSTRE_MDT_NAME	 "mdt"
-#define LUSTRE_MDC_NAME	 "mdc"
-#define LUSTRE_OSS_NAME	 "ost"       /* FIXME change name to oss */
-#define LUSTRE_OST_NAME	 "obdfilter" /* FIXME change name to ost */
-#define LUSTRE_OSC_NAME	 "osc"
-#define LUSTRE_LOV_NAME	 "lov"
-#define LUSTRE_MGS_NAME	 "mgs"
-#define LUSTRE_MGC_NAME	 "mgc"
+#define LUSTRE_MDS_NAME		"mds"
+#define LUSTRE_MDT_NAME		"mdt"
+#define LUSTRE_MDC_NAME		"mdc"
+#define LUSTRE_OSS_NAME		"ost"       /* FIXME change name to oss */
+#define LUSTRE_OST_NAME		"obdfilter" /* FIXME change name to ost */
+#define LUSTRE_OSC_NAME		"osc"
+#define LUSTRE_LOV_NAME		"lov"
+#define LUSTRE_MGS_NAME		"mgs"
+#define LUSTRE_MGC_NAME		"mgc"
 
 #define LUSTRE_ECHO_NAME	"obdecho"
 #define LUSTRE_ECHO_CLIENT_NAME "echo_client"
-#define LUSTRE_QMT_NAME	 "qmt"
+#define LUSTRE_QMT_NAME		"qmt"
 
 /* Constant obd names (post-rename) */
-#define LUSTRE_MDS_OBDNAME "MDS"
-#define LUSTRE_OSS_OBDNAME "OSS"
-#define LUSTRE_MGS_OBDNAME "MGS"
-#define LUSTRE_MGC_OBDNAME "MGC"
+#define LUSTRE_MDS_OBDNAME	"MDS"
+#define LUSTRE_OSS_OBDNAME	"OSS"
+#define LUSTRE_MGS_OBDNAME	"MGS"
+#define LUSTRE_MGC_OBDNAME	"MGC"
 
 /* Don't conflict with on-wire flags OBD_BRW_WRITE, etc */
-#define N_LOCAL_TEMP_PAGE 0x10000000
+#define N_LOCAL_TEMP_PAGE	0x10000000
 
 /*
  * Events signalled through obd_notify() upcall-chain.
@@ -516,21 +517,21 @@ struct target_recovery_data {
 };
 
 struct obd_llog_group {
-	struct llog_ctxt  *olg_ctxts[LLOG_MAX_CTXTS];
+	struct llog_ctxt       *olg_ctxts[LLOG_MAX_CTXTS];
 	wait_queue_head_t	olg_waitq;
-	spinlock_t	   olg_lock;
-	struct mutex	   olg_cat_processing;
+	spinlock_t		olg_lock;
+	struct mutex		olg_cat_processing;
 };
 
 /* corresponds to one of the obd's */
 #define OBD_DEVICE_MAGIC	0XAB5CD6EF
 
 struct lvfs_run_ctxt {
-	struct dt_device *dt;
+	struct dt_device       *dt;
 };
 
 struct obd_device {
-	struct obd_type	*obd_type;
+	struct obd_type		*obd_type;
 	u32			 obd_magic; /* OBD_DEVICE_MAGIC */
 	int			 obd_minor; /* device number: lctl dl */
 	struct lu_device	*obd_lu_dev;
@@ -562,35 +563,35 @@ struct obd_device {
 	 */
 	unsigned long obd_recovery_expired:1;
 	/* uuid-export hash body */
-	struct rhashtable	obd_uuid_hash;
-	wait_queue_head_t	     obd_refcount_waitq;
-	struct list_head	      obd_exports;
-	struct list_head	      obd_unlinked_exports;
-	struct list_head	      obd_delayed_exports;
-	atomic_t			obd_refcount;
-	int		     obd_num_exports;
-	spinlock_t		obd_nid_lock;
-	struct ldlm_namespace  *obd_namespace;
-	struct ptlrpc_client	obd_ldlm_client; /* XXX OST/MDS only */
+	struct rhashtable	 obd_uuid_hash;
+	wait_queue_head_t	 obd_refcount_waitq;
+	struct list_head	 obd_exports;
+	struct list_head	 obd_unlinked_exports;
+	struct list_head	 obd_delayed_exports;
+	atomic_t		 obd_refcount;
+	int			 obd_num_exports;
+	spinlock_t		 obd_nid_lock;
+	struct ldlm_namespace	*obd_namespace;
+	struct ptlrpc_client	 obd_ldlm_client; /* XXX OST/MDS only */
 	/* a spinlock is OK for what we do now, may need a semaphore later */
-	spinlock_t		obd_dev_lock; /* protect OBD bitfield above */
-	spinlock_t		obd_osfs_lock;
-	struct obd_statfs	obd_osfs;       /* locked by obd_osfs_lock */
-	u64			obd_osfs_age;
-	u64			obd_last_committed;
-	struct mutex		obd_dev_mutex;
-	struct lvfs_run_ctxt	obd_lvfs_ctxt;
-	struct obd_llog_group	obd_olg;	/* default llog group */
+	spinlock_t		 obd_dev_lock; /* protect OBD bitfield above */
+	spinlock_t		 obd_osfs_lock;
+	struct obd_statfs	 obd_osfs;       /* locked by obd_osfs_lock */
+	u64			 obd_osfs_age;
+	u64			 obd_last_committed;
+	struct mutex		 obd_dev_mutex;
+	struct lvfs_run_ctxt	 obd_lvfs_ctxt;
+	struct obd_llog_group	 obd_olg;	/* default llog group */
 	struct obd_device	*obd_observer;
-	struct rw_semaphore	obd_observer_link_sem;
+	struct rw_semaphore	 obd_observer_link_sem;
 	struct obd_notify_upcall obd_upcall;
-	struct obd_export       *obd_self_export;
+	struct obd_export	*obd_self_export;
 
 	union {
-		struct client_obd cli;
-		struct echo_client_obd echo_client;
-		struct lov_obd lov;
-		struct lmv_obd lmv;
+		struct client_obd	cli;
+		struct echo_client_obd	echo_client;
+		struct lov_obd		lov;
+		struct lmv_obd		lmv;
 	} u;
 
 	/* Fields used by LProcFS */
@@ -600,12 +601,12 @@ struct obd_device {
 
 	struct dentry		*obd_debugfs_entry;
 	struct dentry		*obd_svc_debugfs_entry;
-	struct lprocfs_stats  *obd_svc_stats;
-	const struct attribute	       **obd_attrs;
-	struct lprocfs_vars		*obd_vars;
-	atomic_t	   obd_evict_inprogress;
-	wait_queue_head_t	    obd_evict_inprogress_waitq;
-	struct list_head	obd_evict_list; /* protected with pet_lock */
+	struct lprocfs_stats	*obd_svc_stats;
+	const struct attribute **obd_attrs;
+	struct lprocfs_vars	*obd_vars;
+	atomic_t		 obd_evict_inprogress;
+	wait_queue_head_t	 obd_evict_inprogress_waitq;
+	struct list_head	 obd_evict_list; /* protected with pet_lock */
 
 	/**
 	 * Ldlm pool part. Save last calculated SLV and Limit.
@@ -620,39 +621,39 @@ struct obd_device {
 	 * A list of outstanding class_incref()'s against this obd. For
 	 * debugging.
 	 */
-	struct lu_ref	  obd_reference;
+	struct lu_ref		 obd_reference;
 
-	struct kset			obd_kset; /* sysfs object collection */
-	struct kobj_type		obd_ktype;
-	struct completion		obd_kobj_unregister;
+	struct kset		 obd_kset; /* sysfs object collection */
+	struct kobj_type	 obd_ktype;
+	struct completion	 obd_kobj_unregister;
 };
 
 int obd_uuid_add(struct obd_device *obd, struct obd_export *export);
 void obd_uuid_del(struct obd_device *obd, struct obd_export *export);
 
 /* get/set_info keys */
-#define KEY_ASYNC	       "async"
-#define KEY_CHANGELOG_CLEAR     "changelog_clear"
-#define KEY_FID2PATH	    "fid2path"
-#define KEY_CHECKSUM	    "checksum"
-#define KEY_CLEAR_FS	    "clear_fs"
-#define KEY_CONN_DATA	   "conn_data"
+#define KEY_ASYNC		"async"
+#define KEY_CHANGELOG_CLEAR	"changelog_clear"
+#define KEY_FID2PATH		"fid2path"
+#define KEY_CHECKSUM		"checksum"
+#define KEY_CLEAR_FS		"clear_fs"
+#define KEY_CONN_DATA		"conn_data"
 #define KEY_EVICT_BY_NID	"evict_by_nid"
-#define KEY_FIEMAP	      "fiemap"
-#define KEY_FLUSH_CTX	   "flush_ctx"
+#define KEY_FIEMAP		"fiemap"
+#define KEY_FLUSH_CTX		"flush_ctx"
 #define KEY_GRANT_SHRINK	"grant_shrink"
 #define KEY_HSM_COPYTOOL_SEND   "hsm_send"
 #define KEY_INIT_RECOV_BACKUP   "init_recov_bk"
-#define KEY_INTERMDS	    "inter_mds"
-#define KEY_LAST_ID	     "last_id"
+#define KEY_INTERMDS		"inter_mds"
+#define KEY_LAST_ID		"last_id"
 #define KEY_LAST_FID		"last_fid"
 #define KEY_MAX_EASIZE		"max_easize"
 #define KEY_DEFAULT_EASIZE	"default_easize"
-#define KEY_MGSSEC	      "mgssec"
-#define KEY_READ_ONLY	   "read-only"
-#define KEY_REGISTER_TARGET     "register_target"
-#define KEY_SET_FS	      "set_fs"
-#define KEY_TGT_COUNT	   "tgt_count"
+#define KEY_MGSSEC		"mgssec"
+#define KEY_READ_ONLY		"read-only"
+#define KEY_REGISTER_TARGET	"register_target"
+#define KEY_SET_FS		"set_fs"
+#define KEY_TGT_COUNT		"tgt_count"
 /*      KEY_SET_INFO in lustre_idl.h */
 #define KEY_SPTLRPC_CONF	"sptlrpc_conf"
 
@@ -698,11 +699,11 @@ enum md_op_flags {
 };
 
 enum md_cli_flags {
-	CLI_SET_MEA	= BIT(0),
-	CLI_RM_ENTRY	= BIT(1),
-	CLI_HASH64	= BIT(2),
-	CLI_API32	= BIT(3),
-	CLI_MIGRATE	= BIT(4),
+	CLI_SET_MEA		= BIT(0),
+	CLI_RM_ENTRY		= BIT(1),
+	CLI_HASH64		= BIT(2),
+	CLI_API32		= BIT(3),
+	CLI_MIGRATE		= BIT(4),
 };
 
 /**
@@ -716,39 +717,39 @@ static inline bool it_has_reply_body(const struct lookup_intent *it)
 }
 
 struct md_op_data {
-	struct lu_fid	   op_fid1; /* operation fid1 (usually parent) */
-	struct lu_fid	   op_fid2; /* operation fid2 (usually child) */
-	struct lu_fid	   op_fid3; /* 2 extra fids to find conflicting */
-	struct lu_fid	   op_fid4; /* to the operation locks. */
+	struct lu_fid		op_fid1; /* operation fid1 (usually parent) */
+	struct lu_fid		op_fid2; /* operation fid2 (usually child) */
+	struct lu_fid		op_fid3; /* 2 extra fids to find conflicting */
+	struct lu_fid		op_fid4; /* to the operation locks. */
 	u32			op_mds;  /* what mds server open will go to */
 	u32			op_mode;
-	struct lustre_handle    op_handle;
+	struct lustre_handle	op_handle;
 	s64			op_mod_time;
-	const char	     *op_name;
+	const char	       *op_name;
 	size_t			op_namelen;
 	struct lmv_stripe_md   *op_mea1;
 	struct lmv_stripe_md   *op_mea2;
-	u32		   op_suppgids[2];
-	u32		   op_fsuid;
-	u32		   op_fsgid;
-	kernel_cap_t	       op_cap;
-	void		   *op_data;
+	u32			op_suppgids[2];
+	u32			op_fsuid;
+	u32			op_fsgid;
+	kernel_cap_t		op_cap;
+	void		       *op_data;
 	size_t			op_data_size;
 
 	/* iattr fields and blocks. */
-	struct iattr	    op_attr;
+	struct iattr		op_attr;
 	enum op_xvalid		op_xvalid;	/* eXtra validity flags */
-	unsigned int	    op_attr_flags;
-	u64		   op_valid;
-	loff_t		  op_attr_blocks;
+	unsigned int		op_attr_flags;
+	u64			op_valid;
+	loff_t			op_attr_blocks;
 
-	u32		   op_flags;
+	u32			op_flags;
 
 	/* Various operation flags. */
 	enum mds_op_bias        op_bias;
 
 	/* Used by readdir */
-	u64		   op_offset;
+	u64			op_offset;
 
 	/* used to transfer info between the stacks of MD client
 	 * see enum op_cli_flags
@@ -780,14 +781,14 @@ struct md_callback {
 /* metadata stat-ahead */
 
 struct md_enqueue_info {
-	struct md_op_data       mi_data;
-	struct lookup_intent    mi_it;
-	struct lustre_handle    mi_lockh;
-	struct inode	   *mi_dir;
+	struct md_op_data		mi_data;
+	struct lookup_intent		mi_it;
+	struct lustre_handle		mi_lockh;
+	struct inode		       *mi_dir;
 	struct ldlm_enqueue_info	mi_einfo;
 	int (*mi_cb)(struct ptlrpc_request *req,
 		     struct md_enqueue_info *minfo, int rc);
-	void			*mi_cbdata;
+	void			       *mi_cbdata;
 };
 
 struct obd_ops {
@@ -886,33 +887,33 @@ struct obd_ops {
 
 /* lmv structures */
 struct lustre_md {
-	struct mdt_body	 *body;
-	struct lu_buf		 layout;
-	struct lmv_stripe_md    *lmv;
+	struct mdt_body			*body;
+	struct lu_buf			 layout;
+	struct lmv_stripe_md		*lmv;
 #ifdef CONFIG_FS_POSIX_ACL
-	struct posix_acl	*posix_acl;
+	struct posix_acl		*posix_acl;
 #endif
-	struct mdt_remote_perm  *remote_perm;
+	struct mdt_remote_perm		*remote_perm;
 };
 
 struct md_open_data {
-	struct obd_client_handle *mod_och;
-	struct ptlrpc_request    *mod_open_req;
-	struct ptlrpc_request    *mod_close_req;
-	atomic_t		  mod_refcount;
-	bool			  mod_is_create;
+	struct obd_client_handle	*mod_och;
+	struct ptlrpc_request		*mod_open_req;
+	struct ptlrpc_request		*mod_close_req;
+	atomic_t			 mod_refcount;
+	bool				 mod_is_create;
 };
 
 struct obd_client_handle {
-	struct lustre_handle	 och_fh;
-	struct lu_fid		 och_fid;
-	struct md_open_data	*och_mod;
-	struct lustre_handle	 och_lease_handle; /* open lock for lease */
-	u32			 och_magic;
-	fmode_t			 och_flags;
+	struct lustre_handle		och_fh;
+	struct lu_fid			och_fid;
+	struct md_open_data	       *och_mod;
+	struct lustre_handle		och_lease_handle; /* open lock for lease */
+	u32				och_magic;
+	fmode_t				och_flags;
 };
 
-#define OBD_CLIENT_HANDLE_MAGIC 0xd15ea5ed
+#define OBD_CLIENT_HANDLE_MAGIC	0xd15ea5ed
 
 struct lookup_intent;
 struct cl_attr;
@@ -1015,13 +1016,13 @@ static inline struct md_open_data *obd_mod_alloc(void)
 }
 
 #define obd_mod_get(mod) atomic_inc(&(mod)->mod_refcount)
-#define obd_mod_put(mod)					\
-({							      \
-	if (atomic_dec_and_test(&(mod)->mod_refcount)) {	  \
-		if ((mod)->mod_open_req)			  \
-			ptlrpc_req_finished((mod)->mod_open_req);   \
-		kfree(mod);			      \
-	}						       \
+#define obd_mod_put(mod)						\
+({									\
+	if (atomic_dec_and_test(&(mod)->mod_refcount)) {		\
+		if ((mod)->mod_open_req)				\
+			ptlrpc_req_finished((mod)->mod_open_req);	\
+		kfree(mod);						\
+	}								\
 })
 
 void obdo_from_inode(struct obdo *dst, struct inode *src, u32 valid);
@@ -1050,8 +1051,8 @@ static inline const char *lu_dev_name(const struct lu_device *lu_dev)
 static inline bool filename_is_volatile(const char *name, size_t namelen,
 					int *idx)
 {
-	const char	*start;
-	char		*end;
+	const char *start;
+	char *end;
 
 	if (strncmp(name, LUSTRE_VOLATILE_HDR, LUSTRE_VOLATILE_HDR_LEN) != 0)
 		return false;
drivers/staging/lustre/lustre/include/obd_cksum.h +2 -2
index e5f7bb2..26a9555 100644
@@ -65,8 +65,8 @@ static inline unsigned char cksum_obd2cfs(enum cksum_type cksum_type)
  */
 static inline u32 cksum_type_pack(enum cksum_type cksum_type)
 {
-	unsigned int    performance = 0, tmp;
-	u32		flag = OBD_FL_CKSUM_ADLER;
+	unsigned int performance = 0, tmp;
+	u32 flag = OBD_FL_CKSUM_ADLER;
 
 	if (cksum_type & OBD_CKSUM_CRC32) {
 		tmp = cfs_crypto_hash_speed(cksum_obd2cfs(OBD_CKSUM_CRC32));
drivers/staging/lustre/lustre/include/obd_class.h +41 -41

112 lines not on this page · raw message

drivers/staging/lustre/lustre/include/obd_support.h +372 -372

823 lines not on this page · raw message

drivers/staging/lustre/lustre/include/seq_range.h +1 -1
index 9450da72..884d4d4 100644
@@ -176,7 +176,7 @@ static inline int lu_seq_range_compare_loc(const struct lu_seq_range *r1,
 					   const struct lu_seq_range *r2)
 {
 	return r1->lsr_index != r2->lsr_index ||
-		r1->lsr_flags != r2->lsr_flags;
+	       r1->lsr_flags != r2->lsr_flags;
 }
 
 #if !defined(__REQ_LAYOUT_USER__)
Signature · 1 line
1.8.3.1