From b1cc1babe1a6cc148f00b02ba96051614f8a02f6 Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Tue, 14 May 2024 02:19:28 +0000 Subject: [PATCH] LU-17848 osd: purge key_rec() from dt API This is a pointless function pointer field that has spawned a number of pointless function implementations. Even the documentation has no idea why this exists. Remove everything to do with key_rec(). Signed-off-by: Timothy Day Change-Id: I7f84853a3fa285bf2ac53661b30384d099be1b91 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55099 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: James Simmons Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- Documentation/osd-api.txt | 3 --- lustre/include/dt_object.h | 7 ------- lustre/lfsck/lfsck_layout.c | 8 -------- lustre/lod/lod_object.c | 18 ------------------ lustre/osd-ldiskfs/osd_scrub.c | 7 ------- lustre/osd-zfs/osd_scrub.c | 7 ------- lustre/osp/osp_internal.h | 2 -- lustre/osp/osp_md_object.c | 1 - lustre/osp/osp_object.c | 7 ------- 9 files changed, 60 deletions(-) diff --git a/Documentation/osd-api.txt b/Documentation/osd-api.txt index 59eea26..2c004d4 100644 --- a/Documentation/osd-api.txt +++ b/Documentation/osd-api.txt @@ -929,7 +929,6 @@ int (*rec)(const struct lu_env *, const struct dt_it *, struct dt_rec *, __u32); __u64 (*store)(const struct lu_env *, const struct dt_it *); int (*load)(const struct lu_env *, const struct dt_it *, __u64); -int (*key_rec)(const struct lu_env *, const struct dt_it *, void *); init is called to allocate and initialize an instance of "iterator" which @@ -970,8 +969,6 @@ load cookie ->store() method returns. these two methods allow to implement functionality like POSIX readdir where current position is stored as an integer. -key_rec - is not used currently 3. Transactions =============== diff --git a/lustre/include/dt_object.h b/lustre/include/dt_object.h index 20f61ca..3b15bf3 100644 --- a/lustre/include/dt_object.h +++ b/lustre/include/dt_object.h @@ -1842,13 +1842,6 @@ struct dt_index_operations { int (*load)(const struct lu_env *env, const struct dt_it *di, __u64 hash); - - /** - * Not used - */ - int (*key_rec)(const struct lu_env *env, - const struct dt_it *di, - void *key_rec); } dio_it; }; diff --git a/lustre/lfsck/lfsck_layout.c b/lustre/lfsck/lfsck_layout.c index 29ca64f..af7409f 100644 --- a/lustre/lfsck/lfsck_layout.c +++ b/lustre/lfsck/lfsck_layout.c @@ -7770,13 +7770,6 @@ static int lfsck_orphan_it_load(const struct lu_env *env, return rc; } -static int lfsck_orphan_it_key_rec(const struct lu_env *env, - const struct dt_it *di, - void *key_rec) -{ - return 0; -} - static const struct dt_index_operations lfsck_orphan_index_ops = { .dio_lookup = lfsck_orphan_index_lookup, .dio_declare_insert = lfsck_orphan_index_declare_insert, @@ -7794,6 +7787,5 @@ static const struct dt_index_operations lfsck_orphan_index_ops = { .rec = lfsck_orphan_it_rec, .store = lfsck_orphan_it_store, .load = lfsck_orphan_it_load, - .key_rec = lfsck_orphan_it_key_rec, } }; diff --git a/lustre/lod/lod_object.c b/lustre/lod/lod_object.c index 03e9a92..1b5c88e 100644 --- a/lustre/lod/lod_object.c +++ b/lustre/lod/lod_object.c @@ -327,23 +327,6 @@ static int lod_it_load(const struct lu_env *env, const struct dt_it *di, return it->lit_obj->do_index_ops->dio_it.load(env, it->lit_it, hash); } -/** - * Implementation of dt_it_ops::key_rec. - * - * Used with regular (non-striped) objects. - * - * \see dt_it_ops::rec() in the API description for details. - */ -static int lod_it_key_rec(const struct lu_env *env, const struct dt_it *di, - void *key_rec) -{ - const struct lod_it *it = (const struct lod_it *)di; - - LOD_CHECK_IT(env, it); - return it->lit_obj->do_index_ops->dio_it.key_rec(env, it->lit_it, - key_rec); -} - static const struct dt_index_operations lod_index_ops = { .dio_lookup = lod_lookup, .dio_declare_insert = lod_declare_insert, @@ -362,7 +345,6 @@ static const struct dt_index_operations lod_index_ops = { .rec_size = lod_it_rec_size, .store = lod_it_store, .load = lod_it_load, - .key_rec = lod_it_key_rec, } }; diff --git a/lustre/osd-ldiskfs/osd_scrub.c b/lustre/osd-ldiskfs/osd_scrub.c index e68c738..47164f8 100644 --- a/lustre/osd-ldiskfs/osd_scrub.c +++ b/lustre/osd-ldiskfs/osd_scrub.c @@ -2962,12 +2962,6 @@ static int osd_otable_it_load(const struct lu_env *env, RETURN(rc); } -static int osd_otable_it_key_rec(const struct lu_env *env, - const struct dt_it *di, void *key_rec) -{ - return 0; -} - const struct dt_index_operations osd_otable_ops = { .dio_it = { .init = osd_otable_it_init, @@ -2980,7 +2974,6 @@ const struct dt_index_operations osd_otable_ops = { .rec = osd_otable_it_rec, .store = osd_otable_it_store, .load = osd_otable_it_load, - .key_rec = osd_otable_it_key_rec, } }; diff --git a/lustre/osd-zfs/osd_scrub.c b/lustre/osd-zfs/osd_scrub.c index b418397..bddf41c 100644 --- a/lustre/osd-zfs/osd_scrub.c +++ b/lustre/osd-zfs/osd_scrub.c @@ -1754,12 +1754,6 @@ static int osd_otable_it_load(const struct lu_env *env, RETURN(rc); } -static int osd_otable_it_key_rec(const struct lu_env *env, - const struct dt_it *di, void *key_rec) -{ - return 0; -} - const struct dt_index_operations osd_otable_ops = { .dio_it = { .init = osd_otable_it_init, @@ -1772,7 +1766,6 @@ const struct dt_index_operations osd_otable_ops = { .rec = osd_otable_it_rec, .store = osd_otable_it_store, .load = osd_otable_it_load, - .key_rec = osd_otable_it_key_rec, } }; diff --git a/lustre/osp/osp_internal.h b/lustre/osp/osp_internal.h index f0eb673..cb8a143 100644 --- a/lustre/osp/osp_internal.h +++ b/lustre/osp/osp_internal.h @@ -790,8 +790,6 @@ int osp_it_get(const struct lu_env *env, struct dt_it *di, const struct dt_key *key); void osp_it_put(const struct lu_env *env, struct dt_it *di); __u64 osp_it_store(const struct lu_env *env, const struct dt_it *di); -int osp_it_key_rec(const struct lu_env *env, const struct dt_it *di, - void *key_rec); int osp_it_next_page(const struct lu_env *env, struct dt_it *di); /* osp_md_object.c */ int osp_md_declare_create(const struct lu_env *env, struct dt_object *dt, diff --git a/lustre/osp/osp_md_object.c b/lustre/osp/osp_md_object.c index 089046e..5525b4e 100644 --- a/lustre/osp/osp_md_object.c +++ b/lustre/osp/osp_md_object.c @@ -831,7 +831,6 @@ const struct dt_index_operations osp_md_index_ops = { .rec = osp_md_index_it_rec, .store = osp_it_store, .load = osp_it_load, - .key_rec = osp_it_key_rec, } }; diff --git a/lustre/osp/osp_object.c b/lustre/osp/osp_object.c index 0baae90..ccf5875 100644 --- a/lustre/osp/osp_object.c +++ b/lustre/osp/osp_object.c @@ -2213,12 +2213,6 @@ static int osp_orphan_it_load(const struct lu_env *env, const struct dt_it *di, return rc; } -int osp_it_key_rec(const struct lu_env *env, const struct dt_it *di, - void *key_rec) -{ - return 0; -} - static const struct dt_index_operations osp_orphan_index_ops = { .dio_lookup = osp_orphan_index_lookup, .dio_declare_insert = osp_orphan_index_declare_insert, @@ -2236,7 +2230,6 @@ static const struct dt_index_operations osp_orphan_index_ops = { .rec = osp_orphan_it_rec, .store = osp_it_store, .load = osp_orphan_it_load, - .key_rec = osp_it_key_rec, } }; -- 1.8.3.1