linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Czerner <lczerner@redhat.com>
To: linux-ext4@vger.kernel.org
Cc: gnehzuil.liu@gmail.com, tytso@mit.edu, dmonakhov@openvz.org,
	bergwolf@gmail.com, Lukas Czerner <lczerner@redhat.com>
Subject: [PATCH 2/2 v5] ext4: simple cleanup in fiemap codepath
Date: Wed, 21 Nov 2012 23:03:41 +0100	[thread overview]
Message-ID: <1353535421-25631-3-git-send-email-lczerner@redhat.com> (raw)
In-Reply-To: <1353535421-25631-1-git-send-email-lczerner@redhat.com>

This commit is simple cleanup of fiemap codepath which has not been
included in previous commit to make the changes clearer. In this commit
we rename cbex variable to newex in ext4_fill_fiemap_extents() because
callback is no longer present

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
v5: update description

 fs/ext4/extents.c |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index fbe7dc2..5625146 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -1967,7 +1967,7 @@ static int ext4_fill_fiemap_extents(struct inode *inode,
 				    struct fiemap_extent_info *fieinfo)
 {
 	struct ext4_ext_path *path = NULL;
-	struct ext4_ext_cache cbex;
+	struct ext4_ext_cache newex;
 	struct ext4_extent *ex;
 	ext4_lblk_t next, next_del, start = 0, end = 0;
 	ext4_lblk_t last = block + num;
@@ -2042,31 +2042,31 @@ static int ext4_fill_fiemap_extents(struct inode *inode,
 		BUG_ON(end <= start);
 
 		if (!exists) {
-			cbex.ec_block = start;
-			cbex.ec_len = end - start;
-			cbex.ec_start = 0;
+			newex.ec_block = start;
+			newex.ec_len = end - start;
+			newex.ec_start = 0;
 		} else {
-			cbex.ec_block = le32_to_cpu(ex->ee_block);
-			cbex.ec_len = ext4_ext_get_actual_len(ex);
-			cbex.ec_start = ext4_ext_pblock(ex);
+			newex.ec_block = le32_to_cpu(ex->ee_block);
+			newex.ec_len = ext4_ext_get_actual_len(ex);
+			newex.ec_start = ext4_ext_pblock(ex);
 			if (ext4_ext_is_uninitialized(ex))
 				flags |= FIEMAP_EXTENT_UNWRITTEN;
 		}
 
 		/*
-		 * Find delayed extent and update cbex accordingly. We call
-		 * it even in !exists case to find out whether cbex is the
+		 * Find delayed extent and update newex accordingly. We call
+		 * it even in !exists case to find out whether newex is the
 		 * last existing extent or not.
 		 */
-		next_del = ext4_find_delayed_extent(inode, &cbex);
+		next_del = ext4_find_delayed_extent(inode, &newex);
 		if (!exists && next_del) {
 			exists = 1;
 			flags |= FIEMAP_EXTENT_DELALLOC;
 		}
 		up_read(&EXT4_I(inode)->i_data_sem);
 
-		if (unlikely(cbex.ec_len == 0)) {
-			EXT4_ERROR_INODE(inode, "cbex.ec_len == 0");
+		if (unlikely(newex.ec_len == 0)) {
+			EXT4_ERROR_INODE(inode, "newex.ec_len == 0");
 			err = -EIO;
 			break;
 		}
@@ -2087,9 +2087,9 @@ static int ext4_fill_fiemap_extents(struct inode *inode,
 
 		if (exists) {
 			err = fiemap_fill_next_extent(fieinfo,
-				(__u64)cbex.ec_block << blksize_bits,
-				(__u64)cbex.ec_start << blksize_bits,
-				(__u64)cbex.ec_len << blksize_bits,
+				(__u64)newex.ec_block << blksize_bits,
+				(__u64)newex.ec_start << blksize_bits,
+				(__u64)newex.ec_len << blksize_bits,
 				flags);
 			if (err < 0)
 				break;
@@ -2099,7 +2099,7 @@ static int ext4_fill_fiemap_extents(struct inode *inode,
 			}
 		}
 
-		block = cbex.ec_block + cbex.ec_len;
+		block = newex.ec_block + newex.ec_len;
 	}
 
 	if (path) {
-- 
1.7.7.6


  parent reply	other threads:[~2012-11-22 19:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21 22:03 [PATCH 0/2 v5] ext4: Fix some fiemap problems Lukas Czerner
2012-11-21 22:03 ` [PATCH 1/2 v5] ext4: Prevent race while walking extent tree Lukas Czerner
2012-11-21 22:03 ` Lukas Czerner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-11-22  8:36 [PATCH 0/2 v5] Fix some fiemap problems Lukas Czerner
2012-11-22  8:36 ` [PATCH 2/2 v5] ext4: simple cleanup in fiemap codepath Lukas Czerner
2012-11-28 17:35   ` Theodore Ts'o

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=1353535421-25631-3-git-send-email-lczerner@redhat.com \
    --to=lczerner@redhat.com \
    --cc=bergwolf@gmail.com \
    --cc=dmonakhov@openvz.org \
    --cc=gnehzuil.liu@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).