Whamcloud - gitweb
LU-4712 llite: lock the inode to be migrated
[fs/lustre-release.git] / lustre / llite / lloop.c
index c053464..f3bf6de 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2013, Intel Corporation.
+ * Copyright (c) 2011, 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
 #include <asm/uaccess.h>
 
 #include <lustre_lib.h>
-#include <lustre_lite.h>
 #include "llite_internal.h"
 
 #define LLOOP_MAX_SEGMENTS        LNET_MAX_IOV
@@ -200,7 +199,7 @@ static int do_bio_lustrebacked(struct lloop_device *lo, struct bio *head)
        struct bio_vec       *bvec;
 #endif
         int                   rw;
-        obd_count             page_count = 0;
+       size_t                page_count = 0;
         struct bio           *bio;
         ssize_t               bytes;
 
@@ -679,9 +678,10 @@ static int lo_ioctl(struct block_device *bdev, fmode_t mode,
                 else
                         fid_zero(&fid);
 
-                if (copy_to_user((struct lu_fid *)arg, &fid, sizeof(fid)))
-                        err = -EFAULT;
-                break;
+               if (copy_to_user((struct lu_fid __user *)arg,
+                                &fid, sizeof(fid)))
+                       err = -EFAULT;
+               break;
         }
 
         default:
@@ -748,8 +748,8 @@ static enum llioc_iter lloop_ioctl(struct inode *unused, struct file *file,
                 dev = MKDEV(lloop_major, lo->lo_number);
 
                 /* quit if the used pointer is writable */
-                if (put_user((long)old_encode_dev(dev), (long*)arg))
-                        GOTO(out, err = -EFAULT);
+               if (put_user((long)old_encode_dev(dev), (long __user *)arg))
+                       GOTO(out, err = -EFAULT);
 
                 bdev = blkdev_get_by_dev(dev, file->f_mode, NULL);
                 if (IS_ERR(bdev))