From 5b483d4983790014f8d30de7cb95fa91a8d99d39 Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Sat, 15 Mar 2025 01:14:44 -0400 Subject: [PATCH] LU-16518 osc: remove osc_lock_at(), osc_is_object(), and more These functions no longer have any callers. Fixes: 036d987c6d71 ("LU-3285 osc: prepare OSC code to be used from MDC") Fixes: 5ad00e36eca1 ("LU-14838 osc: Remove client contention support") Fixes: 9fe4b52ad2ff ("LU-1030 osc: new IO engine implementation") Test-Parameters: trivial Signed-off-by: Timothy Day Change-Id: I3273031227b894f751584241a6fc6f04dcd915af Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58413 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Patrick Farrell Reviewed-by: Mikhail Pershin Reviewed-by: Oleg Drokin --- lustre/include/lustre_osc.h | 23 +---------------------- lustre/osc/osc_internal.h | 10 ---------- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/lustre/include/lustre_osc.h b/lustre/include/lustre_osc.h index 1e32634..fd4aaa2 100644 --- a/lustre/include/lustre_osc.h +++ b/lustre/include/lustre_osc.h @@ -235,11 +235,7 @@ struct osc_object_operations { struct osc_object { struct cl_object oo_cl; struct lov_oinfo *oo_oinfo; - /** - * True if locking against this stripe got -EUSERS. - */ - int oo_contended; - ktime_t oo_contention_time; + #ifdef CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK /** * IO context used for invariant checks in osc_lock_has_pages(). @@ -316,11 +312,6 @@ static inline void osc_object_lock(struct osc_object *obj) spin_lock(&obj->oo_lock); } -static inline int osc_object_trylock(struct osc_object *obj) -{ - return spin_trylock(&obj->oo_lock); -} - static inline void osc_object_unlock(struct osc_object *obj) { spin_unlock(&obj->oo_lock); @@ -329,18 +320,6 @@ static inline void osc_object_unlock(struct osc_object *obj) #define assert_osc_object_is_locked(obj) \ assert_spin_locked(&obj->oo_lock) -static inline void osc_object_set_contended(struct osc_object *obj) -{ - obj->oo_contention_time = ktime_get(); - /* mb(); */ - obj->oo_contended = 1; -} - -static inline void osc_object_clear_contended(struct osc_object *obj) -{ - obj->oo_contended = 0; -} - /* * Lock "micro-states" for osc layer. */ diff --git a/lustre/osc/osc_internal.h b/lustre/osc/osc_internal.h index 30c60c9..0380c43 100644 --- a/lustre/osc/osc_internal.h +++ b/lustre/osc/osc_internal.h @@ -91,16 +91,6 @@ static inline struct cl_io *osc_env_new_io(const struct lu_env *env) return io; } -static inline int osc_is_object(const struct lu_object *obj) -{ - return obj->lo_dev->ld_type == &osc_device_type; -} - -static inline struct osc_lock *osc_lock_at(const struct cl_lock *lock) -{ - return cl2osc_lock(cl_lock_at(lock, &osc_device_type)); -} - int osc_lock_init(const struct lu_env *env, struct cl_object *obj, struct cl_lock *lock, const struct cl_io *io); int osc_io_init(const struct lu_env *env, struct cl_object *obj, -- 1.8.3.1