lustre: lov: Drop lov_lock_handles structure
authorJulia Lawall <Julia.Lawall@lip6.fr>
Mon, 8 Jun 2015 12:53:18 +0000 (14:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Jun 2015 19:39:48 +0000 (12:39 -0700)
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: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/lov/lov_internal.h
drivers/staging/lustre/lustre/lov/lov_request.c

index 5e8bcc6ba01a3fe709e1858eaccc234e886255d3..f52a90c8caf7ba74d1630ea8b11a04d2c8f8c4e2 100644 (file)
 })
 #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)
 
index f6e13149d2ad3778f9d79fea0bf49f0d677a772c..7769f149af928b3777481ac806edb5885a3f74db 100644 (file)
@@ -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);
 }