[PATCH 5/7] staging/lustre: remove unused lvfs code

From: John L. Hammond
Date: Tue Sep 09 2014 - 14:40:48 EST


From: "John L. Hammond" <john.hammond@xxxxxxxxx>

Remove the unused "lvfs" functions obd_lvfs_fid2dentry(),
ll_lookup_one_len(), l_dput(), lustre_rename(), push_ctxt(), and
pop_ctxt(). Remove the unused members of struct lvfs_run_ctxt.

Signed-off-by: John L. Hammond <john.hammond@xxxxxxxxx>
---
drivers/staging/lustre/lustre/include/linux/lvfs.h | 78 --------------------
drivers/staging/lustre/lustre/include/lvfs.h | 8 --
drivers/staging/lustre/lustre/include/obd_class.h | 10 ---
3 files changed, 96 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/linux/lvfs.h b/drivers/staging/lustre/lustre/include/linux/lvfs.h
index ddeb7de..786e779 100644
--- a/drivers/staging/lustre/lustre/include/linux/lvfs.h
+++ b/drivers/staging/lustre/lustre/include/linux/lvfs.h
@@ -50,86 +50,8 @@
#include <linux/sched.h>
#include "lustre_compat25.h"

-#define LLOG_LVFS
-
-/* simple.c */
-
-struct lvfs_ucred {
- kuid_t luc_uid;
- kgid_t luc_gid;
- kuid_t luc_fsuid;
- kgid_t luc_fsgid;
- kernel_cap_t luc_cap;
- __u32 luc_umask;
- struct group_info *luc_ginfo;
- struct md_identity *luc_identity;
-};
-
-struct lvfs_callback_ops {
- struct dentry *(*l_fid2dentry)(__u64 id_ino, __u32 gen, __u64 gr, void *data);
-};
-
-#define OBD_RUN_CTXT_MAGIC 0xC0FFEEAA
-#define OBD_CTXT_DEBUG /* development-only debugging */
struct lvfs_run_ctxt {
- struct vfsmount *pwdmnt;
- struct dentry *pwd;
- mm_segment_t fs;
- struct lvfs_ucred luc;
- int ngroups;
- struct lvfs_callback_ops cb_ops;
- struct group_info *group_info;
struct dt_device *dt;
-#ifdef OBD_CTXT_DEBUG
- __u32 magic;
-#endif
};

-#ifdef OBD_CTXT_DEBUG
-#define OBD_SET_CTXT_MAGIC(ctxt) (ctxt)->magic = OBD_RUN_CTXT_MAGIC
-#else
-#define OBD_SET_CTXT_MAGIC(ctxt) do {} while (0)
-#endif
-
-
-int lustre_rename(struct dentry *dir, struct vfsmount *mnt, char *oldname,
- char *newname);
-
-static inline void l_dput(struct dentry *de)
-{
- if (!de || IS_ERR(de))
- return;
- //shrink_dcache_parent(de);
- LASSERT(d_count(de) > 0);
- dput(de);
-}
-
-/* We need to hold the inode semaphore over the dcache lookup itself, or we
- * run the risk of entering the filesystem lookup path concurrently on SMP
- * systems, and instantiating two inodes for the same entry. We still
- * protect against concurrent addition/removal races with the DLM locking.
- */
-static inline struct dentry *ll_lookup_one_len(const char *fid_name,
- struct dentry *dparent,
- int fid_namelen)
-{
- struct dentry *dchild;
-
- mutex_lock(&dparent->d_inode->i_mutex);
- dchild = lookup_one_len(fid_name, dparent, fid_namelen);
- mutex_unlock(&dparent->d_inode->i_mutex);
-
- if (IS_ERR(dchild) || dchild->d_inode == NULL)
- return dchild;
-
- if (is_bad_inode(dchild->d_inode)) {
- CERROR("bad inode returned %lu/%u\n",
- dchild->d_inode->i_ino, dchild->d_inode->i_generation);
- dput(dchild);
- dchild = ERR_PTR(-ENOENT);
- }
- return dchild;
-}
-
-
#endif
diff --git a/drivers/staging/lustre/lustre/include/lvfs.h b/drivers/staging/lustre/lustre/include/lvfs.h
index f91907c..83bbce5 100644
--- a/drivers/staging/lustre/lustre/include/lvfs.h
+++ b/drivers/staging/lustre/lustre/include/lvfs.h
@@ -39,17 +39,9 @@
#ifndef __LVFS_H__
#define __LVFS_H__

-#define LL_FID_NAMELEN (16 + 1 + 8 + 1)
-
#include "../../include/linux/libcfs/libcfs.h"
#include "linux/lvfs.h"

#include "../../include/linux/libcfs/lucache.h"

-
-/* lvfs_linux.c */
-void push_ctxt(struct lvfs_run_ctxt *save, struct lvfs_run_ctxt *new_ctx,
- struct lvfs_ucred *cred);
-void pop_ctxt(struct lvfs_run_ctxt *saved, struct lvfs_run_ctxt *new_ctx,
- struct lvfs_ucred *cred);
#endif
diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h
index 9030171..882e40b 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -1090,16 +1090,6 @@ static inline int obd_destroy_export(struct obd_export *exp)
return 0;
}

-static inline struct dentry *
-obd_lvfs_fid2dentry(struct obd_export *exp, struct ost_id *oi, __u32 gen)
-{
- struct lvfs_run_ctxt *ctxt = &exp->exp_obd->obd_lvfs_ctxt;
- LASSERT(exp->exp_obd);
-
- return ctxt->cb_ops.l_fid2dentry(ostid_id(oi), gen, ostid_seq(oi),
- exp->exp_obd);
-}
-
/* @max_age is the oldest time in jiffies that we accept using a cached data.
* If the cache is older than @max_age we will get a new value from the
* target. Use a value of "cfs_time_current() + HZ" to guarantee freshness. */
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/