* unionfs_permission, or anything it calls, will use stale branch
* information.
*/
-static int unionfs_permission(struct inode *inode, int mask,
- struct nameidata *nd)
+static int unionfs_permission(struct inode *inode, int mask)
{
struct inode *lower_inode = NULL;
int err = 0;
const int is_file = !S_ISDIR(inode->i_mode);
const int write_mask = (mask & MAY_WRITE) && !(mask & MAY_READ);
- if (nd)
- unionfs_lock_dentry(nd->path.dentry, UNIONFS_DMUTEX_CHILD);
-
if (!UNIONFS_I(inode)->lower_inodes) {
if (is_file) /* dirs can be unlinked but chdir'ed to */
err = -ESTALE; /* force revalidate */
* readonly, because those conditions should lead to a
* copyup taking place later on.
*/
- err = permission(lower_inode, mask, nd);
+ err = inode_permission(lower_inode, mask);
if (err && bindex > 0) {
umode_t mode = lower_inode->i_mode;
if (is_robranch_super(inode->i_sb, bindex) &&
out:
unionfs_check_inode(inode);
- unionfs_check_nd(nd);
- if (nd)
- unionfs_unlock_dentry(nd->path.dentry);
return err;
}
lower_dir = lower_dir_dentry->d_inode;
BUG_ON(!S_ISDIR(lower_dir->i_mode));
- if (!permission(lower_dir, MAY_WRITE | MAY_EXEC, NULL)) {
+ if (!inode_permission(lower_dir, MAY_WRITE | MAY_EXEC)) {
err = do_delete_whiteouts(dentry, bindex, namelist);
} else {
args.deletewh.namelist = namelist;
mutex_lock(&lower_inode->i_mutex);
- if (!permission(lower_inode, MAY_EXEC, NULL)) {
+ if (!inode_permission(lower_inode, MAY_EXEC)) {
wh_lower_dentry =
lookup_one_len(UNIONFS_DIR_OPAQUE, lower_dentry,
sizeof(UNIONFS_DIR_OPAQUE) - 1);