Skip to contentSkip to conversation

Removal of unused Lustre code

PATCH New [email protected] 1 participant 30 messages Sep 29, 2015 Staging

lore
Share & tools
lore
#0 lore raw

cover Removal of unused Lustre code

From: Oleg Drokin <[email protected]>

This set removes a bunch of lustre code that is no lonver relevant, is server specific or is otherwise unused.

Please consider.

More to come later.

Arnd Bergmann (1):
staging/lustre: remove lots of dead code

Oleg Drokin (28):
staging/lustre: Remove unused target_print_req() staging/lustre: Remove unused lustre_acl_xattr_merge2posix() staging/lustre/ptlrpc: Remove server-specific health checks staging/lustre: Remove unused req_capsule_server_grow staging/lustre: Remove unused reply state batches code staging/lustre: Remove high-priority request callbacks staging/lustre: Remove unused statfs_pack() staging/lustre: Remove unused ptlrpcd_add_rqset() staging/lustre: Remove unused functions and definitions from cl_object staging/lustre: Remove unused lu_object functions. staging/lustre/ldlm: Remove unused round_timeout function staging/lustre/obdclass: Remove unused functions from genops.c staging/lustre: Remove unused function class_handle_hash_back() staging/lustre: Remove unused function server_name2svname() staging/lustre/obdclass: Drop unused code from obdo.c staging/lustre/ptlrpc: Drop unused client code staging/lustre/ptlrpc: secure wrapping code cleanup staging/lustre: Drop unused obdo_from_la() and la_from_obdo() staging/lustre/fid: Remove server fid function declarations staging/lustre/fid: seq_client_init/fini don't need to be exported staging/lustre/fid: Remove unused seq_client_get_seq function staging/lustre/fid: Get rid of lcs_srv in lu_client_seq staging/lustre/fid: Remove unused struct lu_server_seq staging/lustre/obdclass: Remove unused nid_hash staging/lustre: Remove server-only recovery-related bits staging/lustre: Remove ccc_attr/conf_set()
staging/lustre: Remove unused ccc_io_fini() staging/lustre: Remove ccc_transient_page_* methods

 drivers/staging/lustre/lustre/fid/fid_request.c    | 132 ++------
 drivers/staging/lustre/lustre/fid/lproc_fid.c      |   2 -
 drivers/staging/lustre/lustre/include/cl_object.h  |  26 --
 drivers/staging/lustre/lustre/include/lclient.h    |  24 --
 .../staging/lustre/lustre/include/lprocfs_status.h |   4 -
 drivers/staging/lustre/lustre/include/lu_object.h  |  27 --
 .../lustre/lustre/include/lustre/lustre_idl.h      |   8 -
 .../lustre/lustre/include/lustre/lustre_user.h     |   2 -
 .../staging/lustre/lustre/include/lustre_debug.h   |   1 -
 .../staging/lustre/lustre/include/lustre_disk.h    |   2 -
 .../staging/lustre/lustre/include/lustre_eacl.h    |   4 -
 .../staging/lustre/lustre/include/lustre_export.h  |  19 +-
 drivers/staging/lustre/lustre/include/lustre_fid.h |  91 ------
 .../staging/lustre/lustre/include/lustre_handles.h |   1 -
 .../staging/lustre/lustre/include/lustre_import.h  |   1 -
 drivers/staging/lustre/lustre/include/lustre_lib.h |   1 -
 drivers/staging/lustre/lustre/include/lustre_net.h |  42 +--
 .../staging/lustre/lustre/include/lustre_param.h   |   6 -
 .../lustre/lustre/include/lustre_req_layout.h      |   7 -
 drivers/staging/lustre/lustre/include/lustre_sec.h |  20 --
 drivers/staging/lustre/lustre/include/obd.h        |  29 --
 drivers/staging/lustre/lustre/include/obd_class.h  |  28 --
 drivers/staging/lustre/lustre/lclient/lcommon_cl.c |  70 ----
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c    |   5 -
 drivers/staging/lustre/lustre/obdclass/acl.c       | 119 -------
 drivers/staging/lustre/lustre/obdclass/cl_io.c     |  65 ----
 drivers/staging/lustre/lustre/obdclass/cl_lock.c   |  26 --
 drivers/staging/lustre/lustre/obdclass/cl_object.c |  41 ---
 drivers/staging/lustre/lustre/obdclass/debug.c     |  10 -
 drivers/staging/lustre/lustre/obdclass/genops.c    | 249 +-------------
 .../lustre/lustre/obdclass/linux/linux-obdo.c      | 137 --------
 .../lustre/lustre/obdclass/linux/linux-sysctl.c    |   4 -
 drivers/staging/lustre/lustre/obdclass/lu_object.c | 241 --------------
 .../lustre/lustre/obdclass/lustre_handles.c        |  13 -
 .../staging/lustre/lustre/obdclass/obd_config.c    | 358 ---------------------
 drivers/staging/lustre/lustre/obdclass/obd_mount.c |  27 --
 drivers/staging/lustre/lustre/obdclass/obdo.c      | 170 ----------
 .../staging/lustre/lustre/obdclass/statfs_pack.c   |  14 -
 drivers/staging/lustre/lustre/ptlrpc/client.c      |  95 ------
 drivers/staging/lustre/lustre/ptlrpc/import.c      |  11 -
 drivers/staging/lustre/lustre/ptlrpc/layout.c      | 126 --------
 .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c    |  30 --
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c      |   3 +-
 drivers/staging/lustre/lustre/ptlrpc/nrs.c         | 123 -------
 .../staging/lustre/lustre/ptlrpc/pack_generic.c    | 197 ------------
 drivers/staging/lustre/lustre/ptlrpc/pinger.c      |  18 --
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |   8 -
 drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c     |  42 ---
 drivers/staging/lustre/lustre/ptlrpc/sec.c         | 116 -------
 drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c    | 329 -------------------
 drivers/staging/lustre/lustre/ptlrpc/sec_config.c  |  48 ---
 drivers/staging/lustre/lustre/ptlrpc/sec_gc.c      |  15 -
 drivers/staging/lustre/lustre/ptlrpc/service.c     | 320 ++----------------
 53 files changed, 62 insertions(+), 3445 deletions(-)
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/29 staging/lustre: Remove unused target_print_req()

From: Oleg Drokin <[email protected]>

This is a server-side request printing function, so we don't really need it on the client.

---
 .../staging/lustre/lustre/include/lprocfs_status.h |  4 ---
 .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c    | 30 ----------------------
 2 files changed, 34 deletions(-)
drivers/staging/lustre/lustre/include/lprocfs_status.h +0 -4
index 5262b4f..22f3777 100644
@@ -720,10 +720,6 @@ ssize_t lustre_attr_store(struct kobject *kobj, struct attribute *attr,
 
 extern const struct sysfs_ops lustre_sysfs_ops;
 
-/* lproc_ptlrpc.c */
-struct ptlrpc_request;
-void target_print_req(void *seq_file, struct ptlrpc_request *req);
-
 /* all quota proc functions */
 int lprocfs_quota_rd_bunit(char *page, char **start,
 			   loff_t off, int count,
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +0 -30
index d66a7b8..3a212b4 100644
@@ -890,36 +890,6 @@ ptlrpc_lprocfs_svc_req_history_next(struct seq_file *s,
 	return NULL;
 }
 
-/* common ost/mdt so_req_printer */
-void target_print_req(void *seq_file, struct ptlrpc_request *req)
-{
-	/* Called holding srv_lock with irqs disabled.
-	 * Print specific req contents and a newline.
-	 * CAVEAT EMPTOR: check request message length before printing!!!
-	 * You might have received any old crap so you must be just as
-	 * careful here as the service's request parser!!! */
-	struct seq_file *sf = seq_file;
-
-	switch (req->rq_phase) {
-	case RQ_PHASE_NEW:
-		/* still awaiting a service thread's attention, or rejected
-		 * because the generic request message didn't unpack */
-		seq_printf(sf, "<not swabbed>\n");
-		break;
-	case RQ_PHASE_INTERPRET:
-		/* being handled, so basic msg swabbed, and opc is valid
-		 * but racing with mds_handle() */
-	case RQ_PHASE_COMPLETE:
-		/* been handled by mds_handle() reply state possibly still
-		 * volatile */
-		seq_printf(sf, "opc %d\n", lustre_msg_get_opc(req->rq_reqmsg));
-		break;
-	default:
-		DEBUG_REQ(D_ERROR, req, "bad phase %d", req->rq_phase);
-	}
-}
-EXPORT_SYMBOL(target_print_req);
-
 static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter)
 {
 	struct ptlrpc_service *svc = s->private;
Signature · 1 line
2.1.0
#2 lore raw

PATCH 2/29 staging/lustre: Remove unused lustre_acl_xattr_merge2posix()

In reply to [email protected]

From: Oleg Drokin <[email protected]>

Apparently this is only used only on the metadata server.

---
 .../staging/lustre/lustre/include/lustre_eacl.h    |   4 -
 drivers/staging/lustre/lustre/obdclass/acl.c       | 119 ---------------------
 2 files changed, 123 deletions(-)
drivers/staging/lustre/lustre/include/lustre_eacl.h +0 -4
index 0f8f76c..499f9c8 100644
@@ -80,10 +80,6 @@ extern void
 lustre_posix_acl_xattr_free(posix_acl_xattr_header *header, int size);
 extern void
 lustre_ext_acl_xattr_free(ext_acl_xattr_header *header);
-extern int
-lustre_acl_xattr_merge2posix(posix_acl_xattr_header *posix_header, int size,
-			     ext_acl_xattr_header *ext_header,
-			     posix_acl_xattr_header **out);
 extern ext_acl_xattr_header *
 lustre_acl_xattr_merge2ext(posix_acl_xattr_header *posix_header, int size,
 			   ext_acl_xattr_header *ext_header);
drivers/staging/lustre/lustre/obdclass/acl.c +0 -119

125 lines not on this page · raw message

Signature · 1 line
2.1.0
#3 lore raw

PATCH 3/29 staging/lustre/ptlrpc: Remove server-specific health checks

In reply to [email protected]

From: Oleg Drokin <[email protected]>

ptlrpc_service_health_check is only used on a service, so it makes no point to retain it in the client code. Also removing it's helpers: ptlrpc_svcpt_health_check and ptlrpc_nrs_req_peek_nolock

---
 drivers/staging/lustre/lustre/include/lustre_net.h |  1 -
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |  6 ---
 drivers/staging/lustre/lustre/ptlrpc/service.c     | 58 ----------------------
 3 files changed, 65 deletions(-)
drivers/staging/lustre/lustre/include/lustre_net.h +0 -1
index e929c93..a928631 100644
@@ -2541,7 +2541,6 @@ int ptlrpc_start_threads(struct ptlrpc_service *svc);
 int ptlrpc_unregister_service(struct ptlrpc_service *service);
 int liblustre_check_services(void *arg);
 void ptlrpc_daemonize(char *name);
-int ptlrpc_service_health_check(struct ptlrpc_service *);
 void ptlrpc_server_drop_request(struct ptlrpc_request *req);
 void ptlrpc_request_change_export(struct ptlrpc_request *req,
 				  struct obd_export *export);
drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +0 -6
index 059ad96b..a3608a9 100644
@@ -137,12 +137,6 @@ ptlrpc_nrs_req_get_nolock(struct ptlrpc_service_part *svcpt, bool hp,
 	return ptlrpc_nrs_req_get_nolock0(svcpt, hp, false, force);
 }
 
-static inline struct ptlrpc_request *
-ptlrpc_nrs_req_peek_nolock(struct ptlrpc_service_part *svcpt, bool hp)
-{
-	return ptlrpc_nrs_req_get_nolock0(svcpt, hp, true, false);
-}
-
 void ptlrpc_nrs_req_del_nolock(struct ptlrpc_request *req);
 bool ptlrpc_nrs_req_pending_nolock(struct ptlrpc_service_part *svcpt, bool hp);
 
drivers/staging/lustre/lustre/ptlrpc/service.c +0 -58

61 lines not on this page · raw message

Signature · 1 line
2.1.0
#4 lore raw

PATCH 4/29 staging/lustre: Remove unused req_capsule_server_grow

In reply to [email protected]

From: Oleg Drokin <[email protected]>

It's only used on the server

---
 .../lustre/lustre/include/lustre_req_layout.h      |  3 --
 drivers/staging/lustre/lustre/ptlrpc/layout.c      | 62 ----------------------
 2 files changed, 65 deletions(-)
drivers/staging/lustre/lustre/include/lustre_req_layout.h +0 -3
index c6457b2..04c0076 100644
@@ -129,9 +129,6 @@ void req_capsule_shrink(struct req_capsule *pill,
 			const struct req_msg_field *field,
 			unsigned int newlen,
 			enum req_location loc);
-int req_capsule_server_grow(struct req_capsule *pill,
-			    const struct req_msg_field *field,
-			    unsigned int newlen);
 int  req_layout_init(void);
 void req_layout_fini(void);
 
drivers/staging/lustre/lustre/ptlrpc/layout.c +0 -62

67 lines not on this page · raw message

Signature · 1 line
2.1.0
#5 lore raw

PATCH 5/29 staging/lustre: Remove unused reply state batches code

In reply to [email protected]

From: Oleg Drokin <[email protected]>

rs_batch is used on the server only.

---
 drivers/staging/lustre/lustre/include/lustre_net.h |   6 +-
 drivers/staging/lustre/lustre/ptlrpc/service.c     | 145 ---------------------
 2 files changed, 1 insertion(+), 150 deletions(-)
drivers/staging/lustre/lustre/include/lustre_net.h +1 -5
index a928631..e7faf0e 100644
@@ -429,8 +429,7 @@ struct ptlrpc_reply_state {
 	unsigned long	  rs_on_net:1;   /* reply_out_callback pending? */
 	unsigned long	  rs_prealloc:1; /* rs from prealloc list */
 	unsigned long	  rs_committed:1;/* the transaction was committed
-						 and the rs was dispatched
-						 by ptlrpc_commit_replies */
+					  * and the rs was dispatched */
 	/** Size of the state */
 	int		    rs_size;
 	/** opcode */
@@ -2525,9 +2524,6 @@ struct ptlrpc_service_conf {
  *
  * @{
  */
-void ptlrpc_save_lock(struct ptlrpc_request *req,
-		      struct lustre_handle *lock, int mode, int no_ack);
-void ptlrpc_commit_replies(struct obd_export *exp);
 void ptlrpc_dispatch_difficult_reply(struct ptlrpc_reply_state *rs);
 void ptlrpc_schedule_difficult_reply(struct ptlrpc_reply_state *rs);
 int ptlrpc_hpreq_handler(struct ptlrpc_request *req);
drivers/staging/lustre/lustre/ptlrpc/service.c +0 -145

173 lines not on this page · raw message

Signature · 1 line
2.1.0
#6 lore raw

PATCH 6/29 staging/lustre: Remove high-priority request callbacks

In reply to [email protected]

From: Oleg Drokin <[email protected]>

This function is only used on the server where real high-priority requests actually exist.
This deletes ptlrpc_hpreq_handler() and ptlrpc_request_change_export()

---
 drivers/staging/lustre/lustre/include/lustre_net.h |  3 --
 drivers/staging/lustre/lustre/ptlrpc/service.c     | 53 ----------------------
 2 files changed, 56 deletions(-)
drivers/staging/lustre/lustre/include/lustre_net.h +0 -3
index e7faf0e..090484b 100644
@@ -2526,7 +2526,6 @@ struct ptlrpc_service_conf {
  */
 void ptlrpc_dispatch_difficult_reply(struct ptlrpc_reply_state *rs);
 void ptlrpc_schedule_difficult_reply(struct ptlrpc_reply_state *rs);
-int ptlrpc_hpreq_handler(struct ptlrpc_request *req);
 struct ptlrpc_service *ptlrpc_register_service(
 				struct ptlrpc_service_conf *conf,
 				struct kset *parent,
@@ -2538,8 +2537,6 @@ int ptlrpc_unregister_service(struct ptlrpc_service *service);
 int liblustre_check_services(void *arg);
 void ptlrpc_daemonize(char *name);
 void ptlrpc_server_drop_request(struct ptlrpc_request *req);
-void ptlrpc_request_change_export(struct ptlrpc_request *req,
-				  struct obd_export *export);
 
 int ptlrpc_hr_init(void);
 void ptlrpc_hr_fini(void);
drivers/staging/lustre/lustre/ptlrpc/service.c +0 -53

65 lines not on this page · raw message

Signature · 1 line
2.1.0
#7 lore raw

PATCH 7/29 staging/lustre: Remove unused statfs_pack()

In reply to [email protected]

From: Oleg Drokin <[email protected]>

It's only used on the server.

---
 drivers/staging/lustre/lustre/include/lustre_lib.h   |  1 -
 drivers/staging/lustre/lustre/obdclass/statfs_pack.c | 14 --------------
 2 files changed, 15 deletions(-)
drivers/staging/lustre/lustre/include/lustre_lib.h +0 -1
index b380359..35175fd 100644
@@ -100,7 +100,6 @@ struct obd_client_handle {
 #define OBD_CLIENT_HANDLE_MAGIC 0xd15ea5ed
 
 /* statfs_pack.c */
-void statfs_pack(struct obd_statfs *osfs, struct kstatfs *sfs);
 void statfs_unpack(struct kstatfs *sfs, struct obd_statfs *osfs);
 
 /*
drivers/staging/lustre/lustre/obdclass/statfs_pack.c +0 -14
index cc785ab..fb4e3ae 100644
@@ -46,20 +46,6 @@
 #include "../include/obd_support.h"
 #include "../include/obd_class.h"
 
-void statfs_pack(struct obd_statfs *osfs, struct kstatfs *sfs)
-{
-	memset(osfs, 0, sizeof(*osfs));
-	osfs->os_type = sfs->f_type;
-	osfs->os_blocks = sfs->f_blocks;
-	osfs->os_bfree = sfs->f_bfree;
-	osfs->os_bavail = sfs->f_bavail;
-	osfs->os_files = sfs->f_files;
-	osfs->os_ffree = sfs->f_ffree;
-	osfs->os_bsize = sfs->f_bsize;
-	osfs->os_namelen = sfs->f_namelen;
-}
-EXPORT_SYMBOL(statfs_pack);
-
 void statfs_unpack(struct kstatfs *sfs, struct obd_statfs *osfs)
 {
 	memset(sfs, 0, sizeof(*sfs));
Signature · 1 line
2.1.0
#8 lore raw

PATCH 8/29 staging/lustre: Remove unused ptlrpcd_add_rqset()

In reply to [email protected]

From: Oleg Drokin <[email protected]>

No point in retaining it if it's unused.

---
 drivers/staging/lustre/lustre/include/lustre_net.h |  1 -
 drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c     | 42 ----------------------
 2 files changed, 43 deletions(-)
drivers/staging/lustre/lustre/include/lustre_net.h +0 -1
index 090484b..6df3e70 100644
@@ -2902,7 +2902,6 @@ void ptlrpcd_stop(struct ptlrpcd_ctl *pc, int force);
 void ptlrpcd_free(struct ptlrpcd_ctl *pc);
 void ptlrpcd_wake(struct ptlrpc_request *req);
 void ptlrpcd_add_req(struct ptlrpc_request *req);
-void ptlrpcd_add_rqset(struct ptlrpc_request_set *set);
 int ptlrpcd_addref(void);
 void ptlrpcd_decref(void);
 
drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c +0 -42

48 lines not on this page · raw message

Signature · 1 line
2.1.0
#9 lore raw

PATCH 9/29 staging/lustre: Remove unused functions and definitions from cl_object

In reply to [email protected]

From: Oleg Drokin <[email protected]>

cl_object_header_fini, cl_object_has_locks, cl_attr2lvb, cl_page_list_own, cl_page_list_unmap, cl_2queue_assume, cl_io_print, cl_enqueue,
also cleanup extern declarations in cl_object.h

---
 drivers/staging/lustre/lustre/include/cl_object.h  | 26 ---------
 drivers/staging/lustre/lustre/obdclass/cl_io.c     | 65 ----------------------
 drivers/staging/lustre/lustre/obdclass/cl_lock.c   | 26 ---------
 drivers/staging/lustre/lustre/obdclass/cl_object.c | 41 --------------
 4 files changed, 158 deletions(-)
drivers/staging/lustre/lustre/include/cl_object.h +0 -26
index b2366ca..b073313 100644
@@ -2733,7 +2733,6 @@ struct cl_object *cl_object_find(const struct lu_env *env, struct cl_device *cd,
 				 const struct cl_object_conf *c);
 
 int  cl_object_header_init(struct cl_object_header *h);
-void cl_object_header_fini(struct cl_object_header *h);
 void cl_object_put	(const struct lu_env *env, struct cl_object *o);
 void cl_object_get	(struct cl_object *o);
 void cl_object_attr_lock  (struct cl_object *o);
@@ -2748,7 +2747,6 @@ int  cl_conf_set	  (const struct lu_env *env, struct cl_object *obj,
 			   const struct cl_object_conf *conf);
 void cl_object_prune      (const struct lu_env *env, struct cl_object *obj);
 void cl_object_kill       (const struct lu_env *env, struct cl_object *obj);
-int  cl_object_has_locks  (struct cl_object *obj);
 
 /**
  * Returns true, iff \a o0 and \a o1 are slices of the same object.
@@ -2935,10 +2933,6 @@ void  cl_lock_release   (const struct lu_env *env, struct cl_lock *lock,
 void  cl_lock_user_add  (const struct lu_env *env, struct cl_lock *lock);
 void  cl_lock_user_del  (const struct lu_env *env, struct cl_lock *lock);
 
-enum cl_lock_state cl_lock_intransit(const struct lu_env *env,
-				     struct cl_lock *lock);
-void cl_lock_extransit(const struct lu_env *env, struct cl_lock *lock,
-		       enum cl_lock_state state);
 int cl_lock_is_intransit(struct cl_lock *lock);
 
 int cl_lock_enqueue_wait(const struct lu_env *env, struct cl_lock *lock,
@@ -2976,8 +2970,6 @@ int cl_lock_enqueue_wait(const struct lu_env *env, struct cl_lock *lock,
  *
  * @{ */
 
-int   cl_enqueue    (const struct lu_env *env, struct cl_lock *lock,
-		     struct cl_io *io, __u32 flags);
 int   cl_wait       (const struct lu_env *env, struct cl_lock *lock);
 void  cl_unuse      (const struct lu_env *env, struct cl_lock *lock);
 int   cl_enqueue_try(const struct lu_env *env, struct cl_lock *lock,
@@ -2996,7 +2988,6 @@ int  cl_queue_match      (const struct list_head *queue,
 			  const struct cl_lock_descr *need);
 
 void cl_lock_mutex_get  (const struct lu_env *env, struct cl_lock *lock);
-int  cl_lock_mutex_try  (const struct lu_env *env, struct cl_lock *lock);
 void cl_lock_mutex_put  (const struct lu_env *env, struct cl_lock *lock);
 int  cl_lock_is_mutexed (struct cl_lock *lock);
 int  cl_lock_nr_mutexed (const struct lu_env *env);
@@ -3062,10 +3053,6 @@ int   cl_io_submit_rw    (const struct lu_env *env, struct cl_io *io,
 int   cl_io_submit_sync  (const struct lu_env *env, struct cl_io *io,
 			  enum cl_req_type iot, struct cl_2queue *queue,
 			  long timeout);
-void  cl_io_rw_advance   (const struct lu_env *env, struct cl_io *io,
-			  size_t nob);
-int   cl_io_cancel       (const struct lu_env *env, struct cl_io *io,
-			  struct cl_page_list *queue);
 int   cl_io_is_going     (const struct lu_env *env);
 
 /**
@@ -3097,9 +3084,6 @@ static inline int cl_io_is_trunc(const struct cl_io *io)
 
 struct cl_io *cl_io_top(struct cl_io *io);
 
-void cl_io_print(const struct lu_env *env, void *cookie,
-		 lu_printer_t printer, const struct cl_io *io);
-
 #define CL_IO_SLICE_CLEAN(foo_io, base)					\
 do {									\
 	typeof(foo_io) __foo_io = (foo_io);				\
@@ -3145,22 +3129,14 @@ void cl_page_list_del    (const struct lu_env *env,
 			  struct cl_page_list *plist, struct cl_page *page);
 void cl_page_list_disown (const struct lu_env *env,
 			  struct cl_io *io, struct cl_page_list *plist);
-int  cl_page_list_own    (const struct lu_env *env,
-			  struct cl_io *io, struct cl_page_list *plist);
-void cl_page_list_assume (const struct lu_env *env,
-			  struct cl_io *io, struct cl_page_list *plist);
 void cl_page_list_discard(const struct lu_env *env,
 			  struct cl_io *io, struct cl_page_list *plist);
-int  cl_page_list_unmap  (const struct lu_env *env,
-			  struct cl_io *io, struct cl_page_list *plist);
 void cl_page_list_fini   (const struct lu_env *env, struct cl_page_list *plist);
 
 void cl_2queue_init     (struct cl_2queue *queue);
 void cl_2queue_add      (struct cl_2queue *queue, struct cl_page *page);
 void cl_2queue_disown   (const struct lu_env *env,
 			 struct cl_io *io, struct cl_2queue *queue);
-void cl_2queue_assume   (const struct lu_env *env,
-			 struct cl_io *io, struct cl_2queue *queue);
 void cl_2queue_discard  (const struct lu_env *env,
 			 struct cl_io *io, struct cl_2queue *queue);
 void cl_2queue_fini     (const struct lu_env *env, struct cl_2queue *queue);
@@ -3253,7 +3229,6 @@ struct cl_env_nest {
 	void *cen_cookie;
 };
 
-struct lu_env *cl_env_peek       (int *refcheck);
 struct lu_env *cl_env_get	(int *refcheck);
 struct lu_env *cl_env_alloc      (int *refcheck, __u32 tags);
 struct lu_env *cl_env_nested_get (struct cl_env_nest *nest);
@@ -3269,7 +3244,6 @@ void	   cl_env_unplant    (struct lu_env *env, int *refcheck);
 /*
  * Misc
  */
-void cl_attr2lvb(struct ost_lvb *lvb, const struct cl_attr *attr);
 void cl_lvb2attr(struct cl_attr *attr, const struct ost_lvb *lvb);
 
 struct cl_device *cl_type_setup(const struct lu_env *env, struct lu_site *site,
drivers/staging/lustre/lustre/obdclass/cl_io.c +0 -65

89 lines not on this page · raw message

drivers/staging/lustre/lustre/obdclass/cl_lock.c +0 -26
index 7c6583a..4294ca6 100644
@@ -1276,32 +1276,6 @@ static int cl_enqueue_locked(const struct lu_env *env, struct cl_lock *lock,
 }
 
 /**
- * Enqueues a lock.
- *
- * \pre current thread or io owns a hold on lock.
- *
- * \post ergo(result == 0, lock->users increased)
- * \post ergo(result == 0, lock->cll_state == CLS_ENQUEUED ||
- *			 lock->cll_state == CLS_HELD)
- */
-int cl_enqueue(const struct lu_env *env, struct cl_lock *lock,
-	       struct cl_io *io, __u32 enqflags)
-{
-	int result;
-
-	cl_lock_lockdep_acquire(env, lock, enqflags);
-	cl_lock_mutex_get(env, lock);
-	result = cl_enqueue_locked(env, lock, io, enqflags);
-	cl_lock_mutex_put(env, lock);
-	if (result != 0)
-		cl_lock_lockdep_release(env, lock);
-	LASSERT(ergo(result == 0, lock->cll_state == CLS_ENQUEUED ||
-		     lock->cll_state == CLS_HELD));
-	return result;
-}
-EXPORT_SYMBOL(cl_enqueue);
-
-/**
  * Tries to unlock a lock.
  *
  * This function is called to release underlying resource:
drivers/staging/lustre/lustre/obdclass/cl_object.c +0 -41

59 lines not on this page · raw message

Signature · 1 line
2.1.0
#10 lore raw

PATCH 10/29 staging/lustre: Remove unused lu_object functions.

In reply to [email protected]

From: Oleg Drokin <[email protected]>

Quite a bunch of them are only used on the server. lu_object_put_nocache, lu_object_invariant, lu_dev_del_linkage, lu_context_tags_update, lu_context_tags_clear, lu_session_tags_update, lu_session_tags_clear, lu_env_refill_by_tags, lu_printk_printer, lu_object_assign_fid, lu_object_anon, lu_buf_free, lu_buf_alloc, lu_buf_realloc, lu_buf_check_and_alloc, lu_buf_check_and_grow

---
 drivers/staging/lustre/lustre/include/lu_object.h  |  27 ---
 drivers/staging/lustre/lustre/obdclass/lu_object.c | 241 ---------------------
 2 files changed, 268 deletions(-)
drivers/staging/lustre/lustre/include/lu_object.h +0 -27
index 7756008..e2199c2 100644
@@ -672,7 +672,6 @@ void lu_object_add_top    (struct lu_object_header *h, struct lu_object *o);
 void lu_object_add	(struct lu_object *before, struct lu_object *o);
 
 void lu_dev_add_linkage(struct lu_site *s, struct lu_device *d);
-void lu_dev_del_linkage(struct lu_site *s, struct lu_device *d);
 
 /**
  * Helpers to initialize and finalize device types.
@@ -710,7 +709,6 @@ static inline int lu_object_is_dying(const struct lu_object_header *h)
 }
 
 void lu_object_put(const struct lu_env *env, struct lu_object *o);
-void lu_object_put_nocache(const struct lu_env *env, struct lu_object *o);
 void lu_object_unhash(const struct lu_env *env, struct lu_object *o);
 
 int lu_site_purge(const struct lu_env *env, struct lu_site *s, int nr);
@@ -1241,14 +1239,6 @@ void lu_context_key_degister_many(struct lu_context_key *k, ...);
 void lu_context_key_revive_many  (struct lu_context_key *k, ...);
 void lu_context_key_quiesce_many (struct lu_context_key *k, ...);
 
-/*
- * update/clear ctx/ses tags.
- */
-void lu_context_tags_update(__u32 tags);
-void lu_context_tags_clear(__u32 tags);
-void lu_session_tags_update(__u32 tags);
-void lu_session_tags_clear(__u32 tags);
-
 /**
  * Environment.
  */
@@ -1266,7 +1256,6 @@ struct lu_env {
 int  lu_env_init  (struct lu_env *env, __u32 tags);
 void lu_env_fini  (struct lu_env *env);
 int  lu_env_refill(struct lu_env *env);
-int  lu_env_refill_by_tags(struct lu_env *env, __u32 ctags, __u32 stags);
 
 /** @} lu_context */
 
@@ -1319,21 +1308,5 @@ struct lu_kmem_descr {
 int  lu_kmem_init(struct lu_kmem_descr *caches);
 void lu_kmem_fini(struct lu_kmem_descr *caches);
 
-void lu_object_assign_fid(const struct lu_env *env, struct lu_object *o,
-			  const struct lu_fid *fid);
-struct lu_object *lu_object_anon(const struct lu_env *env,
-				 struct lu_device *dev,
-				 const struct lu_object_conf *conf);
-
-/** null buffer */
-extern struct lu_buf LU_BUF_NULL;
-
-void lu_buf_free(struct lu_buf *buf);
-void lu_buf_alloc(struct lu_buf *buf, int size);
-void lu_buf_realloc(struct lu_buf *buf, int size);
-
-int lu_buf_check_and_grow(struct lu_buf *buf, int len);
-struct lu_buf *lu_buf_check_and_alloc(struct lu_buf *buf, int len);
-
 /** @} lu */
 #endif /* __LUSTRE_LU_OBJECT_H */
drivers/staging/lustre/lustre/obdclass/lu_object.c +0 -241

283 lines not on this page · raw message

Signature · 1 line
2.1.0
#11 lore raw

PATCH 11/29 staging/lustre/ldlm: Remove unused round_timeout function

In reply to [email protected]

From: Oleg Drokin <[email protected]>

It's not referenced anywhere anymore.

---
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +0 -5
index ac79db9..a78c4a4 100644
@@ -71,11 +71,6 @@ struct ldlm_cb_async_args {
 
 static struct ldlm_state *ldlm_state;
 
-inline unsigned long round_timeout(unsigned long timeout)
-{
-	return cfs_time_seconds((int)cfs_duration_sec(cfs_time_sub(timeout, 0)) + 1);
-}
-
 #define ELT_STOPPED   0
 #define ELT_READY     1
 #define ELT_TERMINATE 2
Signature · 1 line
2.1.0
#12 lore raw

PATCH 12/29 staging/lustre/obdclass: Remove unused functions from genops.c

In reply to [email protected]

From: Oleg Drokin <[email protected]>

These functions are mostly used on the server.

class_uuid2obd, get_devices_count, class_obd_list, class_conn2obd, class_conn2cliimp, class_connected_export, obd_exports_barrier, kuc_* (kernel-userspace communications).

---
 .../staging/lustre/lustre/include/lustre_import.h  |   1 -
 drivers/staging/lustre/lustre/include/obd_class.h  |  11 --
 drivers/staging/lustre/lustre/obdclass/genops.c    | 189 ---------------------
 3 files changed, 201 deletions(-)
drivers/staging/lustre/lustre/include/lustre_import.h +0 -1
index 079db52..660d290 100644
@@ -374,7 +374,6 @@ extern unsigned int at_max;
 /* genops.c */
 struct obd_export;
 struct obd_import *class_exp2cliimp(struct obd_export *);
-struct obd_import *class_conn2cliimp(struct lustre_handle *);
 
 /** @} import */
 
drivers/staging/lustre/lustre/include/obd_class.h +0 -11
index 8bfdc97..b323403 100644
@@ -64,7 +64,6 @@ extern struct obd_device *obd_devs[MAX_OBD_DEVICES];
 extern rwlock_t obd_dev_lock;
 
 /* OBD Operations Declarations */
-struct obd_device *class_conn2obd(struct lustre_handle *);
 struct obd_device *class_exp2obd(struct obd_export *);
 int class_handle_ioctl(unsigned int cmd, unsigned long arg);
 int lustre_get_jobid(char *jobid);
@@ -84,15 +83,12 @@ void class_release_dev(struct obd_device *obd);
 int class_name2dev(const char *name);
 struct obd_device *class_name2obd(const char *name);
 int class_uuid2dev(struct obd_uuid *uuid);
-struct obd_device *class_uuid2obd(struct obd_uuid *uuid);
-void class_obd_list(void);
 struct obd_device *class_find_client_obd(struct obd_uuid *tgt_uuid,
 					  const char *typ_name,
 					  struct obd_uuid *grp_uuid);
 struct obd_device *class_devices_in_group(struct obd_uuid *grp_uuid,
 					   int *next);
 struct obd_device *class_num2obd(int num);
-int get_devices_count(void);
 
 int class_notify_sptlrpc_conf(const char *fsname, int namelen);
 
@@ -104,12 +100,6 @@ int obd_zombie_impexp_init(void);
 void obd_zombie_impexp_stop(void);
 void obd_zombie_impexp_cull(void);
 void obd_zombie_barrier(void);
-void obd_exports_barrier(struct obd_device *obd);
-int kuc_len(int payload_len);
-struct kuc_hdr *kuc_ptr(void *p);
-int kuc_ispayload(void *p);
-void *kuc_alloc(int payload_len, int transport, int type);
-void kuc_free(void *p, int payload_len);
 
 struct llog_handle;
 struct llog_rec_hdr;
@@ -283,7 +273,6 @@ int class_connect(struct lustre_handle *conn, struct obd_device *obd,
 		  struct obd_uuid *cluuid);
 int class_disconnect(struct obd_export *exp);
 void class_fail_export(struct obd_export *exp);
-int class_connected_export(struct obd_export *exp);
 int class_manual_cleanup(struct obd_device *obd);
 static inline enum obd_option exp_flags_from_obd(struct obd_device *obd)
 {
drivers/staging/lustre/lustre/obdclass/genops.c +0 -189

228 lines not on this page · raw message

Signature · 1 line
2.1.0
#13 lore raw

PATCH 13/29 staging/lustre: Remove unused function class_handle_hash_back()

In reply to [email protected]

From: Oleg Drokin <[email protected]>

No callers left.

---
 drivers/staging/lustre/lustre/include/lustre_handles.h  |  1 -
 drivers/staging/lustre/lustre/obdclass/lustre_handles.c | 13 -------------
 2 files changed, 14 deletions(-)
drivers/staging/lustre/lustre/include/lustre_handles.h +0 -1
index 726bbd3..4d51c8a 100644
@@ -86,7 +86,6 @@ struct portals_handle {
 void class_handle_hash(struct portals_handle *,
 		       struct portals_handle_ops *ops);
 void class_handle_unhash(struct portals_handle *);
-void class_handle_hash_back(struct portals_handle *);
 void *class_handle2object(__u64 cookie);
 void class_handle_free_cb(struct rcu_head *rcu);
 int class_handle_init(void);
drivers/staging/lustre/lustre/obdclass/lustre_handles.c +0 -13
index 97d79da..d19ec15 100644
@@ -134,19 +134,6 @@ void class_handle_unhash(struct portals_handle *h)
 }
 EXPORT_SYMBOL(class_handle_unhash);
 
-void class_handle_hash_back(struct portals_handle *h)
-{
-	struct handle_bucket *bucket;
-
-	bucket = handle_hash + (h->h_cookie & HANDLE_HASH_MASK);
-
-	spin_lock(&bucket->lock);
-	list_add_rcu(&h->h_link, &bucket->head);
-	h->h_in = 1;
-	spin_unlock(&bucket->lock);
-}
-EXPORT_SYMBOL(class_handle_hash_back);
-
 void *class_handle2object(__u64 cookie)
 {
 	struct handle_bucket *bucket;
Signature · 1 line
2.1.0
#14 lore raw

PATCH 14/29 staging/lustre: Remove unused function server_name2svname()

In reply to [email protected]

From: Oleg Drokin <[email protected]>

All users are only in the server code

---
 .../staging/lustre/lustre/include/lustre_disk.h    |  2 --
 drivers/staging/lustre/lustre/obdclass/obd_mount.c | 27 ----------------------
 2 files changed, 29 deletions(-)
drivers/staging/lustre/lustre/include/lustre_disk.h +0 -2
index ec33259..4178c85 100644
@@ -385,8 +385,6 @@ struct lustre_mount_info {
 /* obd_mount.c */
 int server_name2fsname(const char *svname, char *fsname, const char **endptr);
 int server_name2index(const char *svname, __u32 *idx, const char **endptr);
-int server_name2svname(const char *label, char *svname, const char **endptr,
-		       size_t svsize);
 
 int lustre_put_lsi(struct super_block *sb);
 int lustre_start_simple(char *obdname, char *type, char *uuid,
drivers/staging/lustre/lustre/obdclass/obd_mount.c +0 -27
index 16009a6..bc15e15 100644
@@ -599,33 +599,6 @@ int server_name2fsname(const char *svname, char *fsname, const char **endptr)
 }
 EXPORT_SYMBOL(server_name2fsname);
 
-/**
- * Get service name (svname) from string
- * rc < 0 on error
- * if endptr isn't NULL it is set to end of fsname *
- */
-int server_name2svname(const char *label, char *svname, const char **endptr,
-		       size_t svsize)
-{
-	int rc;
-	const char *dash;
-
-	/* We use server_name2fsname() just for parsing */
-	rc = server_name2fsname(label, NULL, &dash);
-	if (rc != 0)
-		return rc;
-
-	if (endptr != NULL)
-		*endptr = dash;
-
-	if (strlcpy(svname, dash + 1, svsize) >= svsize)
-		return -E2BIG;
-
-	return 0;
-}
-EXPORT_SYMBOL(server_name2svname);
-
-
 /* Get the index from the obd name.
    rc = server type, or
    rc < 0  on error
Signature · 1 line
2.1.0
#15 lore raw

PATCH 15/29 staging/lustre/obdclass: Drop unused code from obdo.c

In reply to [email protected]

From: Oleg Drokin <[email protected]>

These functions are not even referenced in any header files anymore.

---
 drivers/staging/lustre/lustre/obdclass/obdo.c | 170 --------------------------
 1 file changed, 170 deletions(-)
drivers/staging/lustre/lustre/obdclass/obdo.c +0 -170
index 307ffe3..1a950fb 100644
@@ -115,90 +115,6 @@ void obdo_from_inode(struct obdo *dst, struct inode *src, u32 valid)
 }
 EXPORT_SYMBOL(obdo_from_inode);
 
-void obdo_cpy_md(struct obdo *dst, struct obdo *src, u32 valid)
-{
-	CDEBUG(D_INODE, "src obdo "DOSTID" valid %#llx, dst obdo "DOSTID"\n",
-	       POSTID(&src->o_oi), src->o_valid, POSTID(&dst->o_oi));
-	if (valid & OBD_MD_FLATIME)
-		dst->o_atime = src->o_atime;
-	if (valid & OBD_MD_FLMTIME)
-		dst->o_mtime = src->o_mtime;
-	if (valid & OBD_MD_FLCTIME)
-		dst->o_ctime = src->o_ctime;
-	if (valid & OBD_MD_FLSIZE)
-		dst->o_size = src->o_size;
-	if (valid & OBD_MD_FLBLOCKS) /* allocation of space */
-		dst->o_blocks = src->o_blocks;
-	if (valid & OBD_MD_FLBLKSZ)
-		dst->o_blksize = src->o_blksize;
-	if (valid & OBD_MD_FLTYPE)
-		dst->o_mode = (dst->o_mode & ~S_IFMT) | (src->o_mode & S_IFMT);
-	if (valid & OBD_MD_FLMODE)
-		dst->o_mode = (dst->o_mode & S_IFMT) | (src->o_mode & ~S_IFMT);
-	if (valid & OBD_MD_FLUID)
-		dst->o_uid = src->o_uid;
-	if (valid & OBD_MD_FLGID)
-		dst->o_gid = src->o_gid;
-	if (valid & OBD_MD_FLFLAGS)
-		dst->o_flags = src->o_flags;
-	if (valid & OBD_MD_FLFID) {
-		dst->o_parent_seq = src->o_parent_seq;
-		dst->o_parent_ver = src->o_parent_ver;
-	}
-	if (valid & OBD_MD_FLGENER)
-		dst->o_parent_oid = src->o_parent_oid;
-	if (valid & OBD_MD_FLHANDLE)
-		dst->o_handle = src->o_handle;
-	if (valid & OBD_MD_FLCOOKIE)
-		dst->o_lcookie = src->o_lcookie;
-
-	dst->o_valid |= valid;
-}
-EXPORT_SYMBOL(obdo_cpy_md);
-
-/* returns FALSE if comparison (by flags) is same, TRUE if changed */
-int obdo_cmp_md(struct obdo *dst, struct obdo *src, u32 compare)
-{
-	int res = 0;
-
-	if (compare & OBD_MD_FLATIME)
-		res |= dst->o_atime != src->o_atime;
-	if (compare & OBD_MD_FLMTIME)
-		res |= dst->o_mtime != src->o_mtime;
-	if (compare & OBD_MD_FLCTIME)
-		res |= dst->o_ctime != src->o_ctime;
-	if (compare & OBD_MD_FLSIZE)
-		res |= dst->o_size != src->o_size;
-	if (compare & OBD_MD_FLBLOCKS) /* allocation of space */
-		res |= dst->o_blocks != src->o_blocks;
-	if (compare & OBD_MD_FLBLKSZ)
-		res |= dst->o_blksize != src->o_blksize;
-	if (compare & OBD_MD_FLTYPE)
-		res |= ((dst->o_mode ^ src->o_mode) & S_IFMT) != 0;
-	if (compare & OBD_MD_FLMODE)
-		res |= ((dst->o_mode ^ src->o_mode) & ~S_IFMT) != 0;
-	if (compare & OBD_MD_FLUID)
-		res |= dst->o_uid != src->o_uid;
-	if (compare & OBD_MD_FLGID)
-		res |= dst->o_gid != src->o_gid;
-	if (compare & OBD_MD_FLFLAGS)
-		res |= dst->o_flags != src->o_flags;
-	if (compare & OBD_MD_FLNLINK)
-		res |= dst->o_nlink != src->o_nlink;
-	if (compare & OBD_MD_FLFID) {
-		res |= dst->o_parent_seq != src->o_parent_seq;
-		res |= dst->o_parent_ver != src->o_parent_ver;
-	}
-	if (compare & OBD_MD_FLGENER)
-		res |= dst->o_parent_oid != src->o_parent_oid;
-	/* XXX Don't know if these should be included here - wasn't previously
-	if ( compare & OBD_MD_FLINLINE )
-		res |= memcmp(dst->o_inline, src->o_inline);
-	*/
-	return res;
-}
-EXPORT_SYMBOL(obdo_cmp_md);
-
 void obdo_to_ioobj(struct obdo *oa, struct obd_ioobj *ioobj)
 {
 	ioobj->ioo_oid = oa->o_oi;
@@ -211,42 +127,6 @@ void obdo_to_ioobj(struct obdo *oa, struct obd_ioobj *ioobj)
 }
 EXPORT_SYMBOL(obdo_to_ioobj);
 
-void obdo_from_iattr(struct obdo *oa, struct iattr *attr, unsigned int ia_valid)
-{
-	if (ia_valid & ATTR_ATIME) {
-		oa->o_atime = LTIME_S(attr->ia_atime);
-		oa->o_valid |= OBD_MD_FLATIME;
-	}
-	if (ia_valid & ATTR_MTIME) {
-		oa->o_mtime = LTIME_S(attr->ia_mtime);
-		oa->o_valid |= OBD_MD_FLMTIME;
-	}
-	if (ia_valid & ATTR_CTIME) {
-		oa->o_ctime = LTIME_S(attr->ia_ctime);
-		oa->o_valid |= OBD_MD_FLCTIME;
-	}
-	if (ia_valid & ATTR_SIZE) {
-		oa->o_size = attr->ia_size;
-		oa->o_valid |= OBD_MD_FLSIZE;
-	}
-	if (ia_valid & ATTR_MODE) {
-		oa->o_mode = attr->ia_mode;
-		oa->o_valid |= OBD_MD_FLTYPE | OBD_MD_FLMODE;
-		if (!in_group_p(make_kgid(&init_user_ns, oa->o_gid)) &&
-		    !capable(CFS_CAP_FSETID))
-			oa->o_mode &= ~S_ISGID;
-	}
-	if (ia_valid & ATTR_UID) {
-		oa->o_uid = from_kuid(&init_user_ns, attr->ia_uid);
-		oa->o_valid |= OBD_MD_FLUID;
-	}
-	if (ia_valid & ATTR_GID) {
-		oa->o_gid = from_kgid(&init_user_ns, attr->ia_gid);
-		oa->o_valid |= OBD_MD_FLGID;
-	}
-}
-EXPORT_SYMBOL(obdo_from_iattr);
-
 void iattr_from_obdo(struct iattr *attr, struct obdo *oa, u32 valid)
 {
 	valid &= oa->o_valid;
@@ -310,53 +190,3 @@ void md_from_obdo(struct md_op_data *op_data, struct obdo *oa, u32 valid)
 	}
 }
 EXPORT_SYMBOL(md_from_obdo);
-
-void obdo_from_md(struct obdo *oa, struct md_op_data *op_data,
-		  unsigned int valid)
-{
-	obdo_from_iattr(oa, &op_data->op_attr, valid);
-	if (valid & ATTR_BLOCKS) {
-		oa->o_blocks = op_data->op_attr_blocks;
-		oa->o_valid |= OBD_MD_FLBLOCKS;
-	}
-	if (valid & ATTR_ATTR_FLAG) {
-		oa->o_flags =
-			((struct ll_iattr *)&op_data->op_attr)->ia_attr_flags;
-		oa->o_valid |= OBD_MD_FLFLAGS;
-	}
-}
-EXPORT_SYMBOL(obdo_from_md);
-
-void obdo_cpu_to_le(struct obdo *dobdo, struct obdo *sobdo)
-{
-	dobdo->o_size = cpu_to_le64(sobdo->o_size);
-	dobdo->o_mtime = cpu_to_le64(sobdo->o_mtime);
-	dobdo->o_atime = cpu_to_le64(sobdo->o_atime);
-	dobdo->o_ctime = cpu_to_le64(sobdo->o_ctime);
-	dobdo->o_blocks = cpu_to_le64(sobdo->o_blocks);
-	dobdo->o_mode = cpu_to_le32(sobdo->o_mode);
-	dobdo->o_uid = cpu_to_le32(sobdo->o_uid);
-	dobdo->o_gid = cpu_to_le32(sobdo->o_gid);
-	dobdo->o_flags = cpu_to_le32(sobdo->o_flags);
-	dobdo->o_nlink = cpu_to_le32(sobdo->o_nlink);
-	dobdo->o_blksize = cpu_to_le32(sobdo->o_blksize);
-	dobdo->o_valid = cpu_to_le64(sobdo->o_valid);
-}
-EXPORT_SYMBOL(obdo_cpu_to_le);
-
-void obdo_le_to_cpu(struct obdo *dobdo, struct obdo *sobdo)
-{
-	dobdo->o_size = le64_to_cpu(sobdo->o_size);
-	dobdo->o_mtime = le64_to_cpu(sobdo->o_mtime);
-	dobdo->o_atime = le64_to_cpu(sobdo->o_atime);
-	dobdo->o_ctime = le64_to_cpu(sobdo->o_ctime);
-	dobdo->o_blocks = le64_to_cpu(sobdo->o_blocks);
-	dobdo->o_mode = le32_to_cpu(sobdo->o_mode);
-	dobdo->o_uid = le32_to_cpu(sobdo->o_uid);
-	dobdo->o_gid = le32_to_cpu(sobdo->o_gid);
-	dobdo->o_flags = le32_to_cpu(sobdo->o_flags);
-	dobdo->o_nlink = le32_to_cpu(sobdo->o_nlink);
-	dobdo->o_blksize = le32_to_cpu(sobdo->o_blksize);
-	dobdo->o_valid = le64_to_cpu(sobdo->o_valid);
-}
-EXPORT_SYMBOL(obdo_le_to_cpu);
Signature · 1 line
2.1.0
#16 lore raw

PATCH 16/29 staging/lustre/ptlrpc: Drop unused client code

In reply to [email protected]

From: Oleg Drokin <[email protected]>

These client request/import functions are not used anywhere, so drop them.

---
 drivers/staging/lustre/lustre/include/lustre_net.h | 13 ---
 drivers/staging/lustre/lustre/ptlrpc/client.c      | 95 ----------------------
 drivers/staging/lustre/lustre/ptlrpc/import.c      | 11 ---
 3 files changed, 119 deletions(-)
drivers/staging/lustre/lustre/include/lustre_net.h +0 -13
index 6df3e70..a486c1d 100644
@@ -2356,22 +2356,17 @@ void ptlrpc_request_committed(struct ptlrpc_request *req, int force);
 
 void ptlrpc_init_client(int req_portal, int rep_portal, char *name,
 			struct ptlrpc_client *);
-void ptlrpc_cleanup_client(struct obd_import *imp);
 struct ptlrpc_connection *ptlrpc_uuid_to_connection(struct obd_uuid *uuid);
 
 int ptlrpc_queue_wait(struct ptlrpc_request *req);
 int ptlrpc_replay_req(struct ptlrpc_request *req);
 int ptlrpc_unregister_reply(struct ptlrpc_request *req, int async);
-void ptlrpc_restart_req(struct ptlrpc_request *req);
 void ptlrpc_abort_inflight(struct obd_import *imp);
-void ptlrpc_cleanup_imp(struct obd_import *imp);
 void ptlrpc_abort_set(struct ptlrpc_request_set *set);
 
 struct ptlrpc_request_set *ptlrpc_prep_set(void);
 struct ptlrpc_request_set *ptlrpc_prep_fcset(int max, set_producer_func func,
 					     void *arg);
-int ptlrpc_set_add_cb(struct ptlrpc_request_set *set,
-		      set_interpreter_func fn, void *data);
 int ptlrpc_set_next_timeout(struct ptlrpc_request_set *);
 int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set);
 int ptlrpc_set_wait(struct ptlrpc_request_set *);
@@ -2405,15 +2400,7 @@ struct ptlrpc_request *ptlrpc_request_alloc_pack(struct obd_import *imp,
 int ptlrpc_request_bufs_pack(struct ptlrpc_request *request,
 			     __u32 version, int opcode, char **bufs,
 			     struct ptlrpc_cli_ctx *ctx);
-struct ptlrpc_request *ptlrpc_prep_req(struct obd_import *imp, __u32 version,
-				       int opcode, int count, __u32 *lengths,
-				       char **bufs);
-struct ptlrpc_request *ptlrpc_prep_req_pool(struct obd_import *imp,
-					     __u32 version, int opcode,
-					    int count, __u32 *lengths, char **bufs,
-					    struct ptlrpc_request_pool *pool);
 void ptlrpc_req_finished(struct ptlrpc_request *request);
-void ptlrpc_req_finished_with_imp_lock(struct ptlrpc_request *request);
 struct ptlrpc_request *ptlrpc_request_addref(struct ptlrpc_request *req);
 struct ptlrpc_bulk_desc *ptlrpc_prep_bulk_imp(struct ptlrpc_request *req,
 					      unsigned npages, unsigned max_brw,
drivers/staging/lustre/lustre/ptlrpc/client.c +0 -95

125 lines not on this page · raw message

drivers/staging/lustre/lustre/ptlrpc/import.c +0 -11
index 9ff1a22..1ac265d 100644
@@ -142,7 +142,6 @@ void deuuidify(char *uuid, const char *prefix, char **uuid_start, int *uuid_len)
 		    UUID_STR, strlen(UUID_STR)))
 		*uuid_len -= strlen(UUID_STR);
 }
-EXPORT_SYMBOL(deuuidify);
 
 /**
  * Returns true if import was FULL, false if import was already not
@@ -1503,16 +1502,6 @@ out:
 }
 EXPORT_SYMBOL(ptlrpc_disconnect_import);
 
-void ptlrpc_cleanup_imp(struct obd_import *imp)
-{
-	spin_lock(&imp->imp_lock);
-	IMPORT_SET_STATE_NOLOCK(imp, LUSTRE_IMP_CLOSED);
-	imp->imp_generation++;
-	spin_unlock(&imp->imp_lock);
-	ptlrpc_abort_inflight(imp);
-}
-EXPORT_SYMBOL(ptlrpc_cleanup_imp);
-
 /* Adaptive Timeout utils */
 extern unsigned int at_min, at_max, at_history;
 
Signature · 1 line
2.1.0
#17 lore raw

PATCH 17/29 staging/lustre/ptlrpc: secure wrapping code cleanup

In reply to [email protected]

From: Oleg Drokin <[email protected]>

Drop unused functions.

---
 drivers/staging/lustre/lustre/include/lustre_sec.h |  20 --
 drivers/staging/lustre/lustre/ptlrpc/sec.c         | 116 --------
 drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c    | 329 ---------------------
 drivers/staging/lustre/lustre/ptlrpc/sec_config.c  |  48 ---
 drivers/staging/lustre/lustre/ptlrpc/sec_gc.c      |  15 -
 5 files changed, 528 deletions(-)
drivers/staging/lustre/lustre/include/lustre_sec.h +0 -20
index 871185c..1d2c572 100644
@@ -295,7 +295,6 @@ enum lustre_sec_part {
 	LUSTRE_SP_ANY	   = 0xFF
 };
 
-const char *sptlrpc_part2name(enum lustre_sec_part sp);
 enum lustre_sec_part sptlrpc_target_sec_part(struct obd_device *obd);
 
 /**
@@ -339,7 +338,6 @@ int sptlrpc_rule_set_choose(struct sptlrpc_rule_set *rset,
 			    enum lustre_sec_part to,
 			    lnet_nid_t nid,
 			    struct sptlrpc_flavor *sf);
-void sptlrpc_rule_set_dump(struct sptlrpc_rule_set *set);
 
 int  sptlrpc_process_config(struct lustre_cfg *lcfg);
 void sptlrpc_conf_log_start(const char *logname);
@@ -347,10 +345,6 @@ void sptlrpc_conf_log_stop(const char *logname);
 void sptlrpc_conf_log_update_begin(const char *logname);
 void sptlrpc_conf_log_update_end(const char *logname);
 void sptlrpc_conf_client_adapt(struct obd_device *obd);
-void sptlrpc_target_choose_flavor(struct sptlrpc_rule_set *rset,
-				  enum lustre_sec_part from,
-				  lnet_nid_t nid,
-				  struct sptlrpc_flavor *flavor);
 
 /* The maximum length of security payload. 1024 is enough for Kerberos 5,
  * and should be enough for other future mechanisms but not sure.
@@ -1002,16 +996,12 @@ void sptlrpc_sec_put(struct ptlrpc_sec *sec);
  * internal apis which only used by policy implementation
  */
 int  sptlrpc_get_next_secid(void);
-void sptlrpc_sec_destroy(struct ptlrpc_sec *sec);
 
 /*
  * exported client context api
  */
 struct ptlrpc_cli_ctx *sptlrpc_cli_ctx_get(struct ptlrpc_cli_ctx *ctx);
 void sptlrpc_cli_ctx_put(struct ptlrpc_cli_ctx *ctx, int sync);
-void sptlrpc_cli_ctx_expire(struct ptlrpc_cli_ctx *ctx);
-void sptlrpc_cli_ctx_wakeup(struct ptlrpc_cli_ctx *ctx);
-int sptlrpc_cli_ctx_display(struct ptlrpc_cli_ctx *ctx, char *buf, int bufsize);
 
 /*
  * exported client context wrap/buffers
@@ -1054,7 +1044,6 @@ int sptlrpc_parse_rule(char *param, struct sptlrpc_rule *rule);
 /* gc */
 void sptlrpc_gc_add_sec(struct ptlrpc_sec *sec);
 void sptlrpc_gc_del_sec(struct ptlrpc_sec *sec);
-void sptlrpc_gc_add_ctx(struct ptlrpc_cli_ctx *ctx);
 
 /* misc */
 const char *sec2target_str(struct ptlrpc_sec *sec);
@@ -1078,25 +1067,16 @@ int  sptlrpc_svc_wrap_reply(struct ptlrpc_request *req);
 void sptlrpc_svc_free_rs(struct ptlrpc_reply_state *rs);
 void sptlrpc_svc_ctx_addref(struct ptlrpc_request *req);
 void sptlrpc_svc_ctx_decref(struct ptlrpc_request *req);
-void sptlrpc_svc_ctx_invalidate(struct ptlrpc_request *req);
 
 int  sptlrpc_target_export_check(struct obd_export *exp,
 				 struct ptlrpc_request *req);
-void sptlrpc_target_update_exp_flavor(struct obd_device *obd,
-				      struct sptlrpc_rule_set *rset);
-
 /*
  * reverse context
  */
 int sptlrpc_svc_install_rvs_ctx(struct obd_import *imp,
 				struct ptlrpc_svc_ctx *ctx);
-int sptlrpc_cli_install_rvs_ctx(struct obd_import *imp,
-				struct ptlrpc_cli_ctx *ctx);
 
 /* bulk security api */
-int sptlrpc_enc_pool_add_user(void);
-int sptlrpc_enc_pool_del_user(void);
-int  sptlrpc_enc_pool_get_pages(struct ptlrpc_bulk_desc *desc);
 void sptlrpc_enc_pool_put_pages(struct ptlrpc_bulk_desc *desc);
 
 int sptlrpc_cli_wrap_bulk(struct ptlrpc_request *req,
drivers/staging/lustre/lustre/ptlrpc/sec.c +0 -116

152 lines not on this page · raw message

drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c +0 -329

347 lines not on this page · raw message

drivers/staging/lustre/lustre/ptlrpc/sec_config.c +0 -48

66 lines not on this page · raw message

drivers/staging/lustre/lustre/ptlrpc/sec_gc.c +0 -15
index c3ad1da..520329f 100644
@@ -103,21 +103,6 @@ void sptlrpc_gc_del_sec(struct ptlrpc_sec *sec)
 }
 EXPORT_SYMBOL(sptlrpc_gc_del_sec);
 
-void sptlrpc_gc_add_ctx(struct ptlrpc_cli_ctx *ctx)
-{
-	LASSERT(list_empty(&ctx->cc_gc_chain));
-
-	CDEBUG(D_SEC, "hand over ctx %p(%u->%s)\n",
-	       ctx, ctx->cc_vcred.vc_uid, sec2target_str(ctx->cc_sec));
-	spin_lock(&sec_gc_ctx_list_lock);
-	list_add(&ctx->cc_gc_chain, &sec_gc_ctx_list);
-	spin_unlock(&sec_gc_ctx_list_lock);
-
-	thread_add_flags(&sec_gc_thread, SVC_SIGNAL);
-	wake_up(&sec_gc_thread.t_ctl_waitq);
-}
-EXPORT_SYMBOL(sptlrpc_gc_add_ctx);
-
 static void sec_process_ctx_list(void)
 {
 	struct ptlrpc_cli_ctx *ctx;
Signature · 1 line
2.1.0
#18 lore raw

PATCH 18/29 staging/lustre: Drop unused obdo_from_la() and la_from_obdo()

In reply to [email protected]

From: Oleg Drokin <[email protected]>

They are no longer used anywhere.

---
 .../lustre/lustre/obdclass/linux/linux-obdo.c      | 137 ---------------------
 1 file changed, 137 deletions(-)
drivers/staging/lustre/lustre/obdclass/linux/linux-obdo.c +0 -137
index 62ed706..9496c09 100644
@@ -49,102 +49,6 @@
 #include <linux/fs.h>
 #include <linux/pagemap.h> /* for PAGE_CACHE_SIZE */
 
-/*FIXME: Just copy from obdo_from_inode*/
-void obdo_from_la(struct obdo *dst, struct lu_attr *la, __u64 valid)
-{
-	u32 newvalid = 0;
-
-	if (valid & LA_ATIME) {
-		dst->o_atime = la->la_atime;
-		newvalid |= OBD_MD_FLATIME;
-	}
-	if (valid & LA_MTIME) {
-		dst->o_mtime = la->la_mtime;
-		newvalid |= OBD_MD_FLMTIME;
-	}
-	if (valid & LA_CTIME) {
-		dst->o_ctime = la->la_ctime;
-		newvalid |= OBD_MD_FLCTIME;
-	}
-	if (valid & LA_SIZE) {
-		dst->o_size = la->la_size;
-		newvalid |= OBD_MD_FLSIZE;
-	}
-	if (valid & LA_BLOCKS) {  /* allocation of space (x512 bytes) */
-		dst->o_blocks = la->la_blocks;
-		newvalid |= OBD_MD_FLBLOCKS;
-	}
-	if (valid & LA_TYPE) {
-		dst->o_mode = (dst->o_mode & S_IALLUGO) |
-			      (la->la_mode & S_IFMT);
-		newvalid |= OBD_MD_FLTYPE;
-	}
-	if (valid & LA_MODE) {
-		dst->o_mode = (dst->o_mode & S_IFMT) |
-			      (la->la_mode & S_IALLUGO);
-		newvalid |= OBD_MD_FLMODE;
-	}
-	if (valid & LA_UID) {
-		dst->o_uid = la->la_uid;
-		newvalid |= OBD_MD_FLUID;
-	}
-	if (valid & LA_GID) {
-		dst->o_gid = la->la_gid;
-		newvalid |= OBD_MD_FLGID;
-	}
-	dst->o_valid |= newvalid;
-}
-EXPORT_SYMBOL(obdo_from_la);
-
-/*FIXME: Just copy from obdo_from_inode*/
-void la_from_obdo(struct lu_attr *dst, struct obdo *obdo, u32 valid)
-{
-	__u64 newvalid = 0;
-
-	valid &= obdo->o_valid;
-
-	if (valid & OBD_MD_FLATIME) {
-		dst->la_atime = obdo->o_atime;
-		newvalid |= LA_ATIME;
-	}
-	if (valid & OBD_MD_FLMTIME) {
-		dst->la_mtime = obdo->o_mtime;
-		newvalid |= LA_MTIME;
-	}
-	if (valid & OBD_MD_FLCTIME) {
-		dst->la_ctime = obdo->o_ctime;
-		newvalid |= LA_CTIME;
-	}
-	if (valid & OBD_MD_FLSIZE) {
-		dst->la_size = obdo->o_size;
-		newvalid |= LA_SIZE;
-	}
-	if (valid & OBD_MD_FLBLOCKS) {
-		dst->la_blocks = obdo->o_blocks;
-		newvalid |= LA_BLOCKS;
-	}
-	if (valid & OBD_MD_FLTYPE) {
-		dst->la_mode = (dst->la_mode & S_IALLUGO) |
-			       (obdo->o_mode & S_IFMT);
-		newvalid |= LA_TYPE;
-	}
-	if (valid & OBD_MD_FLMODE) {
-		dst->la_mode = (dst->la_mode & S_IFMT) |
-			       (obdo->o_mode & S_IALLUGO);
-		newvalid |= LA_MODE;
-	}
-	if (valid & OBD_MD_FLUID) {
-		dst->la_uid = obdo->o_uid;
-		newvalid |= LA_UID;
-	}
-	if (valid & OBD_MD_FLGID) {
-		dst->la_gid = obdo->o_gid;
-		newvalid |= LA_GID;
-	}
-	dst->la_valid = newvalid;
-}
-EXPORT_SYMBOL(la_from_obdo);
-
 void obdo_refresh_inode(struct inode *dst, struct obdo *src, u32 valid)
 {
 	valid &= src->o_valid;
@@ -179,44 +83,3 @@ void obdo_refresh_inode(struct inode *dst, struct obdo *src, u32 valid)
 		dst->i_blocks = src->o_blocks;
 }
 EXPORT_SYMBOL(obdo_refresh_inode);
-
-void obdo_to_inode(struct inode *dst, struct obdo *src, u32 valid)
-{
-	valid &= src->o_valid;
-
-	LASSERTF(!(valid & (OBD_MD_FLTYPE | OBD_MD_FLGENER | OBD_MD_FLFID |
-			    OBD_MD_FLID | OBD_MD_FLGROUP)),
-		 "object "DOSTID", valid %x\n", POSTID(&src->o_oi), valid);
-
-	if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
-		CDEBUG(D_INODE,
-		       "valid %#llx, cur time %lu/%lu, new %llu/%llu\n",
-		       src->o_valid, LTIME_S(dst->i_mtime),
-		       LTIME_S(dst->i_ctime), src->o_mtime, src->o_ctime);
-
-	if (valid & OBD_MD_FLATIME)
-		LTIME_S(dst->i_atime) = src->o_atime;
-	if (valid & OBD_MD_FLMTIME)
-		LTIME_S(dst->i_mtime) = src->o_mtime;
-	if (valid & OBD_MD_FLCTIME && src->o_ctime > LTIME_S(dst->i_ctime))
-		LTIME_S(dst->i_ctime) = src->o_ctime;
-	if (valid & OBD_MD_FLSIZE)
-		i_size_write(dst, src->o_size);
-	if (valid & OBD_MD_FLBLOCKS) { /* allocation of space */
-		dst->i_blocks = src->o_blocks;
-		if (dst->i_blocks < src->o_blocks) /* overflow */
-			dst->i_blocks = -1;
-
-	}
-	if (valid & OBD_MD_FLBLKSZ)
-		dst->i_blkbits = ffs(src->o_blksize)-1;
-	if (valid & OBD_MD_FLMODE)
-		dst->i_mode = (dst->i_mode & S_IFMT) | (src->o_mode & ~S_IFMT);
-	if (valid & OBD_MD_FLUID)
-		dst->i_uid = make_kuid(&init_user_ns, src->o_uid);
-	if (valid & OBD_MD_FLGID)
-		dst->i_gid = make_kgid(&init_user_ns, src->o_gid);
-	if (valid & OBD_MD_FLFLAGS)
-		dst->i_flags = src->o_flags;
-}
-EXPORT_SYMBOL(obdo_to_inode);
Signature · 1 line
2.1.0
#19 lore raw

PATCH 19/29 staging/lustre: remove lots of dead code

In reply to [email protected]

From: Arnd Bergmann <[email protected]>

This is a large patch to remove all dead code from obdclass and ptlrpc, purely removing functions and declarations now, so despite the size should be easy enough to verify.

---
 .../lustre/lustre/include/lustre/lustre_idl.h      |   8 -
 .../lustre/lustre/include/lustre/lustre_user.h     |   2 -
 .../staging/lustre/lustre/include/lustre_debug.h   |   1 -
 .../staging/lustre/lustre/include/lustre_export.h  |   1 -
 drivers/staging/lustre/lustre/include/lustre_net.h |  18 --
 .../staging/lustre/lustre/include/lustre_param.h   |   6 -
 .../lustre/lustre/include/lustre_req_layout.h      |   4 -
 drivers/staging/lustre/lustre/include/obd_class.h  |  16 --
 drivers/staging/lustre/lustre/obdclass/debug.c     |  10 -
 .../lustre/lustre/obdclass/linux/linux-sysctl.c    |   4 -
 .../staging/lustre/lustre/obdclass/obd_config.c    | 257 ---------------------
 drivers/staging/lustre/lustre/ptlrpc/layout.c      |  64 -----
 drivers/staging/lustre/lustre/ptlrpc/nrs.c         | 123 ----------
 .../staging/lustre/lustre/ptlrpc/pack_generic.c    | 197 ----------------
 drivers/staging/lustre/lustre/ptlrpc/pinger.c      |  18 --
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |   2 -
 16 files changed, 731 deletions(-)
drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +0 -8
index 3ac1de3..9cc92bb 100644
@@ -2587,8 +2587,6 @@ struct lmv_desc {
 	struct obd_uuid ld_uuid;
 };
 
-void lustre_swab_lmv_desc(struct lmv_desc *ld);
-
 /* TODO: lmv_stripe_md should contain mds capabilities for all slave fids */
 struct lmv_stripe_md {
 	__u32	 mea_magic;
@@ -2599,8 +2597,6 @@ struct lmv_stripe_md {
 	struct lu_fid mea_ids[0];
 };
 
-void lustre_swab_lmv_stripe_md(struct lmv_stripe_md *mea);
-
 /* lmv structures */
 #define MEA_MAGIC_LAST_CHAR      0xb2221ca1
 #define MEA_MAGIC_ALL_CHARS      0xb222a11c
@@ -3442,8 +3438,6 @@ struct lu_idxpage {
 	char	lip_entries[0];
 };
 
-void lustre_swab_lip_header(struct lu_idxpage *lip);
-
 #define LIP_HDR_SIZE (offsetof(struct lu_idxpage, lip_entries))
 
 /* Gather all possible type associated with a 4KB container */
@@ -3517,8 +3511,6 @@ struct lustre_capa_key {
 	__u8    lk_key[CAPA_HMAC_KEY_MAX_LEN];    /**< key */
 } __attribute__((packed));
 
-void lustre_swab_lustre_capa_key(struct lustre_capa_key *k);
-
 /** The link ea holds 1 \a link_ea_entry for each hardlink */
 #define LINK_EA_MAGIC 0x11EAF1DFUL
 struct link_ea_header {
drivers/staging/lustre/lustre/include/lustre/lustre_user.h +0 -2
index e9925ef..1a41366 100644
@@ -406,8 +406,6 @@ static inline int lmv_user_md_size(int stripes, int lmm_magic)
 		      stripes * sizeof(struct lmv_user_mds_data);
 }
 
-void lustre_swab_lmv_user_md(struct lmv_user_md *lum);
-
 struct ll_recreate_obj {
 	__u64 lrc_id;
 	__u32 lrc_ost_idx;
drivers/staging/lustre/lustre/include/lustre_debug.h +0 -1
index 6c92d0b..8a08941 100644
@@ -46,7 +46,6 @@
 #include "obd.h"
 
 /* lib/debug.c */
-void dump_lniobuf(struct niobuf_local *lnb);
 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);
drivers/staging/lustre/lustre/include/lustre_export.h +0 -1
index c29bfdb..7634dea 100644
@@ -353,7 +353,6 @@ static inline bool imp_connect_disp_stripe(struct obd_import *imp)
 }
 
 struct obd_export *class_conn2export(struct lustre_handle *conn);
-struct obd_device *class_conn2obd(struct lustre_handle *conn);
 
 /** @} export */
 
drivers/staging/lustre/lustre/include/lustre_net.h +0 -18
index a486c1d..af3bf21 100644
@@ -642,7 +642,6 @@ struct ptlrpc_nrs_pol_ops {
 	 *
 	 * \see ptlrpc_nrs_req_initialize()
 	 * \see ptlrpc_nrs_hpreq_add_nolock()
-	 * \see ptlrpc_nrs_req_hp_move()
 	 */
 	int	(*op_res_get) (struct ptlrpc_nrs_policy *policy,
 			       struct ptlrpc_nrs_request *nrq,
@@ -658,7 +657,6 @@ struct ptlrpc_nrs_pol_ops {
 	 *
 	 * \see ptlrpc_nrs_req_finalize()
 	 * \see ptlrpc_nrs_hpreq_add_nolock()
-	 * \see ptlrpc_nrs_req_hp_move()
 	 */
 	void	(*op_res_put) (struct ptlrpc_nrs_policy *policy,
 			       const struct ptlrpc_nrs_resource *res);
@@ -703,8 +701,6 @@ struct ptlrpc_nrs_pol_ops {
 	 *
 	 * \param[in,out] policy The policy the request \a nrq belongs to
 	 * \param[in,out] nrq    The request to dequeue
-	 *
-	 * \see ptlrpc_nrs_req_del_nolock()
 	 */
 	void	(*op_req_dequeue) (struct ptlrpc_nrs_policy *policy,
 				   struct ptlrpc_nrs_request *nrq);
@@ -1536,10 +1532,6 @@ static inline int ptlrpc_req_interpret(const struct lu_env *env,
  * @{
  */
 int ptlrpc_nrs_policy_register(struct ptlrpc_nrs_pol_conf *conf);
-int ptlrpc_nrs_policy_unregister(struct ptlrpc_nrs_pol_conf *conf);
-void ptlrpc_nrs_req_hp_move(struct ptlrpc_request *req);
-void nrs_policy_get_info_locked(struct ptlrpc_nrs_policy *policy,
-				struct ptlrpc_nrs_pol_info *info);
 
 /*
  * Can the request be moved from the regular NRS head to the high-priority NRS
@@ -2522,7 +2514,6 @@ void ptlrpc_stop_all_threads(struct ptlrpc_service *svc);
 int ptlrpc_start_threads(struct ptlrpc_service *svc);
 int ptlrpc_unregister_service(struct ptlrpc_service *service);
 int liblustre_check_services(void *arg);
-void ptlrpc_daemonize(char *name);
 void ptlrpc_server_drop_request(struct ptlrpc_request *req);
 
 int ptlrpc_hr_init(void);
@@ -2558,7 +2549,6 @@ void ptlrpc_buf_set_swabbed(struct ptlrpc_request *req, const int inout,
 int ptlrpc_unpack_rep_msg(struct ptlrpc_request *req, int len);
 int ptlrpc_unpack_req_msg(struct ptlrpc_request *req, int len);
 
-int lustre_msg_check_version(struct lustre_msg *msg, __u32 version);
 void lustre_init_msg_v2(struct lustre_msg_v2 *msg, int count, __u32 *lens,
 			char **bufs);
 int lustre_pack_request(struct ptlrpc_request *, __u32 magic, int count,
@@ -2582,7 +2572,6 @@ int lustre_msg_early_size(void);
 void *lustre_msg_buf_v2(struct lustre_msg_v2 *m, int n, int min_size);
 void *lustre_msg_buf(struct lustre_msg *m, int n, int minlen);
 int lustre_msg_buflen(struct lustre_msg *m, int n);
-void lustre_msg_set_buflen(struct lustre_msg *m, int n, int len);
 int lustre_msg_bufcount(struct lustre_msg *m);
 char *lustre_msg_string(struct lustre_msg *m, int n, int max_len);
 __u32 lustre_msghdr_get_flags(struct lustre_msg *msg);
@@ -2595,10 +2584,8 @@ __u32 lustre_msg_get_op_flags(struct lustre_msg *msg);
 void lustre_msg_add_op_flags(struct lustre_msg *msg, int flags);
 struct lustre_handle *lustre_msg_get_handle(struct lustre_msg *msg);
 __u32 lustre_msg_get_type(struct lustre_msg *msg);
-__u32 lustre_msg_get_version(struct lustre_msg *msg);
 void lustre_msg_add_version(struct lustre_msg *msg, int version);
 __u32 lustre_msg_get_opc(struct lustre_msg *msg);
-__u64 lustre_msg_get_last_xid(struct lustre_msg *msg);
 __u64 lustre_msg_get_last_committed(struct lustre_msg *msg);
 __u64 *lustre_msg_get_versions(struct lustre_msg *msg);
 __u64 lustre_msg_get_transno(struct lustre_msg *msg);
@@ -2611,21 +2598,16 @@ __u32 lustre_msg_get_conn_cnt(struct lustre_msg *msg);
 __u32 lustre_msg_get_magic(struct lustre_msg *msg);
 __u32 lustre_msg_get_timeout(struct lustre_msg *msg);
 __u32 lustre_msg_get_service_time(struct lustre_msg *msg);
-char *lustre_msg_get_jobid(struct lustre_msg *msg);
 __u32 lustre_msg_get_cksum(struct lustre_msg *msg);
 __u32 lustre_msg_calc_cksum(struct lustre_msg *msg);
 void lustre_msg_set_handle(struct lustre_msg *msg,
 			   struct lustre_handle *handle);
 void lustre_msg_set_type(struct lustre_msg *msg, __u32 type);
 void lustre_msg_set_opc(struct lustre_msg *msg, __u32 opc);
-void lustre_msg_set_last_xid(struct lustre_msg *msg, __u64 last_xid);
-void lustre_msg_set_last_committed(struct lustre_msg *msg,
-				   __u64 last_committed);
 void lustre_msg_set_versions(struct lustre_msg *msg, __u64 *versions);
 void lustre_msg_set_transno(struct lustre_msg *msg, __u64 transno);
 void lustre_msg_set_status(struct lustre_msg *msg, __u32 status);
 void lustre_msg_set_conn_cnt(struct lustre_msg *msg, __u32 conn_cnt);
-void ptlrpc_req_set_repsize(struct ptlrpc_request *req, int count, __u32 *sizes);
 void ptlrpc_request_set_replen(struct ptlrpc_request *req);
 void lustre_msg_set_timeout(struct lustre_msg *msg, __u32 timeout);
 void lustre_msg_set_service_time(struct lustre_msg *msg, __u32 service_time);
drivers/staging/lustre/lustre/include/lustre_param.h +0 -6
index ed65468..de49b41 100644
@@ -56,15 +56,9 @@ struct cfg_interop_param {
 
 /* obd_config.c */
 int class_find_param(char *buf, char *key, char **valp);
-struct cfg_interop_param *class_find_old_param(const char *param,
-					       struct cfg_interop_param *ptr);
-int class_get_next_param(char **params, char *copy);
 int class_match_param(char *buf, char *key, char **valp);
 int class_parse_nid(char *buf, lnet_nid_t *nid, char **endh);
 int class_parse_nid_quiet(char *buf, lnet_nid_t *nid, char **endh);
-int class_parse_net(char *buf, __u32 *net, char **endh);
-int class_match_nid(char *buf, char *key, lnet_nid_t nid);
-int class_match_net(char *buf, char *key, __u32 net);
 /* obd_mount.c */
 int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd,
 	    char *s1, char *s2, char *s3, char *s4);
drivers/staging/lustre/lustre/include/lustre_req_layout.h +0 -4
index 04c0076..cfcc995 100644
@@ -80,8 +80,6 @@ void req_capsule_init(struct req_capsule *pill, struct ptlrpc_request *req,
 void req_capsule_fini(struct req_capsule *pill);
 
 void req_capsule_set(struct req_capsule *pill, const struct req_format *fmt);
-void req_capsule_client_dump(struct req_capsule *pill);
-void req_capsule_server_dump(struct req_capsule *pill);
 void req_capsule_init_area(struct req_capsule *pill);
 int req_capsule_filled_sizes(struct req_capsule *pill, enum req_location loc);
 int  req_capsule_server_pack(struct req_capsule *pill);
@@ -105,8 +103,6 @@ void *req_capsule_server_swab_get(struct req_capsule *pill,
 void *req_capsule_server_sized_swab_get(struct req_capsule *pill,
 					const struct req_msg_field *field,
 					int len, void *swabber);
-const void *req_capsule_other_get(struct req_capsule *pill,
-				  const struct req_msg_field *field);
 
 void req_capsule_set_size(struct req_capsule *pill,
 			  const struct req_msg_field *field,
drivers/staging/lustre/lustre/include/obd_class.h +0 -16
index b323403..73fb29f 100644
@@ -106,8 +106,6 @@ struct llog_rec_hdr;
 typedef int (*llog_cb_t)(const struct lu_env *, struct llog_handle *,
 			 struct llog_rec_hdr *, void *);
 /* obd_config.c */
-struct lustre_cfg *lustre_cfg_rename(struct lustre_cfg *cfg,
-				     const char *new_name);
 int class_process_config(struct lustre_cfg *lcfg);
 int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
 			     struct lustre_cfg *lcfg, void *data);
@@ -147,9 +145,6 @@ struct config_llog_instance {
 };
 int class_config_parse_llog(const struct lu_env *env, struct llog_ctxt *ctxt,
 			    char *name, struct config_llog_instance *cfg);
-int class_config_dump_llog(const struct lu_env *env, struct llog_ctxt *ctxt,
-			   char *name, struct config_llog_instance *cfg);
-
 enum {
 	CONFIG_T_CONFIG  = 0,
 	CONFIG_T_SPTLRPC = 1,
@@ -285,22 +280,11 @@ static inline enum obd_option exp_flags_from_obd(struct obd_device *obd)
 struct inode;
 struct lu_attr;
 struct obdo;
-void obdo_from_la(struct obdo *dst, struct lu_attr *la, __u64 valid);
-void la_from_obdo(struct lu_attr *la, struct obdo *dst, u32 valid);
 void obdo_refresh_inode(struct inode *dst, struct obdo *src, u32 valid);
-void obdo_to_inode(struct inode *dst, struct obdo *src, u32 valid);
 
-void obdo_cpy_md(struct obdo *dst, struct obdo *src, u32 valid);
 void obdo_to_ioobj(struct obdo *oa, struct obd_ioobj *ioobj);
-void obdo_from_iattr(struct obdo *oa, struct iattr *attr,
-		     unsigned int ia_valid);
 void iattr_from_obdo(struct iattr *attr, struct obdo *oa, u32 valid);
 void md_from_obdo(struct md_op_data *op_data, struct obdo *oa, u32 valid);
-void obdo_from_md(struct obdo *oa, struct md_op_data *op_data,
-		  unsigned int valid);
-
-void obdo_cpu_to_le(struct obdo *dobdo, struct obdo *sobdo);
-void obdo_le_to_cpu(struct obdo *dobdo, struct obdo *sobdo);
 
 #define OBT(dev)	(dev)->obd_type
 #define OBP(dev, op)    (dev)->obd_type->typ_dt_ops->o_ ## op
drivers/staging/lustre/lustre/obdclass/debug.c +0 -10
index c61add4..43a7f7a 100644
@@ -46,16 +46,6 @@
 #include "../include/lustre_debug.h"
 #include "../include/lustre_net.h"
 
-void dump_lniobuf(struct niobuf_local *nb)
-{
-	CDEBUG(D_RPCTRACE,
-	       "niobuf_local: file_offset=%lld, len=%d, page=%p, rc=%d\n",
-	       nb->lnb_file_offset, nb->len, nb->page, nb->rc);
-	CDEBUG(D_RPCTRACE, "nb->page: index = %ld\n",
-			nb->page ? page_index(nb->page) : -1);
-}
-EXPORT_SYMBOL(dump_lniobuf);
-
 #define LPDS sizeof(__u64)
 int block_debug_setup(void *addr, int len, __u64 off, __u64 id)
 {
drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c +0 -4
index 1515163..518288d 100644
@@ -162,7 +162,3 @@ int obd_sysctl_init(void)
 {
 	return sysfs_create_group(lustre_kobj, &lustre_attr_group);
 }
-
-void obd_sysctl_clean(void)
-{
-}
drivers/staging/lustre/lustre/obdclass/obd_config.c +0 -257

287 lines not on this page · raw message

drivers/staging/lustre/lustre/ptlrpc/layout.c +0 -64

76 lines not on this page · raw message

drivers/staging/lustre/lustre/ptlrpc/nrs.c +0 -123

147 lines not on this page · raw message

drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +0 -197

263 lines not on this page · raw message

drivers/staging/lustre/lustre/ptlrpc/pinger.c +0 -18
index 4706174..74fab7e 100644
@@ -44,20 +44,10 @@
 #include "../include/obd_class.h"
 #include "ptlrpc_internal.h"
 
-static int suppress_pings;
-module_param(suppress_pings, int, 0644);
-MODULE_PARM_DESC(suppress_pings, "Suppress pings");
-
 struct mutex pinger_mutex;
 static LIST_HEAD(pinger_imports);
 static struct list_head timeout_list = LIST_HEAD_INIT(timeout_list);
 
-int ptlrpc_pinger_suppress_pings(void)
-{
-	return suppress_pings;
-}
-EXPORT_SYMBOL(ptlrpc_pinger_suppress_pings);
-
 struct ptlrpc_request *
 ptlrpc_prep_ping(struct obd_import *imp)
 {
@@ -122,11 +112,6 @@ static void ptlrpc_update_next_ping(struct obd_import *imp, int soon)
 	imp->imp_next_ping = cfs_time_shift(time);
 }
 
-void ptlrpc_ping_import_soon(struct obd_import *imp)
-{
-	imp->imp_next_ping = cfs_time_current();
-}
-
 static inline int imp_is_deactive(struct obd_import *imp)
 {
 	return (imp->imp_deactive ||
@@ -325,9 +310,6 @@ int ptlrpc_start_pinger(void)
 	l_wait_event(pinger_thread.t_ctl_waitq,
 		     thread_is_running(&pinger_thread), &lwi);
 
-	if (suppress_pings)
-		CWARN("Pings will be suppressed at the request of the administrator.  The configuration shall meet the additional requirements described in the manual.  (Search for the \"suppress_pings\" kernel module parameter.)\n");
-
 	return 0;
 }
 
drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +0 -2
index a3608a9..ab6c458 100644
@@ -137,7 +137,6 @@ ptlrpc_nrs_req_get_nolock(struct ptlrpc_service_part *svcpt, bool hp,
 	return ptlrpc_nrs_req_get_nolock0(svcpt, hp, false, force);
 }
 
-void ptlrpc_nrs_req_del_nolock(struct ptlrpc_request *req);
 bool ptlrpc_nrs_req_pending_nolock(struct ptlrpc_service_part *svcpt, bool hp);
 
 int ptlrpc_nrs_policy_control(const struct ptlrpc_service *svc,
@@ -243,7 +242,6 @@ int ptlrpc_stop_pinger(void);
 void ptlrpc_pinger_sending_on_import(struct obd_import *imp);
 void ptlrpc_pinger_commit_expected(struct obd_import *imp);
 void ptlrpc_pinger_wake_up(void);
-void ptlrpc_ping_import_soon(struct obd_import *imp);
 
 /* sec_null.c */
 int  sptlrpc_null_init(void);
Signature · 1 line
2.1.0
#20 lore raw

PATCH 20/29 staging/lustre/fid: Remove server fid function declarations

In reply to [email protected]

From: Oleg Drokin <[email protected]>

Those functions are not present anywhere in the client code.

---
 drivers/staging/lustre/lustre/include/lustre_fid.h | 24 ----------------------
 1 file changed, 24 deletions(-)
drivers/staging/lustre/lustre/include/lustre_fid.h +0 -24
index abc9345..1b50e66 100644
@@ -425,30 +425,6 @@ struct lu_server_seq {
 	struct seq_server_site  *lss_site;
 };
 
-/* Server methods */
-
-int seq_server_init(struct lu_server_seq *seq,
-		    struct dt_device *dev,
-		    const char *prefix,
-		    enum lu_mgr_type type,
-		    struct seq_server_site *ss,
-		    const struct lu_env *env);
-
-void seq_server_fini(struct lu_server_seq *seq,
-		     const struct lu_env *env);
-
-int seq_server_alloc_super(struct lu_server_seq *seq,
-			   struct lu_seq_range *out,
-			   const struct lu_env *env);
-
-int seq_server_alloc_meta(struct lu_server_seq *seq,
-			  struct lu_seq_range *out,
-			  const struct lu_env *env);
-
-int seq_server_set_cli(struct lu_server_seq *seq,
-		       struct lu_client_seq *cli,
-		       const struct lu_env *env);
-
 /* Client methods */
 int seq_client_init(struct lu_client_seq *seq,
 		    struct obd_export *exp,
Signature · 1 line
2.1.0
#21 lore raw

PATCH 21/29 staging/lustre/fid: seq_client_init/fini don't need to be exported

In reply to [email protected]

From: Oleg Drokin <[email protected]>

In fact they could be static as they are only used inside this file, so remove EXPORT_SYMBOL and declarations. Also seq_client_init is always called with srv = NULL, so just drop this argument.

---
 drivers/staging/lustre/lustre/fid/fid_request.c    | 39 ++++++++++------------
 drivers/staging/lustre/lustre/include/lustre_fid.h |  8 -----
 2 files changed, 18 insertions(+), 29 deletions(-)
drivers/staging/lustre/lustre/fid/fid_request.c +18 -21
index a16d577..16264bc 100644
@@ -438,18 +438,29 @@ out_cleanup:
 	return rc;
 }
 
-int seq_client_init(struct lu_client_seq *seq,
-		    struct obd_export *exp,
-		    enum lu_cli_type type,
-		    const char *prefix,
-		    struct lu_server_seq *srv)
+static void seq_client_fini(struct lu_client_seq *seq)
+{
+	seq_client_debugfs_fini(seq);
+
+	if (seq->lcs_exp) {
+		class_export_put(seq->lcs_exp);
+		seq->lcs_exp = NULL;
+	}
+
+	seq->lcs_srv = NULL;
+}
+
+static int seq_client_init(struct lu_client_seq *seq,
+			   struct obd_export *exp,
+			   enum lu_cli_type type,
+			   const char *prefix)
 {
 	int rc;
 
 	LASSERT(seq != NULL);
 	LASSERT(prefix != NULL);
 
-	seq->lcs_srv = srv;
+	seq->lcs_srv = NULL;
 	seq->lcs_type = type;
 
 	mutex_init(&seq->lcs_mutex);
@@ -475,20 +486,6 @@ int seq_client_init(struct lu_client_seq *seq,
 		seq_client_fini(seq);
 	return rc;
 }
-EXPORT_SYMBOL(seq_client_init);
-
-void seq_client_fini(struct lu_client_seq *seq)
-{
-	seq_client_debugfs_fini(seq);
-
-	if (seq->lcs_exp != NULL) {
-		class_export_put(seq->lcs_exp);
-		seq->lcs_exp = NULL;
-	}
-
-	seq->lcs_srv = NULL;
-}
-EXPORT_SYMBOL(seq_client_fini);
 
 int client_fid_init(struct obd_device *obd,
 		    struct obd_export *exp, enum lu_cli_type type)
@@ -510,7 +507,7 @@ int client_fid_init(struct obd_device *obd,
 	snprintf(prefix, MAX_OBD_NAME + 5, "cli-%s", obd->obd_name);
 
 	/* Init client side sequence-manager */
-	rc = seq_client_init(cli->cl_seq, exp, type, prefix, NULL);
+	rc = seq_client_init(cli->cl_seq, exp, type, prefix);
 	kfree(prefix);
 	if (rc)
 		goto out_free_seq;
drivers/staging/lustre/lustre/include/lustre_fid.h +0 -8
index 1b50e66..f60c20a 100644
@@ -426,14 +426,6 @@ struct lu_server_seq {
 };
 
 /* Client methods */
-int seq_client_init(struct lu_client_seq *seq,
-		    struct obd_export *exp,
-		    enum lu_cli_type type,
-		    const char *prefix,
-		    struct lu_server_seq *srv);
-
-void seq_client_fini(struct lu_client_seq *seq);
-
 void seq_client_flush(struct lu_client_seq *seq);
 
 int seq_client_alloc_fid(const struct lu_env *env, struct lu_client_seq *seq,
Signature · 1 line
2.1.0
#22 lore raw

PATCH 22/29 staging/lustre/fid: Remove unused seq_client_get_seq function

In reply to [email protected]

From: Oleg Drokin <[email protected]>

Also while we are at it, remove seq_site_fini forward declaration as there's no such function anymore.

---
 drivers/staging/lustre/lustre/fid/fid_request.c    | 51 ----------------------
 drivers/staging/lustre/lustre/include/lustre_fid.h |  3 --
 2 files changed, 54 deletions(-)
drivers/staging/lustre/lustre/fid/fid_request.c +0 -51
index 16264bc..ce55340 100644
@@ -248,57 +248,6 @@ static void seq_fid_alloc_fini(struct lu_client_seq *seq)
 	wake_up(&seq->lcs_waitq);
 }
 
-/**
- * Allocate the whole seq to the caller.
- **/
-int seq_client_get_seq(const struct lu_env *env,
-		       struct lu_client_seq *seq, u64 *seqnr)
-{
-	wait_queue_t link;
-	int rc;
-
-	LASSERT(seqnr != NULL);
-	mutex_lock(&seq->lcs_mutex);
-	init_waitqueue_entry(&link, current);
-
-	while (1) {
-		rc = seq_fid_alloc_prep(seq, &link);
-		if (rc == 0)
-			break;
-	}
-
-	rc = seq_client_alloc_seq(env, seq, seqnr);
-	if (rc) {
-		CERROR("%s: Can't allocate new sequence, rc %d\n",
-		       seq->lcs_name, rc);
-		seq_fid_alloc_fini(seq);
-		mutex_unlock(&seq->lcs_mutex);
-		return rc;
-	}
-
-	CDEBUG(D_INFO, "%s: allocate sequence [0x%16.16Lx]\n",
-	       seq->lcs_name, *seqnr);
-
-	/* Since the caller require the whole seq,
-	 * so marked this seq to be used */
-	if (seq->lcs_type == LUSTRE_SEQ_METADATA)
-		seq->lcs_fid.f_oid = LUSTRE_METADATA_SEQ_MAX_WIDTH;
-	else
-		seq->lcs_fid.f_oid = LUSTRE_DATA_SEQ_MAX_WIDTH;
-
-	seq->lcs_fid.f_seq = *seqnr;
-	seq->lcs_fid.f_ver = 0;
-	/*
-	 * Inform caller that sequence switch is performed to allow it
-	 * to setup FLD for it.
-	 */
-	seq_fid_alloc_fini(seq);
-	mutex_unlock(&seq->lcs_mutex);
-
-	return rc;
-}
-EXPORT_SYMBOL(seq_client_get_seq);
-
 /* Allocate new fid on passed client @seq and save it to @fid. */
 int seq_client_alloc_fid(const struct lu_env *env,
 			 struct lu_client_seq *seq, struct lu_fid *fid)
drivers/staging/lustre/lustre/include/lustre_fid.h +0 -3
index f60c20a..22fc96e 100644
@@ -430,9 +430,6 @@ void seq_client_flush(struct lu_client_seq *seq);
 
 int seq_client_alloc_fid(const struct lu_env *env, struct lu_client_seq *seq,
 			 struct lu_fid *fid);
-int seq_client_get_seq(const struct lu_env *env, struct lu_client_seq *seq,
-		       u64 *seqnr);
-int seq_site_fini(const struct lu_env *env, struct seq_server_site *ss);
 /* Fids common stuff */
 int fid_is_local(const struct lu_env *env,
 		 struct lu_site *site, const struct lu_fid *fid);
Signature · 1 line
2.1.0
#23 lore raw

PATCH 23/29 staging/lustre/fid: Get rid of lcs_srv in lu_client_seq

In reply to [email protected]

From: Oleg Drokin <[email protected]>

Since we know lcs_srv is always NULL, just get rid of it completely and fix up all the code to assumee it was never there.

---
 drivers/staging/lustre/lustre/fid/fid_request.c    | 48 ++++++++--------------
 drivers/staging/lustre/lustre/fid/lproc_fid.c      |  2 -
 drivers/staging/lustre/lustre/include/lustre_fid.h |  5 ---
 3 files changed, 17 insertions(+), 38 deletions(-)
drivers/staging/lustre/lustre/fid/fid_request.c +17 -31
index ce55340..7c45e74 100644
@@ -150,19 +150,15 @@ int seq_client_alloc_super(struct lu_client_seq *seq,
 
 	mutex_lock(&seq->lcs_mutex);
 
-	if (seq->lcs_srv) {
-		rc = 0;
-	} else {
-		/* Check whether the connection to seq controller has been
-		 * setup (lcs_exp != NULL) */
-		if (seq->lcs_exp == NULL) {
-			mutex_unlock(&seq->lcs_mutex);
-			return -EINPROGRESS;
-		}
-
-		rc = seq_client_rpc(seq, &seq->lcs_space,
-				    SEQ_ALLOC_SUPER, "super");
+	/* Check whether the connection to seq controller has been
+	 * setup (lcs_exp != NULL) */
+	if (!seq->lcs_exp) {
+		mutex_unlock(&seq->lcs_mutex);
+		return -EINPROGRESS;
 	}
+
+	rc = seq_client_rpc(seq, &seq->lcs_space,
+			    SEQ_ALLOC_SUPER, "super");
 	mutex_unlock(&seq->lcs_mutex);
 	return rc;
 }
@@ -173,18 +169,14 @@ static int seq_client_alloc_meta(const struct lu_env *env,
 {
 	int rc;
 
-	if (seq->lcs_srv) {
-		rc = 0;
-	} else {
-		do {
-			/* If meta server return -EINPROGRESS or EAGAIN,
-			 * it means meta server might not be ready to
-			 * allocate super sequence from sequence controller
-			 * (MDT0)yet */
-			rc = seq_client_rpc(seq, &seq->lcs_space,
-					    SEQ_ALLOC_META, "meta");
-		} while (rc == -EINPROGRESS || rc == -EAGAIN);
-	}
+	do {
+		/* If meta server return -EINPROGRESS or EAGAIN,
+		 * it means meta server might not be ready to
+		 * allocate super sequence from sequence controller
+		 * (MDT0)yet */
+		rc = seq_client_rpc(seq, &seq->lcs_space,
+				    SEQ_ALLOC_META, "meta");
+	} while (rc == -EINPROGRESS || rc == -EAGAIN);
 
 	return rc;
 }
@@ -395,8 +387,6 @@ static void seq_client_fini(struct lu_client_seq *seq)
 		class_export_put(seq->lcs_exp);
 		seq->lcs_exp = NULL;
 	}
-
-	seq->lcs_srv = NULL;
 }
 
 static int seq_client_init(struct lu_client_seq *seq,
@@ -409,7 +399,6 @@ static int seq_client_init(struct lu_client_seq *seq,
 	LASSERT(seq != NULL);
 	LASSERT(prefix != NULL);
 
-	seq->lcs_srv = NULL;
 	seq->lcs_type = type;
 
 	mutex_init(&seq->lcs_mutex);
@@ -422,10 +411,7 @@ static int seq_client_init(struct lu_client_seq *seq,
 	/* Make sure that things are clear before work is started. */
 	seq_client_flush(seq);
 
-	if (exp != NULL)
-		seq->lcs_exp = class_export_get(exp);
-	else if (type == LUSTRE_SEQ_METADATA)
-		LASSERT(seq->lcs_srv != NULL);
+	seq->lcs_exp = class_export_get(exp);
 
 	snprintf(seq->lcs_name, sizeof(seq->lcs_name),
 		 "cli-%s", prefix);
drivers/staging/lustre/lustre/fid/lproc_fid.c +0 -2
index bf12723..ce90c1c 100644
@@ -204,8 +204,6 @@ ldebugfs_fid_server_seq_show(struct seq_file *m, void *unused)
 	if (seq->lcs_exp != NULL) {
 		cli = &seq->lcs_exp->exp_obd->u.cli;
 		seq_printf(m, "%s\n", cli->cl_target_uuid.uuid);
-	} else {
-		seq_printf(m, "%s\n", seq->lcs_srv->lss_name);
 	}
 
 	return 0;
drivers/staging/lustre/lustre/include/lustre_fid.h +0 -5
index 22fc96e..bbe3ff8 100644
@@ -330,8 +330,6 @@ enum lu_mgr_type {
 	LUSTRE_SEQ_CONTROLLER
 };
 
-struct lu_server_seq;
-
 /* Client sequence manager interface. */
 struct lu_client_seq {
 	/* Sequence-controller export. */
@@ -366,9 +364,6 @@ struct lu_client_seq {
 	 */
 	__u64		   lcs_width;
 
-	/* Seq-server for direct talking */
-	struct lu_server_seq   *lcs_srv;
-
 	/* wait queue for fid allocation and update indicator */
 	wait_queue_head_t	     lcs_waitq;
 	int		     lcs_update;
Signature · 1 line
2.1.0
#24 lore raw

PATCH 24/29 staging/lustre/fid: Remove unused struct lu_server_seq

In reply to [email protected]

From: Oleg Drokin <[email protected]>

---
 drivers/staging/lustre/lustre/include/lustre_fid.h | 51 ----------------------
 1 file changed, 51 deletions(-)
drivers/staging/lustre/lustre/include/lustre_fid.h +0 -51
index bbe3ff8..19d9175 100644
@@ -369,57 +369,6 @@ struct lu_client_seq {
 	int		     lcs_update;
 };
 
-/* server sequence manager interface */
-struct lu_server_seq {
-	/* Available sequences space */
-	struct lu_seq_range	 lss_space;
-
-	/* keeps highwater in lsr_end for seq allocation algorithm */
-	struct lu_seq_range	 lss_lowater_set;
-	struct lu_seq_range	 lss_hiwater_set;
-
-	/*
-	 * Device for server side seq manager needs (saving sequences to backing
-	 * store).
-	 */
-	struct dt_device       *lss_dev;
-
-	/* LUSTRE_SEQ_SERVER or LUSTRE_SEQ_CONTROLLER */
-	enum lu_mgr_type       lss_type;
-
-	/* Client interface to request controller */
-	struct lu_client_seq   *lss_cli;
-
-	/* Mutex for protecting allocation */
-	struct mutex		lss_mutex;
-
-	/*
-	 * Service uuid, passed from MDT + seq name to form unique seq name to
-	 * use it with procfs.
-	 */
-	char		    lss_name[LUSTRE_MDT_MAXNAMELEN];
-
-	/*
-	 * Allocation chunks for super and meta sequences. Default values are
-	 * LUSTRE_SEQ_SUPER_WIDTH and LUSTRE_SEQ_META_WIDTH.
-	 */
-	__u64		   lss_width;
-
-	/*
-	 * minimum lss_alloc_set size that should be allocated from
-	 * lss_space
-	 */
-	__u64		   lss_set_width;
-
-	/* sync is needed for update operation */
-	__u32		   lss_need_sync;
-
-	/**
-	 * Pointer to site object, required to access site fld.
-	 */
-	struct seq_server_site  *lss_site;
-};
-
 /* Client methods */
 void seq_client_flush(struct lu_client_seq *seq);
 
Signature · 1 line
2.1.0
#25 lore raw

PATCH 25/29 staging/lustre/obdclass: Remove unused nid_hash

In reply to [email protected]

From: Oleg Drokin <[email protected]>

nid_hash is used on export to faster find clients based on their NID. There's no use for that on the client.

---
 .../staging/lustre/lustre/include/lustre_export.h  |  1 -
 drivers/staging/lustre/lustre/include/obd.h        |  2 -
 drivers/staging/lustre/lustre/obdclass/genops.c    | 10 +--
 .../staging/lustre/lustre/obdclass/obd_config.c    | 95 ----------------------
 4 files changed, 1 insertion(+), 107 deletions(-)
drivers/staging/lustre/lustre/include/lustre_export.h +0 -1
index 7634dea..5b8f4e8 100644
@@ -147,7 +147,6 @@ struct obd_export {
 	/** To link all exports on an obd device */
 	struct list_head		exp_obd_chain;
 	struct hlist_node	  exp_uuid_hash; /** uuid-export hash*/
-	struct hlist_node	  exp_nid_hash; /** nid-export hash */
 	/** Obd device of this export */
 	struct obd_device	*exp_obd;
 	/**
drivers/staging/lustre/lustre/include/obd.h +0 -2
index e8317b8..3fb72dc 100644
@@ -746,8 +746,6 @@ struct obd_device {
 	unsigned long obd_recovery_expired:1;
 	/* uuid-export hash body */
 	struct cfs_hash	     *obd_uuid_hash;
-	/* nid-export hash body */
-	struct cfs_hash	     *obd_nid_hash;
 	atomic_t	    obd_refcount;
 	wait_queue_head_t	     obd_refcount_waitq;
 	struct list_head	      obd_exports;
drivers/staging/lustre/lustre/obdclass/genops.c +1 -9
index 4467baa..681312e 100644
@@ -757,7 +757,6 @@ struct obd_export *class_new_export(struct obd_device *obd,
 	spin_lock_init(&export->exp_lock);
 	spin_lock_init(&export->exp_rpc_lock);
 	INIT_HLIST_NODE(&export->exp_uuid_hash);
-	INIT_HLIST_NODE(&export->exp_nid_hash);
 	spin_lock_init(&export->exp_bl_list_lock);
 	INIT_LIST_HEAD(&export->exp_bl_list);
 
@@ -1103,19 +1102,12 @@ int class_disconnect(struct obd_export *export)
 	/* class_cleanup(), abort_recovery(), and class_fail_export()
 	 * all end up in here, and if any of them race we shouldn't
 	 * call extra class_export_puts(). */
-	if (already_disconnected) {
-		LASSERT(hlist_unhashed(&export->exp_nid_hash));
+	if (already_disconnected)
 		goto no_disconn;
-	}
 
 	CDEBUG(D_IOCTL, "disconnect: cookie %#llx\n",
 	       export->exp_handle.h_cookie);
 
-	if (!hlist_unhashed(&export->exp_nid_hash))
-		cfs_hash_del(export->exp_obd->obd_nid_hash,
-			     &export->exp_connection->c_peer.nid,
-			     &export->exp_nid_hash);
-
 	class_export_recovery_cleanup(export);
 	class_unlink_export(export);
 no_disconn:
drivers/staging/lustre/lustre/obdclass/obd_config.c +0 -95

128 lines not on this page · raw message

Signature · 1 line
2.1.0
#26 lore raw

PATCH 26/29 staging/lustre: Remove server-only recovery-related bits

In reply to [email protected]

From: Oleg Drokin <[email protected]>

This patch is a first stab at trying to remove structure fields from obd_export and obd structures that are only used on the server or make sense on the server. These include tracking requests in recovery, various recovery stages, lists of recovered and not yet recovered clients and so on. Also prune functions that use these fields.

---
 .../staging/lustre/lustre/include/lustre_export.h  | 17 +-----
 drivers/staging/lustre/lustre/include/obd.h        | 27 ---------
 drivers/staging/lustre/lustre/include/obd_class.h  |  1 -
 drivers/staging/lustre/lustre/obdclass/genops.c    | 50 +----------------
 .../staging/lustre/lustre/obdclass/obd_config.c    |  6 --
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c      |  3 +-
 drivers/staging/lustre/lustre/ptlrpc/service.c     | 64 ++++++++--------------
 7 files changed, 28 insertions(+), 140 deletions(-)
drivers/staging/lustre/lustre/include/lustre_export.h +1 -16
index 5b8f4e8..1daf4c5 100644
@@ -183,25 +183,10 @@ struct obd_export {
 	struct obd_connect_data   exp_connect_data;
 	enum obd_option	   exp_flags;
 	unsigned long	     exp_failed:1,
-				  exp_in_recovery:1,
 				  exp_disconnected:1,
 				  exp_connecting:1,
-				  /** VBR: export missed recovery */
-				  exp_delayed:1,
-				  /** VBR: failed version checking */
-				  exp_vbr_failed:1,
-				  exp_req_replay_needed:1,
-				  exp_lock_replay_needed:1,
-				  exp_need_sync:1,
 				  exp_flvr_changed:1,
-				  exp_flvr_adapt:1,
-				  exp_libclient:1, /* liblustre client? */
-				  /* client timed out and tried to reconnect,
-				   * but couldn't because of active rpcs */
-				  exp_abort_active_req:1,
-				  /* if to swap nidtbl entries for 2.2 clients.
-				   * Only used by the MGS to fix LU-1644. */
-				  exp_need_mne_swab:1;
+				  exp_flvr_adapt:1;
 	/* also protected by exp_lock */
 	enum lustre_sec_part      exp_sp_peer;
 	struct sptlrpc_flavor     exp_flvr;	     /* current */
drivers/staging/lustre/lustre/include/obd.h +0 -27
index 3fb72dc..314f5c7 100644
@@ -725,8 +725,6 @@ struct obd_device {
 	/* bitfield modification is protected by obd_dev_lock */
 	unsigned long obd_attached:1,      /* finished attach */
 		      obd_set_up:1,	/* finished setup */
-		      obd_recovering:1,    /* there are recoverable clients */
-		      obd_abort_recovery:1,/* recovery expired */
 		      obd_version_recov:1, /* obd uses version checking */
 		      obd_replayable:1,    /* recovery is enabled; inform clients */
 		      obd_no_transno:1,    /* no committed-transno notification */
@@ -769,31 +767,6 @@ struct obd_device {
 	struct obd_notify_upcall obd_upcall;
 	struct obd_export       *obd_self_export;
 
-	int			      obd_max_recoverable_clients;
-	atomic_t		     obd_connected_clients;
-	int			      obd_stale_clients;
-	int			      obd_delayed_clients;
-	/* this lock protects all recovery list_heads, timer and
-	 * obd_next_recovery_transno value */
-	spinlock_t			 obd_recovery_task_lock;
-	__u64			    obd_next_recovery_transno;
-	int			      obd_replayed_requests;
-	int			      obd_requests_queued_for_recovery;
-	wait_queue_head_t		      obd_next_transno_waitq;
-	/* protected by obd_recovery_task_lock */
-	int			      obd_recovery_timeout;
-
-	/* new recovery stuff from CMD2 */
-	struct target_recovery_data      obd_recovery_data;
-	int			      obd_replayed_locks;
-	atomic_t		     obd_req_replay_clients;
-	atomic_t		     obd_lock_replay_clients;
-	/* all lists are protected by obd_recovery_task_lock */
-	struct list_head		       obd_req_replay_queue;
-	struct list_head		       obd_lock_replay_queue;
-	struct list_head		       obd_final_req_queue;
-	int			      obd_recovery_stage;
-
 	union {
 		struct client_obd cli;
 		struct echo_client_obd echo_client;
drivers/staging/lustre/lustre/include/obd_class.h +0 -1
index 73fb29f..6fb67a6 100644
@@ -273,7 +273,6 @@ static inline enum obd_option exp_flags_from_obd(struct obd_device *obd)
 {
 	return ((obd->obd_fail ? OBD_OPT_FAILOVER : 0) |
 		(obd->obd_force ? OBD_OPT_FORCE : 0) |
-		(obd->obd_abort_recovery ? OBD_OPT_ABORT_RECOV : 0) |
 		0);
 }
 
drivers/staging/lustre/lustre/obdclass/genops.c +2 -48

73 lines not on this page · raw message

drivers/staging/lustre/lustre/obdclass/obd_config.c +0 -6
index 48c712e..66fafd3 100644
@@ -237,13 +237,7 @@ int class_attach(struct lustre_cfg *lcfg)
 	/* XXX belongs in setup not attach  */
 	init_rwsem(&obd->obd_observer_link_sem);
 	/* recovery data */
-	spin_lock_init(&obd->obd_recovery_task_lock);
-	init_waitqueue_head(&obd->obd_next_transno_waitq);
 	init_waitqueue_head(&obd->obd_evict_inprogress_waitq);
-	INIT_LIST_HEAD(&obd->obd_req_replay_queue);
-	INIT_LIST_HEAD(&obd->obd_lock_replay_queue);
-	INIT_LIST_HEAD(&obd->obd_final_req_queue);
-	INIT_LIST_HEAD(&obd->obd_evict_list);
 
 	llog_group_init(&obd->obd_olg, FID_SEQ_LLOG);
 
drivers/staging/lustre/lustre/ptlrpc/niobuf.c +1 -2
index 8db62d0..13632cd 100644
@@ -328,8 +328,7 @@ static void ptlrpc_at_set_reply(struct ptlrpc_request *req, int flags)
 	/* Report service time estimate for future client reqs, but report 0
 	 * (to be ignored by client) if it's a error reply during recovery.
 	 * (bz15815) */
-	if (req->rq_type == PTL_RPC_MSG_ERR &&
-	    (req->rq_export == NULL || req->rq_export->exp_obd->obd_recovering))
+	if (req->rq_type == PTL_RPC_MSG_ERR && !req->rq_export)
 		lustre_msg_set_timeout(req->rq_repmsg, 0);
 	else
 		lustre_msg_set_timeout(req->rq_repmsg,
drivers/staging/lustre/lustre/ptlrpc/service.c +24 -40

76 lines not on this page · raw message

Signature · 1 line
2.1.0
#27 lore raw

PATCH 27/29 staging/lustre: Remove ccc_attr/conf_set()

In reply to [email protected]

From: Oleg Drokin <[email protected]>

These seem to be unused.

---
 drivers/staging/lustre/lustre/include/lclient.h    |  4 ----
 drivers/staging/lustre/lustre/lclient/lcommon_cl.c | 15 ---------------
 2 files changed, 19 deletions(-)
drivers/staging/lustre/lustre/include/lclient.h +0 -4
index 67d41bb..d09d005 100644
@@ -289,12 +289,8 @@ void ccc_object_free(const struct lu_env *env, struct lu_object *obj);
 int ccc_lock_init(const struct lu_env *env, struct cl_object *obj,
 		  struct cl_lock *lock, const struct cl_io *io,
 		  const struct cl_lock_operations *lkops);
-int ccc_attr_set(const struct lu_env *env, struct cl_object *obj,
-		 const struct cl_attr *attr, unsigned valid);
 int ccc_object_glimpse(const struct lu_env *env,
 		       const struct cl_object *obj, struct ost_lvb *lvb);
-int ccc_conf_set(const struct lu_env *env, struct cl_object *obj,
-		 const struct cl_object_conf *conf);
 struct page *ccc_page_vmpage(const struct lu_env *env,
 			    const struct cl_page_slice *slice);
 int ccc_page_is_under_lock(const struct lu_env *env,
drivers/staging/lustre/lustre/lclient/lcommon_cl.c +0 -15
index f049d55..98a2e0e 100644
@@ -406,12 +406,6 @@ int ccc_lock_init(const struct lu_env *env,
 	return result;
 }
 
-int ccc_attr_set(const struct lu_env *env, struct cl_object *obj,
-		 const struct cl_attr *attr, unsigned valid)
-{
-	return 0;
-}
-
 int ccc_object_glimpse(const struct lu_env *env,
 		       const struct cl_object *obj, struct ost_lvb *lvb)
 {
@@ -430,15 +424,6 @@ int ccc_object_glimpse(const struct lu_env *env,
 	return 0;
 }
 
-
-
-int ccc_conf_set(const struct lu_env *env, struct cl_object *obj,
-			const struct cl_object_conf *conf)
-{
-	/* TODO: destroy all pages attached to this object. */
-	return 0;
-}
-
 static void ccc_object_size_lock(struct cl_object *obj)
 {
 	struct inode *inode = ccc_object_inode(obj);
Signature · 1 line
2.1.0
#28 lore raw

PATCH 28/29 staging/lustre: Remove unused ccc_io_fini()

In reply to [email protected]

From: Oleg Drokin <[email protected]>

Does not appear to be used anywhere.

---
 drivers/staging/lustre/lustre/include/lclient.h    | 1 -
 drivers/staging/lustre/lustre/lclient/lcommon_cl.c | 7 -------
 2 files changed, 8 deletions(-)
drivers/staging/lustre/lustre/include/lclient.h +0 -1
index d09d005..823be81 100644
@@ -332,7 +332,6 @@ void ccc_lock_state(const struct lu_env *env,
 		    const struct cl_lock_slice *slice,
 		    enum cl_lock_state state);
 
-void ccc_io_fini(const struct lu_env *env, const struct cl_io_slice *ios);
 int ccc_io_one_lock_index(const struct lu_env *env, struct cl_io *io,
 			  __u32 enqflags, enum cl_lock_mode mode,
 			  pgoff_t start, pgoff_t end);
drivers/staging/lustre/lustre/lclient/lcommon_cl.c +0 -7
index 98a2e0e..eb43174 100644
@@ -675,13 +675,6 @@ void ccc_lock_state(const struct lu_env *env,
  *
  */
 
-void ccc_io_fini(const struct lu_env *env, const struct cl_io_slice *ios)
-{
-	struct cl_io *io = ios->cis_io;
-
-	CLOBINVRNT(env, io->ci_obj, ccc_object_invariant(io->ci_obj));
-}
-
 int ccc_io_one_lock_index(const struct lu_env *env, struct cl_io *io,
 			  __u32 enqflags, enum cl_lock_mode mode,
 			  pgoff_t start, pgoff_t end)
Signature · 1 line
2.1.0
#29 lore raw

PATCH 29/29 staging/lustre: Remove ccc_transient_page_* methods

In reply to [email protected]

From: Oleg Drokin <[email protected]>

All of them but the ccc_transient_page_prep are unused, so remove the unused ones.

---
 drivers/staging/lustre/lustre/include/lclient.h    | 19 ---------
 drivers/staging/lustre/lustre/lclient/lcommon_cl.c | 48 ----------------------
 2 files changed, 67 deletions(-)
drivers/staging/lustre/lustre/include/lclient.h +0 -19
index 823be81..be5499c 100644
@@ -233,8 +233,6 @@ static inline struct ccc_page *cl2ccc_page(const struct cl_page_slice *slice)
 	return container_of(slice, struct ccc_page, cpg_cl);
 }
 
-struct cl_page    *ccc_vmpage_page_transient(struct page *vmpage);
-
 struct ccc_device {
 	struct cl_device    cdv_cl;
 	struct super_block *cdv_sb;
@@ -296,22 +294,6 @@ struct page *ccc_page_vmpage(const struct lu_env *env,
 int ccc_page_is_under_lock(const struct lu_env *env,
 			   const struct cl_page_slice *slice, struct cl_io *io);
 int ccc_fail(const struct lu_env *env, const struct cl_page_slice *slice);
-void ccc_transient_page_verify(const struct cl_page *page);
-int  ccc_transient_page_own(const struct lu_env *env,
-			    const struct cl_page_slice *slice,
-			    struct cl_io *io, int nonblock);
-void ccc_transient_page_assume(const struct lu_env *env,
-			       const struct cl_page_slice *slice,
-			       struct cl_io *io);
-void ccc_transient_page_unassume(const struct lu_env *env,
-				 const struct cl_page_slice *slice,
-				 struct cl_io *io);
-void ccc_transient_page_disown(const struct lu_env *env,
-			       const struct cl_page_slice *slice,
-			       struct cl_io *io);
-void ccc_transient_page_discard(const struct lu_env *env,
-				const struct cl_page_slice *slice,
-				struct cl_io *io);
 int ccc_transient_page_prep(const struct lu_env *env,
 			    const struct cl_page_slice *slice,
 			    struct cl_io *io);
@@ -368,7 +350,6 @@ struct ccc_object  *cl_inode2ccc    (struct inode *inode);
 
 int cl_setattr_ost(struct inode *inode, const struct iattr *attr);
 
-struct cl_page *ccc_vmpage_page_transient(struct page *vmpage);
 int ccc_object_invariant(const struct cl_object *obj);
 int cl_file_inode_init(struct inode *inode, struct lustre_md *md);
 void cl_inode_fini(struct inode *inode);
drivers/staging/lustre/lustre/lclient/lcommon_cl.c +0 -48

54 lines not on this page · raw message

Signature · 1 line
2.1.0