]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - fs/ceph/dir.c
lseek: the "whence" argument is called "whence"
[mirror_ubuntu-zesty-kernel.git] / fs / ceph / dir.c
index f391f1e754145141235bf89d28da37d5c6aba005..8c1aabe93b6779e2c2a39333c73f26222c7f4c28 100644 (file)
@@ -454,7 +454,7 @@ static void reset_readdir(struct ceph_file_info *fi)
        fi->flags &= ~CEPH_F_ATEND;
 }
 
-static loff_t ceph_dir_llseek(struct file *file, loff_t offset, int origin)
+static loff_t ceph_dir_llseek(struct file *file, loff_t offset, int whence)
 {
        struct ceph_file_info *fi = file->private_data;
        struct inode *inode = file->f_mapping->host;
@@ -463,7 +463,7 @@ static loff_t ceph_dir_llseek(struct file *file, loff_t offset, int origin)
 
        mutex_lock(&inode->i_mutex);
        retval = -EINVAL;
-       switch (origin) {
+       switch (whence) {
        case SEEK_END:
                offset += inode->i_size + 2;   /* FIXME */
                break;
@@ -633,44 +633,6 @@ static struct dentry *ceph_lookup(struct inode *dir, struct dentry *dentry,
        return dentry;
 }
 
-int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
-                    struct file *file, unsigned flags, umode_t mode,
-                    int *opened)
-{
-       int err;
-       struct dentry *res = NULL;
-
-       if (!(flags & O_CREAT)) {
-               if (dentry->d_name.len > NAME_MAX)
-                       return -ENAMETOOLONG;
-
-               err = ceph_init_dentry(dentry);
-               if (err < 0)
-                       return err;
-
-               return ceph_lookup_open(dir, dentry, file, flags, mode, opened);
-       }
-
-       if (d_unhashed(dentry)) {
-               res = ceph_lookup(dir, dentry, 0);
-               if (IS_ERR(res))
-                       return PTR_ERR(res);
-
-               if (res)
-                       dentry = res;
-       }
-
-       /* We don't deal with positive dentries here */
-       if (dentry->d_inode)
-               return finish_no_open(file, res);
-
-       *opened |= FILE_CREATED;
-       err = ceph_lookup_open(dir, dentry, file, flags, mode, opened);
-       dput(res);
-
-       return err;
-}
-
 /*
  * If we do a create but get no trace back from the MDS, follow up with
  * a lookup (the VFS expects us to link up the provided dentry).