Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8fd18211 authored by Julia Lawall's avatar Julia Lawall Committed by Greg Kroah-Hartman
Browse files

lustre: lov: Drop lov_lock_handles structure



The lov_lock_handles structure is only used as the type of the field
set_lockh in the lov_request_set structure, and this field is never set to
any value.  Drop a test and free of this field in lov_finish_set.  This
change enables also removing the functions lov_handle2llh and lov_llh_put
that manipulate values of type lov_lock_handles, but are now never called.

Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1c01737a
Loading
Loading
Loading
Loading
+0 −34
Original line number Diff line number Diff line
@@ -71,13 +71,6 @@
})
#endif

struct lov_lock_handles {
	struct portals_handle   llh_handle;
	atomic_t	    llh_refcount;
	int		     llh_stripe_count;
	struct lustre_handle    llh_handles[0];
};

struct lov_request {
	struct obd_info	  rq_oi;
	struct lov_request_set  *rq_rqset;
@@ -111,7 +104,6 @@ struct lov_request_set {
	struct obd_trans_info		*set_oti;
	u32				set_oabufs;
	struct brw_page			*set_pga;
	struct lov_lock_handles		*set_lockh;
	struct list_head			set_list;
	wait_queue_head_t			set_waitq;
	spinlock_t			set_lock;
@@ -136,32 +128,6 @@ static inline void lov_put_reqset(struct lov_request_set *set)
		lov_finish_set(set);
}

static inline struct lov_lock_handles *
lov_handle2llh(struct lustre_handle *handle)
{
	LASSERT(handle != NULL);
	return class_handle2object(handle->cookie);
}

static inline void lov_llh_put(struct lov_lock_handles *llh)
{
	CDEBUG(D_INFO, "PUTting llh %p : new refcount %d\n", llh,
	       atomic_read(&llh->llh_refcount) - 1);
	LASSERT(atomic_read(&llh->llh_refcount) > 0 &&
		atomic_read(&llh->llh_refcount) < 0x5a5a);
	if (atomic_dec_and_test(&llh->llh_refcount)) {
		class_handle_unhash(&llh->llh_handle);
		/* The structure may be held by other threads because RCU.
		 *   -jxiong */
		if (atomic_read(&llh->llh_refcount))
			return;

		OBD_FREE_RCU(llh, sizeof(*llh) +
			     sizeof(*llh->llh_handles) * llh->llh_stripe_count,
			     &llh->llh_handle);
	}
}

#define lov_uuid2str(lv, index) \
	(char *)((lv)->lov_tgts[index]->ltd_uuid.uuid)

+0 −3
Original line number Diff line number Diff line
@@ -78,9 +78,6 @@ void lov_finish_set(struct lov_request_set *set)
		int len = set->set_oabufs * sizeof(*set->set_pga);
		OBD_FREE_LARGE(set->set_pga, len);
	}
	if (set->set_lockh)
		lov_llh_put(set->set_lockh);

	kfree(set);
}