linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: linux-nvdimm@lists.01.org
Cc: Theodore Ts'o <tytso@mit.edu>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Matthew Wilcox <mawilcox@microsoft.com>,
	Ross Zwisler <ross.zwisler@linux.intel.com>,
	stable@vger.kernel.org, Jan Kara <jack@suse.cz>,
	linux-xfs@vger.kernel.org, hch@lst.de,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v5 07/12] ext4, dax: replace IS_DAX() with IS_FSDAX()
Date: Thu, 01 Mar 2018 19:54:11 -0800	[thread overview]
Message-ID: <151996285107.28483.10237358640480864296.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
In-Reply-To: <151996281307.28483.12343847096989509127.stgit@dwillia2-desk3.amr.corp.intel.com>

In preparation for fixing the broken definition of S_DAX in the
CONFIG_FS_DAX=n + CONFIG_DEV_DAX=y case, convert all IS_DAX() usages to
use explicit tests for FSDAX since DAX is ambiguous.

Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: <stable@vger.kernel.org>
Fixes: dee410792419 ("/dev/dax, core: file operations and dax-mmap")
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 fs/ext4/file.c  |   12 +++++-------
 fs/ext4/inode.c |    4 ++--
 fs/ext4/ioctl.c |    2 +-
 fs/ext4/super.c |    2 +-
 4 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 51854e7608f0..561ea843b458 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -48,7 +48,7 @@ static ssize_t ext4_dax_read_iter(struct kiocb *iocb, struct iov_iter *to)
 	 * Recheck under inode lock - at this point we are sure it cannot
 	 * change anymore
 	 */
-	if (!IS_DAX(inode)) {
+	if (!IS_FSDAX(inode)) {
 		inode_unlock_shared(inode);
 		/* Fallback to buffered IO in case we cannot support DAX */
 		return generic_file_read_iter(iocb, to);
@@ -68,7 +68,7 @@ static ssize_t ext4_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
 	if (!iov_iter_count(to))
 		return 0; /* skip atime */
 
-	if (IS_DAX(file_inode(iocb->ki_filp)))
+	if (IS_FSDAX(file_inode(iocb->ki_filp)))
 		return ext4_dax_read_iter(iocb, to);
 	return generic_file_read_iter(iocb, to);
 }
@@ -216,10 +216,8 @@ ext4_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
 	if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb))))
 		return -EIO;
 
-#ifdef CONFIG_FS_DAX
-	if (IS_DAX(inode))
+	if (IS_FSDAX(inode))
 		return ext4_dax_write_iter(iocb, from);
-#endif
 	if (!o_direct && (iocb->ki_flags & IOCB_NOWAIT))
 		return -EOPNOTSUPP;
 
@@ -361,11 +359,11 @@ static int ext4_file_mmap(struct file *file, struct vm_area_struct *vma)
 	 * We don't support synchronous mappings for non-DAX files. At least
 	 * until someone comes with a sensible use case.
 	 */
-	if (!IS_DAX(file_inode(file)) && (vma->vm_flags & VM_SYNC))
+	if (!IS_FSDAX(file_inode(file)) && (vma->vm_flags & VM_SYNC))
 		return -EOPNOTSUPP;
 
 	file_accessed(file);
-	if (IS_DAX(file_inode(file))) {
+	if (IS_FSDAX(file_inode(file))) {
 		vma->vm_ops = &ext4_dax_vm_ops;
 		vma->vm_flags |= VM_MIXEDMAP | VM_HUGEPAGE;
 	} else {
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index c94780075b04..1879b33aa391 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3858,7 +3858,7 @@ static ssize_t ext4_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
 		return 0;
 
 	/* DAX uses iomap path now */
-	if (WARN_ON_ONCE(IS_DAX(inode)))
+	if (WARN_ON_ONCE(IS_FSDAX(inode)))
 		return 0;
 
 	trace_ext4_direct_IO_enter(inode, offset, count, iov_iter_rw(iter));
@@ -4076,7 +4076,7 @@ static int ext4_block_zero_page_range(handle_t *handle,
 	if (length > max || length < 0)
 		length = max;
 
-	if (IS_DAX(inode)) {
+	if (IS_FSDAX(inode)) {
 		return iomap_zero_range(inode, from, length, NULL,
 					&ext4_iomap_ops);
 	}
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 7e99ad02f1ba..040fc6570ddb 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -790,7 +790,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 				 "Online defrag not supported with bigalloc");
 			err = -EOPNOTSUPP;
 			goto mext_out;
-		} else if (IS_DAX(inode)) {
+		} else if (IS_FSDAX(inode)) {
 			ext4_msg(sb, KERN_ERR,
 				 "Online defrag not supported with DAX");
 			err = -EOPNOTSUPP;
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 39bf464c35f1..933e12940181 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1161,7 +1161,7 @@ static int ext4_set_context(struct inode *inode, const void *ctx, size_t len,
 	if (inode->i_ino == EXT4_ROOT_INO)
 		return -EPERM;
 
-	if (WARN_ON_ONCE(IS_DAX(inode) && i_size_read(inode)))
+	if (WARN_ON_ONCE(IS_FSDAX(inode) && i_size_read(inode)))
 		return -EINVAL;
 
 	res = ext4_convert_inline_data(inode);

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2018-03-02  4:03 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-02  3:53 [PATCH v5 00/12] vfio, dax: prevent long term filesystem-dax pins and other fixes Dan Williams
2018-03-02  3:53 ` [PATCH v5 01/12] dax: fix vma_is_fsdax() helper Dan Williams
2018-03-02 22:52   ` Christoph Hellwig
2018-03-02  3:53 ` [PATCH v5 02/12] dax: introduce IS_DEVDAX() and IS_FSDAX() Dan Williams
2018-03-02 17:45   ` Darrick J. Wong
2018-03-02 18:37     ` Dan Williams
2018-03-02 19:06       ` [PATCH v6] " Dan Williams
2018-03-02 19:58         ` Darrick J. Wong
2018-03-02 22:53   ` [PATCH v5 02/12] " Christoph Hellwig
2018-03-02  3:53 ` [PATCH v5 03/12] ext2, dax: finish implementing dax_sem helpers Dan Williams
2018-03-02  3:53 ` [PATCH v5 04/12] ext2, dax: define ext2_dax_*() infrastructure in all cases Dan Williams
2018-03-02  3:54 ` [PATCH v5 05/12] ext4, dax: define ext4_dax_*() " Dan Williams
2018-03-02  3:54 ` [PATCH v5 06/12] ext2, dax: replace IS_DAX() with IS_FSDAX() Dan Williams
2018-03-02  3:54 ` Dan Williams [this message]
2018-03-02  3:54 ` [PATCH v5 08/12] xfs, " Dan Williams
2018-03-02 17:46   ` Darrick J. Wong
2018-03-02  3:54 ` [PATCH v5 09/12] mm, dax: replace IS_DAX() with IS_DEVDAX() or IS_FSDAX() Dan Williams
2018-03-02 22:54   ` Christoph Hellwig
2018-03-02  3:54 ` [PATCH v5 10/12] fs, dax: kill IS_DAX() Dan Williams
2018-03-02  3:54 ` [PATCH v5 11/12] dax: fix S_DAX definition Dan Williams
2018-03-02  3:54 ` [PATCH v5 12/12] vfio: disable filesystem-dax page pinning Dan Williams
2018-03-02 22:10 ` [PATCH v5 00/12] vfio, dax: prevent long term filesystem-dax pins and other fixes Christoph Hellwig
2018-03-02 22:21   ` Dan Williams
2018-03-02 22:57     ` Christoph Hellwig
2018-03-02 23:49       ` Dan Williams
2018-03-03  2:19         ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=151996285107.28483.10237358640480864296.stgit@dwillia2-desk3.amr.corp.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=mawilcox@microsoft.com \
    --cc=ross.zwisler@linux.intel.com \
    --cc=stable@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox