]> Pileus Git - ~andy/linux/blobdiff - fs/ecryptfs/file.c
file->f_op is never NULL...
[~andy/linux] / fs / ecryptfs / file.c
index 24f1105fda3ab5edfccc7a748f97dd624bf6f0fb..6b1cd2b0c75179f822319c6ae7a28c06fb108b53 100644 (file)
@@ -49,7 +49,7 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb,
                                unsigned long nr_segs, loff_t pos)
 {
        ssize_t rc;
-       struct path lower;
+       struct path *path;
        struct file *file = iocb->ki_filp;
 
        rc = generic_file_aio_read(iocb, iov, nr_segs, pos);
@@ -60,9 +60,8 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb,
        if (-EIOCBQUEUED == rc)
                rc = wait_on_sync_kiocb(iocb);
        if (rc >= 0) {
-               lower.dentry = ecryptfs_dentry_to_lower(file->f_path.dentry);
-               lower.mnt = ecryptfs_dentry_to_lower_mnt(file->f_path.dentry);
-               touch_atime(&lower);
+               path = ecryptfs_dentry_to_lower_path(file->f_path.dentry);
+               touch_atime(path);
        }
        return rc;
 }
@@ -272,7 +271,7 @@ static int ecryptfs_flush(struct file *file, fl_owner_t td)
 {
        struct file *lower_file = ecryptfs_file_to_lower(file);
 
-       if (lower_file->f_op && lower_file->f_op->flush) {
+       if (lower_file->f_op->flush) {
                filemap_write_and_wait(file->f_mapping);
                return lower_file->f_op->flush(lower_file, td);
        }
@@ -306,7 +305,7 @@ static int ecryptfs_fasync(int fd, struct file *file, int flag)
        struct file *lower_file = NULL;
 
        lower_file = ecryptfs_file_to_lower(file);
-       if (lower_file->f_op && lower_file->f_op->fasync)
+       if (lower_file->f_op->fasync)
                rc = lower_file->f_op->fasync(fd, lower_file, flag);
        return rc;
 }
@@ -319,7 +318,7 @@ ecryptfs_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
        if (ecryptfs_file_to_private(file))
                lower_file = ecryptfs_file_to_lower(file);
-       if (lower_file && lower_file->f_op && lower_file->f_op->unlocked_ioctl)
+       if (lower_file->f_op && lower_file->f_op->unlocked_ioctl)
                rc = lower_file->f_op->unlocked_ioctl(lower_file, cmd, arg);
        return rc;
 }
@@ -333,7 +332,7 @@ ecryptfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
        if (ecryptfs_file_to_private(file))
                lower_file = ecryptfs_file_to_lower(file);
-       if (lower_file && lower_file->f_op && lower_file->f_op->compat_ioctl)
+       if (lower_file->f_op && lower_file->f_op->compat_ioctl)
                rc = lower_file->f_op->compat_ioctl(lower_file, cmd, arg);
        return rc;
 }