linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Carlos Maiolino <cmaiolino@redhat.com>
To: linux-fsdevel@vger.kernel.org
Cc: sandeen@redhat.com, hch@lst.de, david@fromorbit.com,
	darrick.wong@oracle.com
Subject: [PATCH 09/20] f2fs: Remove direct usage of fiemap_extent_info
Date: Tue, 30 Oct 2018 14:18:12 +0100	[thread overview]
Message-ID: <20181030131823.29040-10-cmaiolino@redhat.com> (raw)
In-Reply-To: <20181030131823.29040-1-cmaiolino@redhat.com>

struct fiemap-extent_info will be gone on future patches, remove its direct usage
from f2fs

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
---
 fs/f2fs/data.c   | 22 +++++++++++++---------
 fs/f2fs/f2fs.h   |  4 +---
 fs/f2fs/inline.c | 10 +++++++---
 3 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index c552e2d1dfbb..8ce60b5954d8 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1327,8 +1327,7 @@ static inline loff_t blk_to_logical(struct inode *inode, sector_t blk)
 	return (blk << inode->i_blkbits);
 }
 
-static int f2fs_xattr_fiemap(struct inode *inode,
-				struct fiemap_extent_info *fieinfo)
+static int f2fs_xattr_fiemap(struct inode *inode, struct fiemap_ctx *f_ctx)
 {
 	struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
 	struct page *page;
@@ -1367,7 +1366,10 @@ static int f2fs_xattr_fiemap(struct inode *inode,
 		if (!xnid)
 			flags |= FIEMAP_EXTENT_LAST;
 
-		err = fiemap_fill_next_extent(fieinfo, 0, phys, len, flags);
+		err = fiemap_fill_next_extent(
+				(struct fiemap_extent_info *)f_ctx->fc_data,
+				0, phys, len, flags);
+
 		if (err || err == 1)
 			return err;
 	}
@@ -1392,14 +1394,15 @@ static int f2fs_xattr_fiemap(struct inode *inode,
 	}
 
 	if (phys)
-		err = fiemap_fill_next_extent(fieinfo, 0, phys, len, flags);
+		err = fiemap_fill_next_extent(
+				(struct fiemap_extent_info *)f_ctx->fc_data,
+				0, phys, len, flags);
 
 	return (err < 0 ? err : 0);
 }
 
 int f2fs_fiemap(struct inode *inode, struct fiemap_ctx *f_ctx)
 {
-	struct fiemap_extent_info *fieinfo = f_ctx->fc_data;
 	u64 start = f_ctx->fc_start;
 	u64 len = f_ctx->fc_len;
 	struct buffer_head map_bh;
@@ -1422,12 +1425,12 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_ctx *f_ctx)
 	inode_lock(inode);
 
 	if (f_ctx->fc_flags & FIEMAP_FLAG_XATTR) {
-		ret = f2fs_xattr_fiemap(inode, fieinfo);
+		ret = f2fs_xattr_fiemap(inode, f_ctx);
 		goto out;
 	}
 
 	if (f2fs_has_inline_data(inode)) {
-		ret = f2fs_inline_data_fiemap(inode, fieinfo, start, len);
+		ret = f2fs_inline_data_fiemap(inode, f_ctx);
 		if (ret != -EAGAIN)
 			goto out;
 	}
@@ -1462,8 +1465,9 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_ctx *f_ctx)
 		if (f2fs_encrypted_inode(inode))
 			flags |= FIEMAP_EXTENT_DATA_ENCRYPTED;
 
-		ret = fiemap_fill_next_extent(fieinfo, logical,
-				phys, size, flags);
+		ret = fiemap_fill_next_extent(
+				(struct fiemap_extent_info *)f_ctx->fc_data,
+				logical, phys, size, flags);
 	}
 
 	if (start_blk > last_blk || ret)
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 185bb39dd82c..5e4e323ea4c6 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -3354,9 +3354,7 @@ void f2fs_delete_inline_entry(struct f2fs_dir_entry *dentry,
 bool f2fs_empty_inline_dir(struct inode *dir);
 int f2fs_read_inline_dir(struct file *file, struct dir_context *ctx,
 			struct fscrypt_str *fstr);
-int f2fs_inline_data_fiemap(struct inode *inode,
-			struct fiemap_extent_info *fieinfo,
-			__u64 start, __u64 len);
+int f2fs_inline_data_fiemap(struct inode *inode, struct fiemap_ctx *f_ctx);
 
 /*
  * shrinker.c
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 5c152fe08381..353a81317fac 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -671,9 +671,10 @@ int f2fs_read_inline_dir(struct file *file, struct dir_context *ctx,
 	return err < 0 ? err : 0;
 }
 
-int f2fs_inline_data_fiemap(struct inode *inode,
-		struct fiemap_extent_info *fieinfo, __u64 start, __u64 len)
+int f2fs_inline_data_fiemap(struct inode *inode, struct fiemap_ctx *f_ctx)
 {
+	u64 start = f_ctx->fc_start;
+	u64 len = f_ctx->fc_len;
 	__u64 byteaddr, ilen;
 	__u32 flags = FIEMAP_EXTENT_DATA_INLINE | FIEMAP_EXTENT_NOT_ALIGNED |
 		FIEMAP_EXTENT_LAST;
@@ -704,7 +705,10 @@ int f2fs_inline_data_fiemap(struct inode *inode,
 	byteaddr = (__u64)ni.blk_addr << inode->i_sb->s_blocksize_bits;
 	byteaddr += (char *)inline_data_addr(inode, ipage) -
 					(char *)F2FS_INODE(ipage);
-	err = fiemap_fill_next_extent(fieinfo, start, byteaddr, ilen, flags);
+	err = fiemap_fill_next_extent(
+			(struct fiemap_extent_info *)f_ctx->fc_data,
+			start, byteaddr, ilen, flags);
+
 out:
 	f2fs_put_page(ipage, 1);
 	return err;
-- 
2.17.1

  parent reply	other threads:[~2018-10-30 22:12 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-30 13:18 [PATCH 00/20] New ->fiemap infrastructure and ->bmap removal Carlos Maiolino
2018-10-30 13:18 ` [PATCH 01/20] fs: Enable bmap() function to properly return errors Carlos Maiolino
2018-10-30 13:18 ` [PATCH 02/20] cachefiles: drop direct usage of ->bmap method Carlos Maiolino
2018-10-30 13:18 ` [PATCH 03/20] ecryptfs: drop direct calls to ->bmap Carlos Maiolino
2018-11-16 15:40   ` Christoph Hellwig
2018-10-30 13:18 ` [PATCH 04/20] iomap: Rename fiemap_ctx to fiemap_iomap_ctx Carlos Maiolino
2018-11-16 15:44   ` Christoph Hellwig
2018-10-30 13:18 ` [PATCH 05/20] fs: Introduce fiemap_ctx data structure Carlos Maiolino
2018-11-16 15:46   ` Christoph Hellwig
2018-10-30 13:18 ` [PATCH 06/20] iomap: Update iomap_fiemap to use new fiemap_ctx structure Carlos Maiolino
2018-11-16 15:48   ` Christoph Hellwig
2018-10-30 13:18 ` [PATCH 07/20] fiemap: Move fiemap flags to fiemap_ctx Carlos Maiolino
2018-11-05 22:12   ` Andreas Dilger
2018-11-06  8:37     ` Carlos Maiolino
2018-11-16 15:50       ` Christoph Hellwig
2018-11-16 15:51   ` Christoph Hellwig
2018-10-30 13:18 ` [PATCH 08/20] ext4: Remove direct usage of fiemap_extent_info Carlos Maiolino
2018-11-05 22:13   ` Andreas Dilger
2018-11-06  8:49     ` Carlos Maiolino
2018-10-30 13:18 ` Carlos Maiolino [this message]
2018-10-31  6:10   ` [PATCH 09/20] f2fs: " Chao Yu
2018-10-30 13:18 ` [PATCH 10/20] Btrfs: " Carlos Maiolino
2018-10-30 13:18 ` [PATCH 11/20] nilfs2: " Carlos Maiolino
2018-10-30 13:18 ` [PATCH 12/20] ocfs2: " Carlos Maiolino
2018-10-30 13:18 ` [PATCH 13/20] iomap: " Carlos Maiolino
2018-10-30 13:18 ` [PATCH 14/20] fiemap: Use fiemap_ctx as fiemap_fill_next_extent argument Carlos Maiolino
2018-11-16 15:54   ` Christoph Hellwig
2018-10-30 13:18 ` [PATCH 15/20] fiemap: Start using new callback from fiemap_ctx Carlos Maiolino
2018-11-05 22:14   ` Andreas Dilger
2018-11-06  8:52     ` Carlos Maiolino
2018-11-16 15:55       ` Christoph Hellwig
2018-11-19 12:26         ` Carlos Maiolino
2018-11-16 15:57   ` Christoph Hellwig
2018-11-19 12:37     ` Carlos Maiolino
2018-10-30 13:18 ` [PATCH 16/20] fibmap: Use bmap instead of ->bmap method in ioctl_fibmap Carlos Maiolino
2018-11-16 15:58   ` Christoph Hellwig
2018-11-19 12:41     ` Carlos Maiolino
2018-10-30 13:18 ` [PATCH 17/20] fiemap: Get rid of fiemap_extent_info Carlos Maiolino
2018-11-05 22:14   ` Andreas Dilger
2018-11-06  8:56     ` Carlos Maiolino
2018-11-16 16:04   ` Christoph Hellwig
2018-11-19 12:47     ` Carlos Maiolino
2018-10-30 13:18 ` [PATCH 18/20] Use FIEMAP for FIBMAP calls Carlos Maiolino
2018-11-05 22:15   ` Andreas Dilger
2018-11-06  9:11     ` Carlos Maiolino
2018-11-16 16:06   ` Christoph Hellwig
2018-11-19 12:50     ` Carlos Maiolino
2018-11-20  8:53       ` Christoph Hellwig
2018-10-30 13:18 ` [PATCH 19/20] xfs: Get rid of ->bmap Carlos Maiolino
2018-10-30 13:18 ` [PATCH 20/20] ext4: Get rid of ->bmap interface Carlos Maiolino
2018-11-16 16:07   ` 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=20181030131823.29040-10-cmaiolino@redhat.com \
    --to=cmaiolino@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sandeen@redhat.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).