diff options
author | Brian Behlendorf <behlendorf1@llnl.gov> | 2011-02-22 14:55:35 -0800 |
---|---|---|
committer | Brian Behlendorf <behlendorf1@llnl.gov> | 2011-02-23 12:29:38 -0800 |
commit | 45066d1f20a582fc8229776503b1cdd554d7fde4 (patch) | |
tree | e41b6ca3b64e58d1a882f185c59bdb159fd0172b /include/linux | |
parent | 61e909608d15dc6900a710a0ceab6e101a68ac5a (diff) |
Linux 2.6.38 compat, blkdev_get_by_path()
The open_bdev_exclusive() function has been replaced (again) by the
more generic blkdev_get_by_path() function. Additionally, the
counterpart function close_bdev_exclusive() has been replaced by
blkdev_put(). Because these functions are more generic versions
of the functions they replaced the compatibility macro must add
the FMODE_EXCL mask to ensure they are exclusive.
Closes #114
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/Makefile.in | 1 | ||||
-rw-r--r-- | include/linux/blkdev_compat.h | 21 |
2 files changed, 19 insertions, 3 deletions
diff --git a/include/linux/Makefile.in b/include/linux/Makefile.in index e70c16afc..91e0c6688 100644 --- a/include/linux/Makefile.in +++ b/include/linux/Makefile.in @@ -52,6 +52,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-blk-rq-bytes.m4 \ $(top_srcdir)/config/kernel-blk-rq-pos.m4 \ $(top_srcdir)/config/kernel-blk-rq-sectors.m4 \ + $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \ $(top_srcdir)/config/kernel-evict-inode.m4 \ $(top_srcdir)/config/kernel-fmode-t.m4 \ $(top_srcdir)/config/kernel-fsync.m4 \ diff --git a/include/linux/blkdev_compat.h b/include/linux/blkdev_compat.h index f841c6c00..d2e80ec88 100644 --- a/include/linux/blkdev_compat.h +++ b/include/linux/blkdev_compat.h @@ -280,16 +280,31 @@ bio_set_flags_failfast(struct block_device *bdev, int *flags) #endif /* HAVE_2ARGS_BIO_END_IO_T */ /* - * 2.6.28 API change + * 2.6.38 - 2.6.x API, + * blkdev_get_by_path() + * blkdev_put() + * + * 2.6.28 - 2.6.37 API, + * open_bdev_exclusive() + * close_bdev_exclusive() + * + * 2.6.12 - 2.6.27 API, + * open_bdev_excl() + * close_bdev_excl() + * * Used to exclusively open a block device from within the kernel. */ -#ifdef HAVE_OPEN_BDEV_EXCLUSIVE +#if defined(HAVE_BLKDEV_GET_BY_PATH) +# define vdev_bdev_open(path, md, hld) blkdev_get_by_path(path, \ + (md) | FMODE_EXCL, hld) +# define vdev_bdev_close(bdev, md) blkdev_put(bdev, (md) | FMODE_EXCL) +#elif defined(HAVE_OPEN_BDEV_EXCLUSIVE) # define vdev_bdev_open(path, md, hld) open_bdev_exclusive(path, md, hld) # define vdev_bdev_close(bdev, md) close_bdev_exclusive(bdev, md) #else # define vdev_bdev_open(path, md, hld) open_bdev_excl(path, md, hld) # define vdev_bdev_close(bdev, md) close_bdev_excl(bdev) -#endif /* HAVE_OPEN_BDEV_EXCLUSIVE */ +#endif /* HAVE_BLKDEV_GET_BY_PATH | HAVE_OPEN_BDEV_EXCLUSIVE */ /* * 2.6.22 API change |