/*
* 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/
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)));
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));