From 4afdbf9dfd3b33510bf9f1d8a74c8655de5b086e Mon Sep 17 00:00:00 2001 From: Artem Blagodarenko Date: Fri, 4 Dec 2020 20:40:52 -0500 Subject: [PATCH] LU-14188 osd: remove not used iam_container lock There is an rw_semaphore struct iam_container { ... /* * read-write lock protecting index consistency. */ struct rw_semaphore ic_sem; <<<<<< struct dynlock ic_tree_lock; /* Protect ic_idle_bh */ struct mutex ic_idle_mutex; ... }; There is initialization 2 234 lustre/osd-ldiskfs/osd_iam.c <> init_rwsem(&c->ic_sem); There are wrappers 3 622 lustre/osd-ldiskfs/osd_iam.c <> down_write(&ic->ic_sem); 4 627 lustre/osd-ldiskfs/osd_iam.c <> up_write(&ic->ic_sem); 5 632 lustre/osd-ldiskfs/osd_iam.c <> down_read(&ic->ic_sem); 6 637 lustre/osd-ldiskfs/osd_iam.c <> up_read(&ic->ic_sem); But this wrappers are not used. And, based on the git history, never been used. Let's delete this useless code. Change-Id: Ied1122f034e53fee08888e1091f700bda4507f00 Signed-off-by: Artem Blagodarenko HPE-bug-id: LUS-9545 Reviewed-on: https://review.whamcloud.com/40890 Reviewed-by: Neil Brown Reviewed-by: Alex Zhuravlev Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/osd-ldiskfs/osd_iam.c | 21 --------------------- lustre/osd-ldiskfs/osd_iam.h | 10 ---------- 2 files changed, 31 deletions(-) diff --git a/lustre/osd-ldiskfs/osd_iam.c b/lustre/osd-ldiskfs/osd_iam.c index c8a06d8..5f690e0 100644 --- a/lustre/osd-ldiskfs/osd_iam.c +++ b/lustre/osd-ldiskfs/osd_iam.c @@ -230,7 +230,6 @@ int iam_container_init(struct iam_container *c, memset(c, 0, sizeof *c); c->ic_descr = descr; c->ic_object = inode; - init_rwsem(&c->ic_sem); dynlock_init(&c->ic_tree_lock); mutex_init(&c->ic_idle_mutex); return 0; @@ -616,26 +615,6 @@ static int iam_it_get_exact(struct iam_iterator *it, const struct iam_key *k) return result; } -void iam_container_write_lock(struct iam_container *ic) -{ - down_write(&ic->ic_sem); -} - -void iam_container_write_unlock(struct iam_container *ic) -{ - up_write(&ic->ic_sem); -} - -void iam_container_read_lock(struct iam_container *ic) -{ - down_read(&ic->ic_sem); -} - -void iam_container_read_unlock(struct iam_container *ic) -{ - up_read(&ic->ic_sem); -} - /* * Initialize iterator to IAM_IT_DETACHED state. * diff --git a/lustre/osd-ldiskfs/osd_iam.h b/lustre/osd-ldiskfs/osd_iam.h index 9565219..7b66e6f 100644 --- a/lustre/osd-ldiskfs/osd_iam.h +++ b/lustre/osd-ldiskfs/osd_iam.h @@ -472,10 +472,6 @@ struct iam_container { * container flavor. */ struct iam_descr *ic_descr; - /* - * read-write lock protecting index consistency. - */ - struct rw_semaphore ic_sem; struct dynlock ic_tree_lock; /* Protect ic_idle_bh */ struct mutex ic_idle_mutex; @@ -989,12 +985,6 @@ void dx_unlock_htree(struct inode *dir, struct dynlock_handle *lh); /* * external */ -void iam_container_write_lock(struct iam_container *c); -void iam_container_write_unlock(struct iam_container *c); - -void iam_container_read_lock(struct iam_container *c); -void iam_container_read_unlock(struct iam_container *c); - int iam_index_next(struct iam_container *c, struct iam_path *p); int iam_read_leaf(struct iam_path *p); -- 1.8.3.1