URL: http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git
-COMMIT: c5021514085a5d96364e096dbd34cadb2251abfd
+COMMIT: 806051bcbeec27748aae2b7957726a4e63ff308e
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
ndentry = dpage->ndentry;
for (j = 0; !err && j < ndentry; j++) {
d = dpage->dentries[j];
- AuDebugOn(!atomic_read(&d->d_count));
+ AuDebugOn(!d->d_count);
if (!au_digen_test(d, sigen)) {
di_read_lock_child(d, AuLock_IR);
if (unlikely(au_dbrange_test(d))) {
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
}
/* d_count can be zero */
- dpage->dentries[dpage->ndentry++] = dget_locked(dentry);
+ dpage->dentries[dpage->ndentry++] = dget_dlock(dentry);
return 0; /* success */
out:
int au_dcsub_pages(struct au_dcsub_pages *dpages, struct dentry *root,
au_dpages_test test, void *arg)
{
- int err;
- struct dentry *this_parent = root;
+ int err, locked = 0;
+ unsigned int seq;
+ struct dentry *this_parent;
struct list_head *next;
struct super_block *sb = root->d_sb;
err = 0;
- spin_lock(&dcache_lock);
+ seq = read_seqbegin(&rename_lock);
+again:
+ this_parent = root;
+ spin_lock(&this_parent->d_lock);
repeat:
next = this_parent->d_subdirs.next;
resume:
struct list_head *tmp = next;
struct dentry *dentry = list_entry(tmp, struct dentry,
d_u.d_child);
+
next = tmp->next;
+ spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
if (!list_empty(&dentry->d_subdirs)) {
+ spin_unlock(&this_parent->d_lock);
+ spin_release(&dentry->d_lock.dep_map, 1, _RET_IP_);
this_parent = dentry;
+ spin_acquire(&this_parent->d_lock.dep_map, 0, 1,
+ _RET_IP_);
goto repeat;
}
if (dentry->d_sb == sb
&& au_di(dentry)
- && (!test || test(dentry, arg))) {
+ && (!test || test(dentry, arg)))
err = au_dpages_append(dpages, dentry, GFP_ATOMIC);
- if (unlikely(err))
- goto out;
- }
+ spin_unlock(&dentry->d_lock);
+ if (unlikely(err))
+ goto out;
}
if (this_parent != root) {
- next = this_parent->d_u.d_child.next;
- this_parent = this_parent->d_parent; /* dcache_lock is locked */
+ struct dentry *tmp;
+ struct dentry *child;
+
+ tmp = this_parent->d_parent;
+ rcu_read_lock();
+ spin_unlock(&this_parent->d_lock);
+ child = this_parent;
+ this_parent = tmp;
+ spin_lock(&this_parent->d_lock);
+ /* might go back up the wrong parent if we have had a rename
+ * or deletion */
+ if (this_parent != child->d_parent ||
+ (!locked && read_seqretry(&rename_lock, seq))) {
+ spin_unlock(&this_parent->d_lock);
+ rcu_read_unlock();
+ goto rename_retry;
+ }
+ rcu_read_unlock();
+ next = child->d_u.d_child.next;
goto resume;
}
+
out:
- spin_unlock(&dcache_lock);
+ spin_unlock(&this_parent->d_lock);
+ if (!locked) {
+ if (!err && read_seqretry(&rename_lock, seq))
+ goto rename_retry;
+ } else
+ write_sequnlock(&rename_lock);
return err;
+
+rename_retry:
+ locked = 1;
+ write_seqlock(&rename_lock);
+ goto again;
}
int au_dcsub_pages_rev(struct au_dcsub_pages *dpages, struct dentry *dentry,
int err;
err = 0;
- spin_lock(&dcache_lock);
+ write_seqlock(&rename_lock);
if (do_include && (!test || test(dentry, arg))) {
err = au_dpages_append(dpages, dentry, GFP_ATOMIC);
if (unlikely(err))
goto out;
}
+
+ /*
+ * vfsmount_lock is unnecessary since this is a traverse in a single
+ * mount
+ */
while (!IS_ROOT(dentry)) {
- dentry = dentry->d_parent; /* dcache_lock is locked */
+ dentry = dentry->d_parent; /* rename_lock is locked */
if (!test || test(dentry, arg)) {
err = au_dpages_append(dpages, dentry, GFP_ATOMIC);
if (unlikely(err))
}
out:
- spin_unlock(&dcache_lock);
-
+ write_sequnlock(&rename_lock);
return err;
}
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
return -1;
}
/* do not call dget_parent() here */
+ /* note: access d_xxx without d_lock */
dpri("d%d: %.*s?/%.*s, %s, cnt %d, flags 0x%x\n",
bindex,
AuDLNPair(dentry->d_parent), AuDLNPair(dentry),
dentry->d_sb ? au_sbtype(dentry->d_sb) : "??",
- atomic_read(&dentry->d_count), dentry->d_flags);
+ dentry->d_count, dentry->d_flags);
if (bindex >= 0 && dentry->d_inode && au_test_aufs(dentry->d_sb)) {
struct au_iinfo *iinfo = au_ii(dentry->d_inode);
if (iinfo)
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
int (*reval)(struct dentry *, struct nameidata *);
err = 0;
- reval = NULL;
- if (h_dentry->d_op)
- reval = h_dentry->d_op->d_revalidate;
- if (!reval)
+ if (!(h_dentry->d_flags & DCACHE_OP_REVALIDATE))
goto out;
+ reval = h_dentry->d_op->d_revalidate;
AuDbg("b%d\n", bindex);
if (au_test_fs_null_nd(h_dentry->d_sb))
continue;
AuDbg("b%d, %.*s\n", bindex, AuDLNPair(h_dentry));
+ /* spin_lock(&h_dentry->d_lock); */
h_name = &h_dentry->d_name;
if (unlikely(do_udba
&& !is_root
AuDbg("unhash 0x%x 0x%x, %.*s %.*s\n",
unhashed, d_unhashed(h_dentry),
AuDLNPair(dentry), AuDLNPair(h_dentry));
+ /* spin_unlock(&h_dentry->d_lock); */
goto err;
}
+ /* spin_unlock(&h_dentry->d_lock); */
err = au_do_h_d_reval(h_dentry, nd, dentry, bindex);
if (unlikely(err))
struct super_block *sb;
struct inode *inode;
+ /* todo: support rcu-walk? */
+ if (nd && (nd->flags & LOOKUP_RCU))
+ return -ECHILD;
+
valid = 0;
if (unlikely(!au_di(dentry)))
goto out;
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
if (dinfo) {
atomic_set(&dinfo->di_generation, au_sigen(sb));
/* smp_mb(); */ /* atomic_set */
- dentry->d_op = &aufs_dop;
+ d_set_d_op(dentry, &aufs_dop);
dentry->d_fsdata = dinfo;
} else
err = -ENOMEM;
return NULL;
AuDebugOn(bindex < 0);
d = au_di(dentry)->di_hdentry[0 + bindex].hd_dentry;
- AuDebugOn(d && (atomic_read(&d->d_count) <= 0));
+ AuDebugOn(d && d->d_count <= 0);
return d;
}
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2010 Junjiro R. Okajima
+ * Copyright (C) 2010-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
DySetAop(bmap);
DySetAop(invalidatepage);
DySetAop(releasepage);
+ DySetAop(freepage);
/* these two will be changed according to an aufs mount option */
DySetAop(direct_IO);
DySetAop(get_xip_mem);
/*
- * Copyright (C) 2010 Junjiro R. Okajima
+ * Copyright (C) 2010-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
static int au_test_anon(struct dentry *dentry)
{
+ /* note: read d_flags without d_lock */
return !!(dentry->d_flags & DCACHE_DISCONNECTED);
}
if (!dir_ino || S_ISDIR(inode->i_mode))
dentry = d_find_alias(inode);
else {
- spin_lock(&dcache_lock);
- list_for_each_entry(d, &inode->i_dentry, d_alias)
+ spin_lock(&inode->i_lock);
+ list_for_each_entry(d, &inode->i_dentry, d_alias) {
+ spin_lock(&d->d_lock);
if (!au_test_anon(d)
&& d->d_parent->d_inode->i_ino == dir_ino) {
- dentry = dget_locked(d);
+ dentry = dget_dlock(d);
+ spin_unlock(&d->d_lock);
break;
}
- spin_unlock(&dcache_lock);
+ spin_unlock(&d->d_lock);
+ }
+ spin_unlock(&inode->i_lock);
}
if (unlikely(dentry && au_digen_test(dentry, sigen))) {
dput(dentry);
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2010 Junjiro R. Okajima
+ * Copyright (C) 2010-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
if (!isdir) {
AuDebugOn(!name);
au_iigen_dec(inode);
- spin_lock(&dcache_lock);
+ spin_lock(&inode->i_lock);
list_for_each_entry(d, &inode->i_dentry, d_alias) {
+ spin_lock(&d->d_lock);
dname = &d->d_name;
if (dname->len != nlen
- && memcmp(dname->name, name, nlen))
+ && memcmp(dname->name, name, nlen)) {
+ spin_unlock(&d->d_lock);
continue;
+ }
err = 0;
au_digen_dec(d);
+ spin_unlock(&d->d_lock);
break;
}
- spin_unlock(&dcache_lock);
+ spin_unlock(&inode->i_lock);
} else {
au_fset_si(au_sbi(inode->i_sb), FAILED_REFRESH_DIR);
d = d_find_alias(inode);
goto out;
}
+ spin_lock(&d->d_lock);
dname = &d->d_name;
- if (dname->len == nlen && !memcmp(dname->name, name, nlen))
+ if (dname->len == nlen && !memcmp(dname->name, name, nlen)) {
+ spin_unlock(&d->d_lock);
err = hn_gen_tree(d);
+ spin_lock(&d->d_lock);
+ }
+ spin_unlock(&d->d_lock);
dput(d);
}
return NULL;
dentry = NULL;
- spin_lock(&dcache_lock);
+ spin_lock(&parent->d_lock);
list_for_each_entry(d, &parent->d_subdirs, d_u.d_child) {
/* AuDbg("%.*s\n", AuDLNPair(d)); */
+ spin_lock_nested(&d->d_lock, DENTRY_D_LOCK_NESTED);
dname = &d->d_name;
if (dname->len != nlen || memcmp(dname->name, name, nlen))
- continue;
+ goto cont_unlock;
if (au_di(d))
au_digen_dec(d);
else
- continue;
- if (!atomic_read(&d->d_count))
- continue;
+ goto cont_unlock;
+ if (d->d_count) {
+ dentry = dget_dlock(d);
+ spin_unlock(&d->d_lock);
+ break;
+ }
- dentry = dget(d);
- break;
+ cont_unlock:
+ spin_unlock(&d->d_lock);
}
- spin_unlock(&dcache_lock);
+ spin_unlock(&parent->d_lock);
dput(parent);
if (dentry)
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include <linux/uaccess.h>
#include "aufs.h"
-static int h_permission(struct inode *h_inode, int mask,
+static int h_permission(struct inode *h_inode, int mask, unsigned int flags,
struct vfsmount *h_mnt, int brperm)
{
int err;
&& write_mask && !(mask & MAY_READ))
|| !h_inode->i_op->permission) {
/* AuLabel(generic_permission); */
- err = generic_permission(h_inode, mask,
+ err = generic_permission(h_inode, mask, flags,
h_inode->i_op->check_acl);
} else {
/* AuLabel(h_inode->permission); */
- err = h_inode->i_op->permission(h_inode, mask);
+ err = h_inode->i_op->permission(h_inode, mask, flags);
AuTraceErr(err);
}
return err;
}
-static int aufs_permission(struct inode *inode, int mask)
+static int aufs_permission(struct inode *inode, int mask, unsigned int flags)
{
int err;
aufs_bindex_t bindex, bend;
struct super_block *sb;
struct au_branch *br;
+ /* todo: support rcu-walk? */
+ if (flags & IPERM_FLAG_RCU)
+ return -ECHILD;
+
sb = inode->i_sb;
si_read_lock(sb, AuLock_FLUSH);
ii_read_lock_child(inode);
err = 0;
bindex = au_ibstart(inode);
br = au_sbr(sb, bindex);
- err = h_permission(h_inode, mask, br->br_mnt, br->br_perm);
+ err = h_permission(h_inode, mask, flags, br->br_mnt,
+ br->br_perm);
if (write_mask
&& !err
&& !special_file(h_inode->i_mode)) {
break;
br = au_sbr(sb, bindex);
- err = h_permission(h_inode, mask, br->br_mnt,
+ err = h_permission(h_inode, mask, flags, br->br_mnt,
br->br_perm);
}
}
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
}
}
kfree(iinfo->ii_hinode);
+ iinfo->ii_hinode = NULL;
AuRwDestroy(&iinfo->ii_rwsem);
}
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2010 Junjiro R. Okajima
+ * Copyright (C) 2010-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
void au_plink_maint_leave(struct au_sbinfo *sbinfo)
{
- int iam;
-
spin_lock(&sbinfo->si_plink_maint_lock);
- iam = (sbinfo->si_plink_maint_pid == current->pid);
- if (iam)
- sbinfo->si_plink_maint_pid = 0;
+ sbinfo->si_plink_maint_pid = 0;
spin_unlock(&sbinfo->si_plink_maint_lock);
- if (iam)
- wake_up_all(&sbinfo->si_plink_wq);
+ wake_up_all(&sbinfo->si_plink_wq);
}
int au_plink_maint_enter(struct super_block *sb)
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2010 Junjiro R. Okajima
+ * Copyright (C) 2010-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
p = radix_tree_lookup(&au_sbi(sb)->au_si_pid.tree, current->pid);
rcu_read_unlock();
- return (long)p;
+ return (long)!!p;
}
void si_pid_set_slow(struct super_block *sb)
AuDebugOn(err);
spin_lock(&sbinfo->au_si_pid.tree_lock);
err = radix_tree_insert(&sbinfo->au_si_pid.tree, current->pid,
- (void *)1);
+ /*any valid ptr*/sb);
spin_unlock(&sbinfo->au_si_pid.tree_lock);
AuDebugOn(err);
radix_tree_preload_end();
spin_lock(&sbinfo->au_si_pid.tree_lock);
p = radix_tree_delete(&sbinfo->au_si_pid.tree, current->pid);
spin_unlock(&sbinfo->au_si_pid.tree_lock);
- AuDebugOn(1 != (long)p);
}
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
return NULL;
}
+static void aufs_destroy_inode_cb(struct rcu_head *head)
+{
+ struct inode *inode = container_of(head, struct inode, i_rcu);
+
+ INIT_LIST_HEAD(&inode->i_dentry);
+ au_cache_free_icntnr(container_of(inode, struct au_icntnr, vfs_inode));
+}
+
static void aufs_destroy_inode(struct inode *inode)
{
au_iinfo_fin(inode);
- au_cache_free_icntnr(container_of(inode, struct au_icntnr, vfs_inode));
+ call_rcu(&inode->i_rcu, aufs_destroy_inode_cb);
}
struct inode *au_iget_locked(struct super_block *sb, ino_t ino)
au_plink_put(sb, /*verbose*/1);
au_xino_clr(sb);
aufs_write_unlock(sb->s_root);
-
- au_plink_maint_leave(sbinfo);
au_nwt_flush(&sbinfo->si_nowait);
}
generic_shutdown_super(sb);
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
err = au_dpages_init(&dpages, GFP_ATOMIC);
if (unlikely(err))
break;
+ /* no way, it requires si write lock */
err = au_dcsub_pages(&dpages, sb->s_root, NULL, NULL);
if (!err)
for (i = 0; i < dpages.ndpage; i++) {
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
struct unlink_args *a = args;
struct dentry *d = a->path->dentry;
struct inode *h_inode;
- const int stop_sillyrename = (au_test_nfs(d->d_sb)
- && atomic_read(&d->d_count) == 1);
+ const int stop_sillyrename = au_test_nfs(d->d_sb);
IMustLock(a->dir);
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
{
struct dentry *dentry;
int i;
- char defname[NAME_MAX - AUFS_MAX_NAMELEN + DNAME_INLINE_LEN_MIN + 1],
+ char defname[NAME_MAX - AUFS_MAX_NAMELEN + DNAME_INLINE_LEN + 1],
*name, *p;
/* strict atomic_t is unnecessary here */
static unsigned short cnt;
BUILD_BUG_ON(sizeof(cnt) * 2 > AUFS_WH_TMP_LEN);
name = defname;
- qs.len = sizeof(defname) - DNAME_INLINE_LEN_MIN + prefix->len - 1;
- if (unlikely(prefix->len > DNAME_INLINE_LEN_MIN)) {
+ qs.len = sizeof(defname) - DNAME_INLINE_LEN + prefix->len - 1;
+ if (unlikely(prefix->len > DNAME_INLINE_LEN)) {
dentry = ERR_PTR(-ENAMETOOLONG);
if (unlikely(qs.len > NAME_MAX))
goto out;
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include <linux/limits.h>
#include <linux/types.h>
-#define AUFS_VERSION "2.1-standalone.tree-37-rcN-20101220"
+#define AUFS_VERSION "2.1-standalone.tree-38-rcN-20110117"
/* todo? move this to linux-2.6.19/include/magic.h */
#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')