From 4907f7c13c47f2bb8e5ae21f33f6a87b0c96fe86 Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Tue, 2 Jul 2024 23:06:12 +0000 Subject: [PATCH] LU-17848 osd: remove osd_invalidate() for ldiskfs/ZFS This is implemented as a stub function that returns 0. Remove the implementations from the OSD and add a check into dt_invalidate(). Test-Parameters: trivial Test-Parameters: trivial fstype=zfs Signed-off-by: Timothy Day Change-Id: Ieee086218dc83c3129bc572689a14c79c981bcb7 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55607 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- lustre/include/dt_object.h | 4 +++- lustre/osd-ldiskfs/osd_handler.c | 6 ------ lustre/osd-zfs/osd_object.c | 6 ------ 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/lustre/include/dt_object.h b/lustre/include/dt_object.h index b969bbb..33891e1 100644 --- a/lustre/include/dt_object.h +++ b/lustre/include/dt_object.h @@ -2845,7 +2845,9 @@ static inline int dt_invalidate(const struct lu_env *env, struct dt_object *dt) { LASSERT(dt); LASSERT(dt->do_ops); - LASSERT(dt->do_ops->do_invalidate); + + if (!dt->do_ops->do_invalidate) + return 0; return dt->do_ops->do_invalidate(env, dt); } diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 3812399..c2f9a7d 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -5301,11 +5301,6 @@ static int osd_object_sync(const struct lu_env *env, struct dt_object *dt, RETURN(rc); } -static int osd_invalidate(const struct lu_env *env, struct dt_object *dt) -{ - return 0; -} - /* * Index operations. */ @@ -5493,7 +5488,6 @@ static const struct dt_object_operations osd_obj_ops = { .do_xattr_del = osd_xattr_del, .do_xattr_list = osd_xattr_list, .do_object_sync = osd_object_sync, - .do_invalidate = osd_invalidate, }; static const struct dt_object_operations osd_obj_otable_it_ops = { diff --git a/lustre/osd-zfs/osd_object.c b/lustre/osd-zfs/osd_object.c index 8491981..a09e785 100644 --- a/lustre/osd-zfs/osd_object.c +++ b/lustre/osd-zfs/osd_object.c @@ -2178,11 +2178,6 @@ static int osd_object_sync(const struct lu_env *env, struct dt_object *dt, RETURN(0); } -static int osd_invalidate(const struct lu_env *env, struct dt_object *dt) -{ - return 0; -} - static const struct dt_object_operations osd_obj_ops = { .do_read_lock = osd_read_lock, .do_write_lock = osd_write_lock, @@ -2209,7 +2204,6 @@ static const struct dt_object_operations osd_obj_ops = { .do_xattr_del = osd_xattr_del, .do_xattr_list = osd_xattr_list, .do_object_sync = osd_object_sync, - .do_invalidate = osd_invalidate, }; static const struct lu_object_operations osd_lu_obj_ops = { -- 1.8.3.1