linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Christian Brauner <brauner@kernel.org>,
	"Darrick J. Wong" <djwong@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Josef Bacik <josef@toxicpanda.com>,
	"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
	linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] iomap: provide iomap_want_unshare_iter() stub for !CONFIG_BLOCK
Date: Wed, 16 Oct 2024 06:23:40 +0000	[thread overview]
Message-ID: <20241016062344.2571015-1-arnd@kernel.org> (raw)

From: Arnd Bergmann <arnd@arndb.de>

When block device support is disabled, DAX fails to link with:

aarch64-linux/bin/aarch64-linux-ld: fs/dax.o: in function `dax_file_unshare':
dax.c:(.text+0x2694): undefined reference to `iomap_want_unshare_iter'

Return false in this case, as far as I can tell, this cannot happen
without block devices.

Fixes: 6ef6a0e821d3 ("iomap: share iomap_unshare_iter predicate code with fsdax")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/iomap.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index e04c060e8fe1..84ec2b7419c5 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -281,7 +281,14 @@ void iomap_invalidate_folio(struct folio *folio, size_t offset, size_t len);
 bool iomap_dirty_folio(struct address_space *mapping, struct folio *folio);
 int iomap_file_unshare(struct inode *inode, loff_t pos, loff_t len,
 		const struct iomap_ops *ops);
+#ifdef CONFIG_BLOCK
 bool iomap_want_unshare_iter(const struct iomap_iter *iter);
+#else
+static inline bool iomap_want_unshare_iter(const struct iomap_iter *iter)
+{
+	return false;
+}
+#endif
 int iomap_zero_range(struct inode *inode, loff_t pos, loff_t len,
 		bool *did_zero, const struct iomap_ops *ops);
 int iomap_truncate_page(struct inode *inode, loff_t pos, bool *did_zero,
-- 
2.39.5


             reply	other threads:[~2024-10-16  6:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-16  6:23 Arnd Bergmann [this message]
2024-10-16  8:15 ` [PATCH] iomap: provide iomap_want_unshare_iter() stub for !CONFIG_BLOCK Ritesh Harjani

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=20241016062344.2571015-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=arnd@arndb.de \
    --cc=brauner@kernel.org \
    --cc=djwong@kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ritesh.list@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).