From f3fa8051dc74a775146b648e90cad74c26340866 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Tue, 23 Jul 2013 09:45:27 -0400 Subject: [PATCH] LU-2800 autoconf: remove LC_FS_STRUCT_USE_PATH struct fs_struct has been using struct path for working dirs since v2.6.26. We can remove the test and the dead code. Signed-off-by: Jeff Mahoney Signed-off-by: James Simmons Change-Id: I647eff05fa927e6d8b9865009a3e920c7971b7c5 Reviewed-on: http://review.whamcloud.com/5359 Tested-by: Hudson Reviewed-by: Bob Glossman Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/autoconf/lustre-core.m4 | 25 ------------------------- lustre/include/linux/lustre_compat25.h | 33 --------------------------------- lustre/llite/llite_lib.c | 5 ----- lustre/lvfs/lvfs_linux.c | 14 +++++++------- lustre/ptlrpc/sec_config.c | 2 +- 5 files changed, 8 insertions(+), 71 deletions(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 7737e0e..a073602 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -436,28 +436,6 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# 2.6.26 - -# 2.6.26 isn't export set_fs_pwd and change paramter in fs struct -AC_DEFUN([LC_FS_STRUCT_USE_PATH], -[AC_MSG_CHECKING([fs_struct use path structure]) -LB_LINUX_TRY_COMPILE([ - #include - #include - #include -],[ - struct fs_struct fs; - - fs.pwd = *((struct path *)sizeof(fs)); -], [ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1, - [fs_struct use path structure]) -],[ - AC_MSG_RESULT([no]) -]) -]) - # # 2.6.27 # @@ -1472,9 +1450,6 @@ AC_DEFUN([LC_PROG_LINUX], LC_BIO_ENDIO_2ARG LC_PROCFS_DELETED - # 2.6.26 - LC_FS_STRUCT_USE_PATH - # 2.6.27 LC_SECURITY_PLUG # for SLES10 SP2 LC_INODE_PERMISION_2ARGS diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index 4a02314..38cbedd 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -51,7 +51,6 @@ # define UNLOCK_FS_STRUCT(fs) spin_unlock(&(fs)->lock) #endif -#ifdef HAVE_FS_STRUCT_USE_PATH static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt, struct dentry *dentry) { @@ -70,28 +69,6 @@ static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt, path_put(&old_pwd); } -#else - -static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt, - struct dentry *dentry) -{ - struct dentry *old_pwd; - struct vfsmount *old_pwdmnt; - - LOCK_FS_STRUCT(fs); - old_pwd = fs->pwd; - old_pwdmnt = fs->pwdmnt; - fs->pwdmnt = mntget(mnt); - fs->pwd = dget(dentry); - UNLOCK_FS_STRUCT(fs); - - if (old_pwd) { - dput(old_pwd); - mntput(old_pwdmnt); - } -} -#endif - /* * set ATTR_BLOCKS to a high value to avoid any risk of collision with other * ATTR_* attributes (see bug 13828) @@ -293,16 +270,6 @@ unsigned int ll_crypto_tfm_alg_min_keysize(struct crypto_blkcipher *tfm) #define cfs_bio_endio(a,b,c) bio_endio((a),(b),(c)) #endif -#ifdef HAVE_FS_STRUCT_USE_PATH -#define cfs_fs_pwd(fs) ((fs)->pwd.dentry) -#define cfs_fs_mnt(fs) ((fs)->pwd.mnt) -#define cfs_path_put(nd) path_put(&(nd)->path) -#else -#define cfs_fs_pwd(fs) ((fs)->pwd) -#define cfs_fs_mnt(fs) ((fs)->pwdmnt) -#define cfs_path_put(nd) path_release(nd) -#endif - #ifndef HAVE_SIMPLE_SETATTR #define simple_setattr(dentry, ops) inode_setattr((dentry)->d_inode, ops) #endif diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 43eb25a..8191558 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -2457,7 +2457,6 @@ static char* ll_d_path(struct dentry *dentry, char *buf, int bufsize) { char *path = NULL; -#ifdef HAVE_FS_STRUCT_USE_PATH struct path p; p.dentry = dentry; @@ -2465,10 +2464,6 @@ static char* ll_d_path(struct dentry *dentry, char *buf, int bufsize) path_get(&p); path = d_path(&p, buf, bufsize); path_put(&p); -#else - path = d_path(dentry, current->fs->rootmnt, buf, bufsize); -#endif - return path; } diff --git a/lustre/lvfs/lvfs_linux.c b/lustre/lvfs/lvfs_linux.c index 8252d53..50235b6 100644 --- a/lustre/lvfs/lvfs_linux.c +++ b/lustre/lvfs/lvfs_linux.c @@ -120,10 +120,10 @@ void push_ctxt(struct lvfs_run_ctxt *save, struct lvfs_run_ctxt *new_ctx, OBD_SET_CTXT_MAGIC(save); save->fs = get_fs(); - LASSERT(d_refcount(cfs_fs_pwd(current->fs))); + LASSERT(d_refcount(current->fs->pwd.dentry)); LASSERT(d_refcount(new_ctx->pwd)); - save->pwd = dget(cfs_fs_pwd(current->fs)); - save->pwdmnt = mntget(cfs_fs_mnt(current->fs)); + save->pwd = dget(current->fs->pwd.dentry); + save->pwdmnt = mntget(current->fs->pwd.mnt); save->luc.luc_umask = cfs_curproc_umask(); save->ngroups = current_cred()->group_info->ngroups; @@ -170,10 +170,10 @@ void pop_ctxt(struct lvfs_run_ctxt *saved, struct lvfs_run_ctxt *new_ctx, ASSERT_CTXT_MAGIC(saved->magic); ASSERT_KERNEL_CTXT("popping non-kernel context!\n"); - LASSERTF(cfs_fs_pwd(current->fs) == new_ctx->pwd, "%p != %p\n", - cfs_fs_pwd(current->fs), new_ctx->pwd); - LASSERTF(cfs_fs_mnt(current->fs) == new_ctx->pwdmnt, "%p != %p\n", - cfs_fs_mnt(current->fs), new_ctx->pwdmnt); + LASSERTF(current->fs->pwd.dentry == new_ctx->pwd, "%p != %p\n", + current->fs->pwd.dentry, new_ctx->pwd); + LASSERTF(current->fs->pwd.mnt == new_ctx->pwdmnt, "%p != %p\n", + current->fs->pwd.mnt, new_ctx->pwdmnt); set_fs(saved->fs); ll_set_fs_pwd(current->fs, saved->pwdmnt, saved->pwd); diff --git a/lustre/ptlrpc/sec_config.c b/lustre/ptlrpc/sec_config.c index e1c25d3..4685289 100644 --- a/lustre/ptlrpc/sec_config.c +++ b/lustre/ptlrpc/sec_config.c @@ -1025,7 +1025,7 @@ int sptlrpc_target_local_copy_conf(struct obd_device *obd, push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); - dentry = ll_lookup_one_len(MOUNT_CONFIGS_DIR, cfs_fs_pwd(current->fs), + dentry = ll_lookup_one_len(MOUNT_CONFIGS_DIR, current->fs->pwd.dentry, strlen(MOUNT_CONFIGS_DIR)); if (IS_ERR(dentry)) { rc = PTR_ERR(dentry); -- 1.8.3.1