BUG_ON(!S_ISREG(dentry->d_inode->i_mode));
unionfs_check_file(file);
- unionfs_check_dentry(dentry);
for (bindex = bstart - 1; bindex >= 0; bindex--) {
if (!d_deleted(dentry))
err = copyup_file(parent_inode, file, bstart,
out:
unionfs_check_file(file);
- unionfs_check_dentry(dentry);
return err;
}
err = vfs_read(lower_file, buf, count, ppos);
/* update our inode atime upon a successful lower read */
if (err >= 0) {
- fsstack_copy_attr_atime(file->f_path.dentry->d_inode,
+ fsstack_copy_attr_atime(dentry->d_inode,
lower_file->f_path.dentry->d_inode);
unionfs_check_file(file);
}
out:
unionfs_unlock_dentry(dentry);
- unionfs_read_unlock(file->f_path.dentry->d_sb);
+ unionfs_read_unlock(dentry->d_sb);
return err;
}
err = vfs_write(lower_file, buf, count, ppos);
/* update our inode times+sizes upon a successful lower write */
if (err >= 0) {
- fsstack_copy_inode_size(file->f_path.dentry->d_inode,
+ fsstack_copy_inode_size(dentry->d_inode,
lower_file->f_path.dentry->d_inode);
- fsstack_copy_attr_times(file->f_path.dentry->d_inode,
+ fsstack_copy_attr_times(dentry->d_inode,
lower_file->f_path.dentry->d_inode);
unionfs_check_file(file);
}
out:
unionfs_unlock_dentry(dentry);
- unionfs_read_unlock(file->f_path.dentry->d_sb);
+ unionfs_read_unlock(dentry->d_sb);
return err;
}
-
static int unionfs_file_readdir(struct file *file, void *dirent,
filldir_t filldir)
{
return -ENOTDIR;
}
-int unionfs_readpage_dummy(struct file *file, struct page *page)
-{
- BUG();
- return -EINVAL;
-}
-
static int unionfs_mmap(struct file *file, struct vm_area_struct *vma)
{
int err = 0;
bindex, old_dentry->d_name.name,
old_dentry->d_name.len, NULL,
i_size_read(old_dentry->d_inode));
- if (!err) {
- lower_new_dentry =
- create_parents(dir, new_dentry,
- new_dentry->d_name.name,
- bindex);
- lower_old_dentry =
- unionfs_lower_dentry(old_dentry);
- lower_dir_dentry =
- lock_parent(lower_new_dentry);
- /*
- * see
- * Documentation/filesystems/unionfs/issues.txt
- */
- lockdep_off();
- /* do vfs_link */
- err = vfs_link(lower_old_dentry,
- lower_dir_dentry->d_inode,
- lower_new_dentry);
- lockdep_on();
- unlock_dir(lower_dir_dentry);
- goto check_link;
- }
+ if (err)
+ continue;
+ lower_new_dentry =
+ create_parents(dir, new_dentry,
+ new_dentry->d_name.name,
+ bindex);
+ lower_old_dentry = unionfs_lower_dentry(old_dentry);
+ lower_dir_dentry = lock_parent(lower_new_dentry);
+ /* see Documentation/filesystems/unionfs/issues.txt */
+ lockdep_off();
+ /* do vfs_link */
+ err = vfs_link(lower_old_dentry,
+ lower_dir_dentry->d_inode,
+ lower_new_dentry);
+ lockdep_on();
+ unlock_dir(lower_dir_dentry);
+ goto check_link;
}
goto out;
}