linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Reichl <preichl@redhat.com>
To: linux-fsdevel@vger.kernel.org
Cc: cem@redhat.com
Subject: [PATCH 1/1] exfat: Add fiemap support
Date: Tue, 20 Jul 2021 11:37:48 +0200	[thread overview]
Message-ID: <20210720093748.180714-2-preichl@redhat.com> (raw)
In-Reply-To: <20210720093748.180714-1-preichl@redhat.com>

Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
 fs/exfat/exfat_fs.h | 3 +++
 fs/exfat/file.c     | 1 +
 fs/exfat/inode.c    | 8 ++++++++
 3 files changed, 12 insertions(+)

diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h
index 1d6da61157c9..1c22aa7107d4 100644
--- a/fs/exfat/exfat_fs.h
+++ b/fs/exfat/exfat_fs.h
@@ -428,6 +428,9 @@ long exfat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
 long exfat_compat_ioctl(struct file *filp, unsigned int cmd,
 				unsigned long arg);
 
+extern int exfat_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
+	u64 start, u64 len);
+
 /* namei.c */
 extern const struct dentry_operations exfat_dentry_ops;
 extern const struct dentry_operations exfat_utf8_dentry_ops;
diff --git a/fs/exfat/file.c b/fs/exfat/file.c
index 6af0191b648f..7823dcbca96e 100644
--- a/fs/exfat/file.c
+++ b/fs/exfat/file.c
@@ -432,4 +432,5 @@ const struct file_operations exfat_file_operations = {
 const struct inode_operations exfat_file_inode_operations = {
 	.setattr     = exfat_setattr,
 	.getattr     = exfat_getattr,
+	.fiemap	     = exfat_fiemap,
 };
diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c
index 1803ef3220fd..c6f95d68badc 100644
--- a/fs/exfat/inode.c
+++ b/fs/exfat/inode.c
@@ -13,6 +13,7 @@
 #include <linux/uio.h>
 #include <linux/random.h>
 #include <linux/iversion.h>
+#include <linux/fiemap.h>
 
 #include "exfat_raw.h"
 #include "exfat_fs.h"
@@ -358,6 +359,13 @@ static int exfat_get_block(struct inode *inode, sector_t iblock,
 	return err;
 }
 
+int exfat_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
+		u64 start, u64 len)
+{
+	return generic_block_fiemap(inode, fieinfo, start, len,
+			exfat_get_block);
+}
+
 static int exfat_readpage(struct file *file, struct page *page)
 {
 	return mpage_readpage(page, exfat_get_block);
-- 
2.31.1


  reply	other threads:[~2021-07-20  9:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20  9:37 [PATCH 0/1] exfat: Add fiemap support Pavel Reichl
2021-07-20  9:37 ` Pavel Reichl [this message]
2021-07-20 10:44   ` [PATCH 1/1] " Christoph Hellwig

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=20210720093748.180714-2-preichl@redhat.com \
    --to=preichl@redhat.com \
    --cc=cem@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /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).