X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fllite%2Flloop.c;h=a0ebd22192648197df8b6755f542e869fcdf7b42;hb=fc4b46df111bbf9d2207265d18b3f0d72f49502c;hp=31fcb4b6b3507b24bc647ed0f50a2f99e9584ff1;hpb=6aea71f39238f370c02a2f293a01555cc653bd01;p=fs%2Flustre-release.git diff --git a/lustre/llite/lloop.c b/lustre/llite/lloop.c index 31fcb4b..a0ebd22 100644 --- a/lustre/llite/lloop.c +++ b/lustre/llite/lloop.c @@ -28,6 +28,9 @@ /* * 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/ @@ -376,6 +379,7 @@ err: return 0; } +#ifdef HAVE_REQUEST_QUEUE_UNPLUG_FN /* * kick off io on the underlying address space */ @@ -386,6 +390,7 @@ static void loop_unplug(struct request_queue *q) 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) { @@ -538,7 +543,9 @@ static int loop_set_fd(struct lloop_device *lo, struct file *unused, */ 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))); @@ -740,7 +747,7 @@ static enum llioc_iter lloop_ioctl(struct inode *unused, struct file *file, 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));