Whamcloud - gitweb
LU-2800 autoconf: remove LC_FS_STRUCT_USE_PATH 59/5359/6
authorJames Simmons <uja.ornl@gmail.com>
Tue, 23 Jul 2013 13:45:27 +0000 (09:45 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 17 Aug 2013 07:06:30 +0000 (07:06 +0000)
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 <jeffm@suse.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I647eff05fa927e6d8b9865009a3e920c7971b7c5
Reviewed-on: http://review.whamcloud.com/5359
Tested-by: Hudson
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/autoconf/lustre-core.m4
lustre/include/linux/lustre_compat25.h
lustre/llite/llite_lib.c
lustre/lvfs/lvfs_linux.c
lustre/ptlrpc/sec_config.c

index 7737e0e..a073602 100644 (file)
@@ -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 <asm/atomic.h>
-        #include <linux/spinlock.h>
-        #include <linux/fs_struct.h>
-],[
-        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
index 4a02314..38cbedd 100644 (file)
@@ -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
index 43eb25a..8191558 100644 (file)
@@ -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;
 }
 
index 8252d53..50235b6 100644 (file)
@@ -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);
index e1c25d3..4685289 100644 (file)
@@ -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);