Whamcloud - gitweb
b=21670 make the code compilable with ppc/rhel5
authorAndrew Perepechko <andrew.perepechko@sun.com>
Thu, 24 Dec 2009 14:51:14 +0000 (17:51 +0300)
committerAndrew Perepechko <andrew.perepechko@sun.com>
Thu, 24 Dec 2009 14:51:14 +0000 (17:51 +0300)
i=Oleg Drokin

lustre/llite/lloop.c

index 7de218e..4a0e35e 100644 (file)
@@ -499,7 +499,12 @@ static int loop_set_fd(struct lloop_device *lo, struct file *unused,
         lo->lo_queue->unplug_fn = loop_unplug;
 
         /* queue parameters */
-        blk_queue_hardsect_size(lo->lo_queue, CFS_PAGE_SIZE);
+        /*
+         * using unsigned type cast instead of unsigned short cast in order
+         * to avoid truncate of CFS_PAGE_SIZE (= 2**16) value
+         */
+        blk_queue_hardsect_size(lo->lo_queue,
+                                min_t(unsigned, CFS_PAGE_SIZE, 16384));
         blk_queue_max_sectors(lo->lo_queue,
                               LLOOP_MAX_SEGMENTS << (CFS_PAGE_SHIFT - 9));
         blk_queue_max_phys_segments(lo->lo_queue, LLOOP_MAX_SEGMENTS);