])
])
-# 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
#
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
# 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)
{
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)
#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
{
char *path = NULL;
-#ifdef HAVE_FS_STRUCT_USE_PATH
struct path p;
p.dentry = dentry;
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;
}
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;
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);
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);