Whamcloud - gitweb
LU-592 1.8 <-> 2.1 interop: missing LMV on client
[fs/lustre-release.git] / lustre / llite / lloop.c
index 6975c85..31fcb4b 100644 (file)
@@ -240,7 +240,7 @@ static int do_bio_lustrebacked(struct lloop_device *lo, struct bio *head)
 
         ll_stats_ops_tally(ll_i2sbi(inode),
                         (rw == WRITE) ? LPROC_LL_BRW_WRITE : LPROC_LL_BRW_READ,
-                        page_count << PAGE_CACHE_SHIFT);
+                        page_count);
 
         pvec->ldp_size = page_count << PAGE_CACHE_SHIFT;
         pvec->ldp_nr = page_count;
@@ -553,7 +553,7 @@ static int loop_set_fd(struct lloop_device *lo, struct file *unused,
 
         set_blocksize(bdev, lo->lo_blocksize);
 
-        cfs_kernel_thread(loop_thread, lo, CLONE_KERNEL);
+        cfs_create_thread(loop_thread, lo, CLONE_KERNEL);
         cfs_down(&lo->lo_sem);
         return 0;
 
@@ -641,6 +641,7 @@ static int lo_ioctl(struct block_device *bdev, fmode_t mode,
                     unsigned int cmd, unsigned long arg)
 {
         struct lloop_device *lo = bdev->bd_disk->private_data;
+        struct inode *inode = lo->lo_backing_file->f_dentry->d_inode;
 #else
 static int lo_ioctl(struct inode *inode, struct file *unused,
                     unsigned int cmd, unsigned long arg)
@@ -660,12 +661,14 @@ static int lo_ioctl(struct inode *inode, struct file *unused,
         }
 
         case LL_IOC_LLOOP_INFO: {
-                __u64 ino = 0;
+                struct lu_fid fid;
 
                 if (lo->lo_state == LLOOP_BOUND)
-                        ino = lo->lo_backing_file->f_dentry->d_inode->i_ino;
+                        fid = ll_i2info(inode)->lli_fid;
+                else
+                        fid_zero(&fid);
 
-                if (put_user(ino, (__u64 *)arg))
+                if (copy_to_user((struct lu_fid *)arg, &fid, sizeof(fid)))
                         err = -EFAULT;
                 break;
         }