dput(tmp_dentry);
err = copyup_named_file(dentry->d_parent->d_inode, file, name, bstart,
- bindex, file->f_dentry->d_inode->i_size);
+ bindex, file->f_path.dentry->d_inode->i_size);
if (err) {
if (err == -EEXIST)
goto retry;
{
int bindex, bstart, bend;
struct file **lf;
- struct super_block *sb = file->f_dentry->d_sb;
+ struct super_block *sb = file->f_path.dentry->d_sb;
lf = UNIONFS_F(file)->lower_files;
bstart = fbstart(file);
int bindex, bstart, bend, err = 0;
struct file *lower_file;
struct dentry *lower_dentry;
- struct dentry *dentry = file->f_dentry;
+ struct dentry *dentry = file->f_path.dentry;
struct super_block *sb = dentry->d_sb;
bstart = dbstart(dentry);
int bindex, bstart, bend, err = 0;
struct file *lower_file;
struct dentry *lower_dentry;
- struct dentry *dentry = file->f_dentry;
+ struct dentry *dentry = file->f_path.dentry;
struct inode *parent_inode = dentry->d_parent->d_inode;
struct super_block *sb = dentry->d_sb;
size_t inode_size = dentry->d_inode->i_size;
static int do_delayed_copyup(struct file *file)
{
int bindex, bstart, bend, err = 0;
- struct dentry *dentry = file->f_dentry;
+ struct dentry *dentry = file->f_path.dentry;
struct inode *parent_inode = dentry->d_parent->d_inode;
loff_t inode_size = dentry->d_inode->i_size;
int size;
int err = 0;
- dentry = file->f_dentry;
+ dentry = file->f_path.dentry;
unionfs_lock_dentry(dentry);
sb = dentry->d_sb;
struct file *lower_file;
int bindex, bstart, bend;
- bstart = fbstart(file) = dbstart(file->f_dentry);
- bend = fbend(file) = dbend(file->f_dentry);
+ bstart = fbstart(file) = dbstart(file->f_path.dentry);
+ bend = fbend(file) = dbend(file->f_path.dentry);
for (bindex = bstart; bindex <= bend; bindex++) {
lower_dentry =
- unionfs_lower_dentry_idx(file->f_dentry, bindex);
+ unionfs_lower_dentry_idx(file->f_path.dentry, bindex);
if (!lower_dentry)
continue;
dget(lower_dentry);
- unionfs_mntget(file->f_dentry, bindex);
+ unionfs_mntget(file->f_path.dentry, bindex);
lower_file = dentry_open(lower_dentry,
- unionfs_lower_mnt_idx(file->f_dentry,
+ unionfs_lower_mnt_idx(file->f_path.dentry,
bindex),
file->f_flags);
if (IS_ERR(lower_file))
int lower_flags;
int bindex, bstart, bend;
- lower_dentry = unionfs_lower_dentry(file->f_dentry);
+ lower_dentry = unionfs_lower_dentry(file->f_path.dentry);
lower_flags = file->f_flags;
- bstart = fbstart(file) = dbstart(file->f_dentry);
- bend = fbend(file) = dbend(file->f_dentry);
+ bstart = fbstart(file) = dbstart(file->f_path.dentry);
+ bend = fbend(file) = dbend(file->f_path.dentry);
/*
* check for the permission for lower file. If the error is
* COPYUP_ERR, copyup the file.
*/
- if (lower_dentry->d_inode && is_robranch(file->f_dentry)) {
+ if (lower_dentry->d_inode && is_robranch(file->f_path.dentry)) {
/*
* if the open will change the file, copy it up otherwise
* defer it.
/* copyup the file */
for (bindex = bstart - 1; bindex >= 0; bindex--) {
err = copyup_file(
- file->f_dentry->d_parent->d_inode,
+ file->f_path.dentry->d_parent->d_inode,
file, bstart, bindex, size);
if (!err)
break;
* dentry_open will decrement mnt refcnt if err.
* otherwise fput() will do an mntput() for us upon file close.
*/
- unionfs_mntget(file->f_dentry, bstart);
+ unionfs_mntget(file->f_path.dentry, bstart);
lower_file =
dentry_open(lower_dentry,
- unionfs_lower_mnt_idx(file->f_dentry, bstart),
+ unionfs_lower_mnt_idx(file->f_path.dentry, bstart),
lower_flags);
if (IS_ERR(lower_file))
return PTR_ERR(lower_file);
goto out;
}
- dentry = file->f_dentry;
+ dentry = file->f_path.dentry;
unionfs_lock_dentry(dentry);
bstart = fbstart(file) = dbstart(dentry);
if (!lower_file)
continue;
- branchput(file->f_dentry->d_sb, bindex);
+ branchput(file->f_path.dentry->d_sb, bindex);
/* fput calls dput for lower_dentry */
fput(lower_file);
}
unionfs_check_inode(inode);
if (!err) {
unionfs_check_file(file);
- unionfs_check_dentry(file->f_dentry->d_parent);
+ unionfs_check_dentry(file->f_path.dentry->d_parent);
}
return err;
}
goto out;
unionfs_check_file(file);
fileinfo = UNIONFS_F(file);
- BUG_ON(file->f_dentry->d_inode != inode);
+ BUG_ON(file->f_path.dentry->d_inode != inode);
inodeinfo = UNIONFS_I(inode);
/* fput all the lower files */
err = lower_file->f_op->unlocked_ioctl(lower_file, cmd, arg);
} else if (lower_file->f_op->ioctl) {
lock_kernel();
- err = lower_file->f_op->ioctl(lower_file->f_dentry->d_inode,
+ err = lower_file->f_op->ioctl(lower_file->f_path.dentry->d_inode,
lower_file, cmd, arg);
unlock_kernel();
}
struct dentry *dentry, *lower_dentry;
struct vfsmount *mnt;
- dentry = file->f_dentry;
+ dentry = file->f_path.dentry;
unionfs_lock_dentry(dentry);
orig_bstart = dbstart(dentry);
orig_bend = dbend(dentry);
struct page *lower_page;
char *lower_page_data;
- dentry = file->f_dentry;
+ dentry = file->f_path.dentry;
if (UNIONFS_F(file) == NULL) {
err = -ENOENT;
goto out_err;
{
int err;
- unionfs_read_lock(file->f_dentry->d_sb);
+ unionfs_read_lock(file->f_path.dentry->d_sb);
if ((err = unionfs_file_revalidate(file, 0)))
goto out;
unionfs_check_file(file);
if (!err) {
touch_atime(unionfs_lower_mnt(file->f_path.dentry),
unionfs_lower_dentry(file->f_path.dentry));
- unionfs_copy_attr_times(file->f_dentry->d_inode);
+ unionfs_copy_attr_times(file->f_path.dentry->d_inode);
}
/*
out:
unlock_page(page);
unionfs_check_file(file);
- unionfs_read_unlock(file->f_dentry->d_sb);
+ unionfs_read_unlock(file->f_path.dentry->d_sb);
return err;
}
{
int err;
- unionfs_read_lock(file->f_dentry->d_sb);
+ unionfs_read_lock(file->f_path.dentry->d_sb);
/*
* This is the only place where we unconditionally copy the lower
* attribute times before calling unionfs_file_revalidate. The
* changed lower mtimes, and avoid an invariant violation warning,
* is here, in ->prepare_write.
*/
- unionfs_copy_attr_times(file->f_dentry->d_inode);
+ unionfs_copy_attr_times(file->f_path.dentry->d_inode);
err = unionfs_file_revalidate(file, 1);
unionfs_check_file(file);
- unionfs_read_unlock(file->f_dentry->d_sb);
+ unionfs_read_unlock(file->f_path.dentry->d_sb);
return err;
}
BUG_ON(file == NULL);
- unionfs_read_lock(file->f_dentry->d_sb);
+ unionfs_read_lock(file->f_path.dentry->d_sb);
if ((err = unionfs_file_revalidate(file, 1)))
goto out;
unionfs_check_file(file);
if (err < 0)
ClearPageUptodate(page);
- unionfs_read_unlock(file->f_dentry->d_sb);
+ unionfs_read_unlock(file->f_path.dentry->d_sb);
unionfs_check_file(file);
return err; /* assume all is ok */
}