Whamcloud - gitweb
LU-18753 obdclass: remove obsolete dt functions 27/58227/3
authorTimothy Day <timday@amazon.com>
Wed, 26 Feb 2025 05:37:57 +0000 (00:37 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 6 Mar 2025 08:10:52 +0000 (08:10 +0000)
Remove:

dt_path_parser()
dt_store_resolve()
dt_store_open()
dt_reg_open()
dt_find_entry()
typedef dt_entry_func_t

These are not called anywhere.

Fixes: 29e98f581ab6 ("LU-2886 obdclass: remove obsoleted md_local_file.c")
Fixes: 29adfde10ff2 ("LU-2886 mdd: create local files using local_storage lib")
Fixes: 90d8e7fd2874 ("Land b_head_interop_disk  on HEAD (20081119_1314)")
Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I5a79f665104c0526db1e328c0e682ce85b592028
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58227
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Aurelien Degremont <adegremont@nvidia.com>
Reviewed-by: Max Wang <wamax@amazon.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/dt_object.h
lustre/obdclass/dt_object.c

index 7414c0a..13262ef 100644 (file)
@@ -2069,28 +2069,6 @@ int dt_txn_hook_stop(const struct lu_env *env, struct thandle *txn);
 
 int dt_try_as_dir(const struct lu_env *env, struct dt_object *obj, bool check);
 
-/*
- * Callback function used for parsing path.
- * see llo_store_resolve
- */
-typedef int (*dt_entry_func_t)(const struct lu_env *env,
-                           const char *name,
-                           void *pvt);
-
-int dt_path_parser(const struct lu_env *env,
-                  char *local, dt_entry_func_t entry_func,
-                  void *data);
-
-struct dt_object *
-dt_store_resolve(const struct lu_env *env, struct dt_device *dt,
-                const char *path, struct lu_fid *fid);
-
-struct dt_object *dt_store_open(const struct lu_env *env,
-                               struct dt_device *dt,
-                               const char *dirname,
-                               const char *filename,
-                               struct lu_fid *fid);
-
 struct dt_object *dt_find_or_create(const struct lu_env *env,
                                    struct dt_device *dt,
                                    const struct lu_fid *fid,
index ae79fc4..c243456 100644 (file)
@@ -257,133 +257,6 @@ struct dt_object *dt_locate_at(const struct lu_env *env,
 }
 EXPORT_SYMBOL(dt_locate_at);
 
-/**
- * find an object named \a entry in given \a dfh->dfh_o directory.
- */
-static int dt_find_entry(const struct lu_env *env, const char *entry,
-                        void *data)
-{
-       struct dt_find_hint *dfh = data;
-       struct dt_device *dt = dfh->dfh_dt;
-       struct lu_fid *fid = dfh->dfh_fid;
-       struct dt_object *obj = dfh->dfh_o;
-       int rc;
-
-       rc = dt_lookup_dir(env, obj, entry, fid);
-       dt_object_put(env, obj);
-       if (rc == 0) {
-               obj = dt_locate(env, dt, fid);
-               if (IS_ERR(obj))
-                       rc = PTR_ERR(obj);
-       }
-       dfh->dfh_o = obj;
-
-       return rc;
-}
-
-/**
- * Abstract function which parses path name. This function feeds
- * path component to \a entry_func.
- */
-int dt_path_parser(const struct lu_env *env,
-                  char *path, dt_entry_func_t entry_func,
-                  void *data)
-{
-       char *e;
-       int rc = 0;
-
-       while (1) {
-               e = strsep(&path, "/");
-               if (e == NULL)
-                       break;
-
-               if (e[0] == 0) {
-                       if (!path || path[0] == '\0')
-                               break;
-                       continue;
-               }
-               rc = entry_func(env, e, data);
-               if (rc)
-                       break;
-       }
-
-       return rc;
-}
-
-struct dt_object *
-dt_store_resolve(const struct lu_env *env, struct dt_device *dt,
-                const char *path, struct lu_fid *fid)
-{
-       struct dt_thread_info *info = dt_info(env);
-       struct dt_find_hint *dfh = &info->dti_dfh;
-       struct dt_object *obj;
-       int result;
-
-
-       dfh->dfh_dt = dt;
-       dfh->dfh_fid = fid;
-
-       strscpy(info->dti_buf, path, sizeof(info->dti_buf));
-
-       result = dt->dd_ops->dt_root_get(env, dt, fid);
-       if (result == 0) {
-               obj = dt_locate(env, dt, fid);
-               if (!IS_ERR(obj)) {
-                       dfh->dfh_o = obj;
-                       result = dt_path_parser(env, info->dti_buf,
-                                               dt_find_entry, dfh);
-                       if (result != 0)
-                               obj = ERR_PTR(result);
-                       else
-                               obj = dfh->dfh_o;
-               }
-       } else {
-               obj = ERR_PTR(result);
-       }
-       return obj;
-}
-
-static struct dt_object *dt_reg_open(const struct lu_env *env,
-                                    struct dt_device *dt,
-                                    struct dt_object *p,
-                                    const char *name,
-                                    struct lu_fid *fid)
-{
-       struct dt_object *o;
-       int result;
-
-       result = dt_lookup_dir(env, p, name, fid);
-       if (result == 0)
-               o = dt_locate(env, dt, fid);
-       else
-               o = ERR_PTR(result);
-
-       return o;
-}
-
-/**
- * Open dt object named \a filename from \a dirname directory.
- *      \param  dt      dt device
- *      \param  fid     on success, object fid is stored in *fid
- */
-struct dt_object *dt_store_open(const struct lu_env *env, struct dt_device *dt,
-                               const char *dirname, const char *filename,
-                               struct lu_fid *fid)
-{
-       struct dt_object *file;
-       struct dt_object *dir;
-
-       dir = dt_store_resolve(env, dt, dirname, fid);
-       if (!IS_ERR(dir)) {
-               file = dt_reg_open(env, dt, dir, filename, fid);
-               dt_object_put(env, dir);
-       } else {
-               file = dir;
-       }
-
-       return file;
-}
-
 struct dt_object *dt_find_or_create(const struct lu_env *env,
                                    struct dt_device *dt,
                                    const struct lu_fid *fid,