offset = (pgoff_t)(bio->bi_sector << 9) + lo->lo_offset;
bio_for_each_segment(bvec, bio, i) {
BUG_ON(bvec->bv_offset != 0);
- BUG_ON(bvec->bv_len != CFS_PAGE_SIZE);
+ BUG_ON(bvec->bv_len != PAGE_CACHE_SIZE);
pages[page_count] = bvec->bv_page;
offsets[page_count] = offset;
int refcheck;
int ret = 0;
- daemonize("lloop%d", lo->lo_number);
-
set_user_nice(current, -20);
lo->lo_state = LLOOP_BOUND;
set_device_ro(bdev, (lo_flags & LO_FLAGS_READ_ONLY) != 0);
- lo->lo_blocksize = CFS_PAGE_SIZE;
+ lo->lo_blocksize = PAGE_CACHE_SIZE;
lo->lo_device = bdev;
lo->lo_flags = lo_flags;
lo->lo_backing_file = file;
lo->lo_queue->unplug_fn = loop_unplug;
#endif
- /* queue parameters */
- CLASSERT(CFS_PAGE_SIZE < (1 << (sizeof(unsigned short) * 8)));
- blk_queue_logical_block_size(lo->lo_queue,
- (unsigned short)CFS_PAGE_SIZE);
- blk_queue_max_hw_sectors(lo->lo_queue,
- LLOOP_MAX_SEGMENTS << (CFS_PAGE_SHIFT - 9));
- blk_queue_max_segments(lo->lo_queue, LLOOP_MAX_SEGMENTS);
+ /* queue parameters */
+ CLASSERT(PAGE_CACHE_SIZE < (1 << (sizeof(unsigned short) * 8)));
+ blk_queue_logical_block_size(lo->lo_queue,
+ (unsigned short)PAGE_CACHE_SIZE);
+ blk_queue_max_hw_sectors(lo->lo_queue,
+ LLOOP_MAX_SEGMENTS << (PAGE_CACHE_SHIFT - 9));
+ blk_queue_max_segments(lo->lo_queue, LLOOP_MAX_SEGMENTS);
set_capacity(disks[lo->lo_number], size);
bd_set_size(bdev, size << 9);
- set_blocksize(bdev, lo->lo_blocksize);
+ set_blocksize(bdev, lo->lo_blocksize);
- cfs_create_thread(loop_thread, lo, CLONE_KERNEL);
+ kthread_run(loop_thread, lo, "lloop%d", lo->lo_number);
down(&lo->lo_sem);
- return 0;
+ return 0;
- out:
+out:
/* This is safe: open() is still holding a reference. */
cfs_module_put(THIS_MODULE);
return error;