/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2011 Whamcloud, Inc.
+ *
*/
/*
* This file is part of Lustre, http://www.lustre.org/
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;
return 0;
}
+#ifdef HAVE_REQUEST_QUEUE_UNPLUG_FN
/*
* kick off io on the underlying address space
*/
clear_bit(QUEUE_FLAG_PLUGGED, &q->queue_flags);
blk_run_address_space(lo->lo_backing_file->f_mapping);
}
+#endif
static inline void loop_handle_bio(struct lloop_device *lo, struct bio *bio)
{
*/
blk_queue_make_request(lo->lo_queue, loop_make_request);
lo->lo_queue->queuedata = lo;
+#ifdef HAVE_REQUEST_QUEUE_UNPLUG_FN
lo->lo_queue->unplug_fn = loop_unplug;
+#endif
/* queue parameters */
CLASSERT(CFS_PAGE_SIZE < (1 << (sizeof(unsigned short) * 8)));
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)
}
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;
}
if (put_user((long)old_encode_dev(dev), (long*)arg))
GOTO(out, err = -EFAULT);
- bdev = open_by_devnum(dev, file->f_mode);
+ bdev = blkdev_get_by_dev(dev, file->f_mode, NULL);
if (IS_ERR(bdev))
GOTO(out, err = PTR_ERR(bdev));