Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1402776 > unrolled thread
| Started by | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| First post | 2016-05-18 10:00 +0200 |
| Last post | 2016-05-18 21:40 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH] remove unused blkdev_dax_capable() function Arnd Bergmann <arnd@arndb.de> - 2016-05-18 10:00 +0200
Re: [PATCH] remove unused blkdev_dax_capable() function Toshi Kani <toshi.kani@hpe.com> - 2016-05-18 16:20 +0200
Re: [PATCH] remove unused blkdev_dax_capable() function Vishal Verma <vishal.l.verma@intel.com> - 2016-05-18 21:40 +0200
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2016-05-18 10:00 +0200 |
| Subject | [PATCH] remove unused blkdev_dax_capable() function |
| Message-ID | <rA4yB-7yy-5@gated-at.bofh.it> |
The change from blkdev_dax_capable() to bdev_dax_capable() removed the only user
of the former, so we now get a build warning:
fs/block_dev.c:1244:13: error: 'blkdev_dax_capable' defined but not used [-Werror=unused-function]
static bool blkdev_dax_capable(struct block_device *bdev)
This removes the now-unused function.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: a8078b1fc616 ("block: Update blkdev_dax_capable() for consistency")
---
On Tuesday 10 May 2016 10:23:57 Toshi Kani wrote:
> @@ -1295,7 +1330,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
>
> if (!ret) {
> bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
> - if (!blkdev_dax_capable(bdev))
> + if (!bdev_dax_capable(bdev))
> bdev->bd_inode->i_flags &= ~S_DAX;
>
It's not entirely from the patch description what the intention was here
in keeping two slightly different implementations of the same function
in one file, my best guess is that it was not intentional and we should
just remove this.
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 97f324642b5f..dad77225a721 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1241,33 +1241,6 @@ void bd_set_size(struct block_device *bdev, loff_t size)
}
EXPORT_SYMBOL(bd_set_size);
-static bool blkdev_dax_capable(struct block_device *bdev)
-{
- struct gendisk *disk = bdev->bd_disk;
-
- if (!disk->fops->direct_access || !IS_ENABLED(CONFIG_FS_DAX))
- return false;
-
- /*
- * If the partition is not aligned on a page boundary, we can't
- * do dax I/O to it.
- */
- if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512))
- || (bdev->bd_part->nr_sects % (PAGE_SIZE / 512)))
- return false;
-
- /*
- * If the device has known bad blocks, force all I/O through the
- * driver / page cache.
- *
- * TODO: support finer grained dax error handling
- */
- if (disk->bb && disk->bb->count)
- return false;
-
- return true;
-}
-
static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part);
/*
[toc] | [next] | [standalone]
| From | Toshi Kani <toshi.kani@hpe.com> |
|---|---|
| Date | 2016-05-18 16:20 +0200 |
| Message-ID | <rAaul-3d5-5@gated-at.bofh.it> |
| In reply to | #1402776 |
On Wed, 2016-05-18 at 09:54 +0200, Arnd Bergmann wrote:
> The change from blkdev_dax_capable() to bdev_dax_capable() removed the
> only user of the former, so we now get a build warning:
>
> fs/block_dev.c:1244:13: error: 'blkdev_dax_capable' defined but not used
> [-Werror=unused-function]
> static bool blkdev_dax_capable(struct block_device *bdev)
>
> This removes the now-unused function.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: a8078b1fc616 ("block: Update blkdev_dax_capable() for
> consistency")
:
> It's not entirely from the patch description what the intention was here
> in keeping two slightly different implementations of the same function
> in one file, my best guess is that it was not intentional and we should
> just remove this.
Thanks for the build fix. Looks like there was a conflict
between 8044aae6f374 and a8078b1fc616d, which resulted this build error.
Both patches moved blkdev_dax_capable() from block/ioctl.c
to fs/block_dev.c.
Acked-by: Toshi Kani <toshi.kani@hpe.com>
Thanks,
-Toshi
[toc] | [prev] | [next] | [standalone]
| From | Vishal Verma <vishal.l.verma@intel.com> |
|---|---|
| Date | 2016-05-18 21:40 +0200 |
| Message-ID | <rAfu2-6iT-23@gated-at.bofh.it> |
| In reply to | #1402776 |
On Wed, May 18, 2016 at 09:54:08AM +0200, Arnd Bergmann wrote:
> The change from blkdev_dax_capable() to bdev_dax_capable() removed the only user
> of the former, so we now get a build warning:
>
> fs/block_dev.c:1244:13: error: 'blkdev_dax_capable' defined but not used [-Werror=unused-function]
> static bool blkdev_dax_capable(struct block_device *bdev)
>
> This removes the now-unused function.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: a8078b1fc616 ("block: Update blkdev_dax_capable() for consistency")
> ---
> On Tuesday 10 May 2016 10:23:57 Toshi Kani wrote:
> > @@ -1295,7 +1330,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
> >
> > if (!ret) {
> > bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
> > - if (!blkdev_dax_capable(bdev))
> > + if (!bdev_dax_capable(bdev))
> > bdev->bd_inode->i_flags &= ~S_DAX;
> >
>
> It's not entirely from the patch description what the intention was here
> in keeping two slightly different implementations of the same function
> in one file, my best guess is that it was not intentional and we should
> just remove this.
>
Good catch - like Toshi said, this was indeed a mis-merge.
Stephen, for reference, I've added a branch with the expected conflict
resolution at:
https://git.kernel.org/cgit/linux/kernel/git/nvdimm/nvdimm.git/ libnvdimm-for-4.7-merge
Thanks,
-Vishal
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web