*/
reval_dentry:
if (!d_deleted(dentry) &&
- !__unionfs_d_revalidate(dentry, parent, NULL, willwrite)) {
+ !__unionfs_d_revalidate(dentry, parent, willwrite)) {
err = -ESTALE;
goto out;
}
}
/* XXX: should I change 'false' below to the 'willwrite' flag? */
- valid = __unionfs_d_revalidate(dentry, parent, NULL, false);
+ valid = __unionfs_d_revalidate(dentry, parent, false);
if (unlikely(!valid)) {
err = -ESTALE;
goto out_nofree;
* Returns true if valid, false otherwise.
*/
static bool __unionfs_d_revalidate_one(struct dentry *dentry,
- struct dentry *parent,
- struct nameidata *nd)
+ struct dentry *parent)
{
bool valid = true; /* default is valid */
struct dentry *lower_dentry;
int sbgen, dgen;
int positive = 0;
int interpose_flag;
- struct nameidata lowernd; /* TODO: be gentler to the stack */
-
- if (nd)
- memcpy(&lowernd, nd, sizeof(struct nameidata));
- else
- memset(&lowernd, 0, sizeof(struct nameidata));
sbgen = atomic_read(&UNIONFS_SB(dentry->d_sb)->generation);
/* if the dentry is unhashed, do NOT revalidate */
goto out;
}
- result = unionfs_lookup_full(dentry, parent,
- &lowernd, interpose_flag);
+ result = unionfs_lookup_full(dentry, parent, interpose_flag);
if (result) {
if (IS_ERR(result)) {
valid = false;
* dentry). Returns true if valid, false otherwise.
*/
bool __unionfs_d_revalidate(struct dentry *dentry, struct dentry *parent,
- struct nameidata *nd, bool willwrite)
+ bool willwrite)
{
bool valid = false; /* default is invalid */
int sbgen, dgen;
if (!willwrite)
purge_inode_data(dentry->d_inode);
}
- valid = __unionfs_d_revalidate_one(dentry, parent, nd);
+ valid = __unionfs_d_revalidate_one(dentry, parent);
out:
return valid;
}
-static int unionfs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
+static int unionfs_d_revalidate(struct dentry *dentry,
+ struct nameidata *nd_unused)
{
bool valid = true;
int err = 1; /* 1 means valid for the VFS */
goto out;
}
}
- valid = __unionfs_d_revalidate(dentry, parent, nd, false);
+ valid = __unionfs_d_revalidate(dentry, parent, false);
if (likely(valid)) {
unionfs_postcopyup_setmnt(dentry);
unionfs_check_dentry(dentry);
- unionfs_check_nd(nd);
}
out:
}
static int unionfs_create(struct inode *dir, struct dentry *dentry,
- int mode, struct nameidata *nd)
+ int mode, struct nameidata *nd_unused)
{
int err = 0;
struct dentry *lower_dentry = NULL;
parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
- valid = __unionfs_d_revalidate(dentry, parent, nd, false);
+ valid = __unionfs_d_revalidate(dentry, parent, false);
if (unlikely(!valid)) {
err = -ESTALE; /* same as what real_lookup does */
goto out;
unionfs_postcopyup_setmnt(dentry);
unionfs_check_inode(dir);
unionfs_check_dentry(dentry);
- unionfs_check_nd(nd);
}
unionfs_unlock_dentry(dentry);
unionfs_unlock_parent(dentry, parent);
*/
static struct dentry *unionfs_lookup(struct inode *dir,
struct dentry *dentry,
- struct nameidata *nd)
+ struct nameidata *nd_unused)
{
- struct path path_save = {NULL, NULL};
struct dentry *ret, *parent;
int err = 0;
bool valid;
goto out;
}
- /* save the dentry & vfsmnt from namei */
- if (nd) {
- path_save.dentry = nd->path.dentry;
- path_save.mnt = nd->path.mnt;
- }
-
/*
* unionfs_lookup_full returns a locked dentry upon success,
* so we'll have to unlock it below.
goto out;
}
- ret = unionfs_lookup_full(dentry, parent, nd, INTERPOSE_LOOKUP);
+ ret = unionfs_lookup_full(dentry, parent, INTERPOSE_LOOKUP);
- /* restore the dentry & vfsmnt in namei */
- if (nd) {
- nd->path.dentry = path_save.dentry;
- nd->path.mnt = path_save.mnt;
- }
if (!IS_ERR(ret)) {
if (ret)
dentry = ret;
}
unionfs_check_inode(dir);
- if (!IS_ERR(ret)) {
+ if (!IS_ERR(ret))
unionfs_check_dentry(dentry);
- unionfs_check_nd(nd);
- }
unionfs_check_dentry(parent);
unionfs_unlock_dentry(dentry); /* locked in new_dentry_private data */
unionfs_double_lock_parents(old_parent, new_parent);
unionfs_double_lock_dentry(old_dentry, new_dentry);
- valid = __unionfs_d_revalidate(old_dentry, old_parent, NULL, false);
+ valid = __unionfs_d_revalidate(old_dentry, old_parent, false);
if (unlikely(!valid)) {
err = -ESTALE;
goto out;
}
if (new_dentry->d_inode) {
- valid = __unionfs_d_revalidate(new_dentry, new_parent,
- NULL, false);
+ valid = __unionfs_d_revalidate(new_dentry, new_parent, false);
if (unlikely(!valid)) {
err = -ESTALE;
goto out;
parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
- valid = __unionfs_d_revalidate(dentry, parent, NULL, false);
+ valid = __unionfs_d_revalidate(dentry, parent, false);
if (unlikely(!valid)) {
err = -ESTALE;
goto out;
parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
- valid = __unionfs_d_revalidate(dentry, parent, NULL, false);
+ valid = __unionfs_d_revalidate(dentry, parent, false);
if (unlikely(!valid)) {
err = -ESTALE; /* same as what real_lookup does */
goto out;
parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
- valid = __unionfs_d_revalidate(dentry, parent, NULL, false);
+ valid = __unionfs_d_revalidate(dentry, parent, false);
if (unlikely(!valid)) {
err = -ESTALE;
goto out;
parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
- if (unlikely(!__unionfs_d_revalidate(dentry, parent, NULL, false))) {
+ if (unlikely(!__unionfs_d_revalidate(dentry, parent, false))) {
err = -ESTALE;
goto out;
}
return ERR_PTR(err);
}
+/* this @nd *IS* still used */
static void unionfs_put_link(struct dentry *dentry, struct nameidata *nd,
void *cookie)
{
parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
- if (unlikely(!__unionfs_d_revalidate(dentry, parent, nd, false)))
+ if (unlikely(!__unionfs_d_revalidate(dentry, parent, false)))
printk(KERN_ERR
"unionfs: put_link failed to revalidate dentry\n");
parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
- if (unlikely(!__unionfs_d_revalidate(dentry, parent, NULL, false))) {
+ if (unlikely(!__unionfs_d_revalidate(dentry, parent, false))) {
err = -ESTALE;
goto out;
}
int unionfs_partial_lookup(struct dentry *dentry, struct dentry *parent)
{
struct dentry *tmp;
- struct nameidata nd = { .flags = 0 };
int err = -ENOSYS;
- tmp = unionfs_lookup_full(dentry, parent, &nd, INTERPOSE_PARTIAL);
+ tmp = unionfs_lookup_full(dentry, parent, INTERPOSE_PARTIAL);
if (!tmp) {
err = 0;
* dentry's info, which the caller must unlock.
*/
struct dentry *unionfs_lookup_full(struct dentry *dentry,
- struct dentry *parent,
- struct nameidata *nd_unused, int lookupmode)
+ struct dentry *parent, int lookupmode)
{
int err = 0;
struct dentry *lower_dentry = NULL;
unionfs_lock_dentry(new_parent, UNIONFS_DMUTEX_REVAL_CHILD);
unionfs_double_lock_dentry(old_dentry, new_dentry);
- valid = __unionfs_d_revalidate(old_dentry, old_parent, NULL, false);
+ valid = __unionfs_d_revalidate(old_dentry, old_parent, false);
if (!valid) {
err = -ESTALE;
goto out;
}
if (!d_deleted(new_dentry) && new_dentry->d_inode) {
- valid = __unionfs_d_revalidate(new_dentry, new_parent,
- NULL, false);
+ valid = __unionfs_d_revalidate(new_dentry, new_parent, false);
if (!valid) {
err = -ESTALE;
goto out;
parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
- valid = __unionfs_d_revalidate(dentry, parent, NULL, false);
+ valid = __unionfs_d_revalidate(dentry, parent, false);
if (unlikely(!valid)) {
err = -ESTALE;
goto out;
struct dentry *parent);
extern struct dentry *unionfs_lookup_full(struct dentry *dentry,
struct dentry *parent,
- struct nameidata *nd_unused,
int lookupmode);
/* copies a file from dbstart to newbindex branch */
extern int unionfs_rmdir(struct inode *dir, struct dentry *dentry);
extern bool __unionfs_d_revalidate(struct dentry *dentry,
- struct dentry *parent,
- struct nameidata *nd,
- bool willwrite);
+ struct dentry *parent, bool willwrite);
extern bool is_negative_lower(const struct dentry *dentry);
extern bool is_newer_lower(const struct dentry *dentry);
extern void purge_sb_data(struct super_block *sb);
parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
- valid = __unionfs_d_revalidate(dentry, parent, NULL, false);
+ valid = __unionfs_d_revalidate(dentry, parent, false);
if (unlikely(!valid)) {
err = -ESTALE;
goto out;
parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
- valid = __unionfs_d_revalidate(dentry, parent, NULL, false);
+ valid = __unionfs_d_revalidate(dentry, parent, false);
if (unlikely(!valid)) {
err = -ESTALE;
goto out;
parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
- valid = __unionfs_d_revalidate(dentry, parent, NULL, false);
+ valid = __unionfs_d_revalidate(dentry, parent, false);
if (unlikely(!valid)) {
err = -ESTALE;
goto out;
parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
- valid = __unionfs_d_revalidate(dentry, parent, NULL, false);
+ valid = __unionfs_d_revalidate(dentry, parent, false);
if (unlikely(!valid)) {
err = -ESTALE;
goto out;
parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
- valid = __unionfs_d_revalidate(dentry, parent, NULL, false);
+ valid = __unionfs_d_revalidate(dentry, parent, false);
if (unlikely(!valid)) {
err = -ESTALE;
goto out;
parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
- valid = __unionfs_d_revalidate(dentry, parent, NULL, false);
+ valid = __unionfs_d_revalidate(dentry, parent, false);
if (unlikely(!valid)) {
err = -ESTALE;
goto out;