Merge tag 'usb-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
[firefly-linux-kernel-4.4.55.git] / fs / ceph / ioctl.c
index fb036ed3e1294c065193f27c0fe5115038cf4203..4a989345b37bd368e62ede9ddc0032ff8e5b8fa4 100644 (file)
  */
 static long ceph_ioctl_get_layout(struct file *file, void __user *arg)
 {
-       struct ceph_inode_info *ci = ceph_inode(file->f_dentry->d_inode);
+       struct ceph_inode_info *ci = ceph_inode(file_inode(file));
        struct ceph_ioctl_layout l;
        int err;
 
-       err = ceph_do_getattr(file->f_dentry->d_inode, CEPH_STAT_CAP_LAYOUT);
+       err = ceph_do_getattr(file_inode(file), CEPH_STAT_CAP_LAYOUT);
        if (!err) {
                l.stripe_unit = ceph_file_layout_su(ci->i_layout);
                l.stripe_count = ceph_file_layout_stripe_count(ci->i_layout);
@@ -63,12 +63,12 @@ static long __validate_layout(struct ceph_mds_client *mdsc,
 
 static long ceph_ioctl_set_layout(struct file *file, void __user *arg)
 {
-       struct inode *inode = file->f_dentry->d_inode;
+       struct inode *inode = file_inode(file);
        struct inode *parent_inode;
        struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc;
        struct ceph_mds_request *req;
        struct ceph_ioctl_layout l;
-       struct ceph_inode_info *ci = ceph_inode(file->f_dentry->d_inode);
+       struct ceph_inode_info *ci = ceph_inode(file_inode(file));
        struct ceph_ioctl_layout nl;
        int err;
 
@@ -76,7 +76,7 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg)
                return -EFAULT;
 
        /* validate changed params against current layout */
-       err = ceph_do_getattr(file->f_dentry->d_inode, CEPH_STAT_CAP_LAYOUT);
+       err = ceph_do_getattr(file_inode(file), CEPH_STAT_CAP_LAYOUT);
        if (err)
                return err;
 
@@ -136,7 +136,7 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg)
  */
 static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg)
 {
-       struct inode *inode = file->f_dentry->d_inode;
+       struct inode *inode = file_inode(file);
        struct ceph_mds_request *req;
        struct ceph_ioctl_layout l;
        int err;
@@ -179,13 +179,12 @@ static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg)
 static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg)
 {
        struct ceph_ioctl_dataloc dl;
-       struct inode *inode = file->f_dentry->d_inode;
+       struct inode *inode = file_inode(file);
        struct ceph_inode_info *ci = ceph_inode(inode);
        struct ceph_osd_client *osdc =
                &ceph_sb_to_client(inode->i_sb)->client->osdc;
        u64 len = 1, olen;
        u64 tmp;
-       struct ceph_object_layout ol;
        struct ceph_pg pgid;
        int r;
 
@@ -209,11 +208,9 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg)
 
        snprintf(dl.object_name, sizeof(dl.object_name), "%llx.%08llx",
                 ceph_ino(inode), dl.object_no);
-       ceph_calc_object_layout(&ol, dl.object_name, &ci->i_layout,
+       ceph_calc_object_layout(&pgid, dl.object_name, &ci->i_layout,
                                osdc->osdmap);
 
-       pgid.pool = le32_to_cpu(ol.ol_pgid.pool);
-       pgid.seed = le16_to_cpu(ol.ol_pgid.ps);
        dl.osd = ceph_calc_pg_primary(osdc->osdmap, pgid);
        if (dl.osd >= 0) {
                struct ceph_entity_addr *a =
@@ -235,7 +232,7 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg)
 static long ceph_ioctl_lazyio(struct file *file)
 {
        struct ceph_file_info *fi = file->private_data;
-       struct inode *inode = file->f_dentry->d_inode;
+       struct inode *inode = file_inode(file);
        struct ceph_inode_info *ci = ceph_inode(inode);
 
        if ((fi->fmode & CEPH_FILE_MODE_LAZY) == 0) {