All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kazuya Mio <k-mio@sx.jp.nec.com>
To: ext4 <linux-ext4@vger.kernel.org>, Theodore Tso <tytso@mit.edu>
Subject: [PATCH 08/11 RESEND] e4defrag: Use blk64_t instead of ext4_fsblk_t
Date: Wed, 15 Jun 2011 15:37:07 +0900	[thread overview]
Message-ID: <4DF85313.7000404@sx.jp.nec.com> (raw)

e2fsprogs has blk64_t defined for the physical block number. e4defrag uses it
instead of ext4_fsblk_t.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
---
 misc/e4defrag.c |   19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/misc/e4defrag.c b/misc/e4defrag.c
index ba0d424..6365103 100644
--- a/misc/e4defrag.c
+++ b/misc/e4defrag.c
@@ -41,6 +41,7 @@
 
 #include "e2p/e2p.h"
 #include "ext2fs/ext2_types.h"
+#include "ext2fs/ext2fs.h"
 #include "ext2fs/fiemap.h"
 
 /* A relatively new ioctl interface ... */
@@ -111,13 +112,10 @@
 #define NGMSG_LOST_FOUND	"Can not process \"lost+found\""
 #define NGMSG_EXT_FORMAT	"File is not extent format"
 
-/* Data type for filesystem-wide blocks number */
-typedef unsigned long long ext4_fsblk_t;
-
 struct fiemap_extent_data {
 	__u64 len;			/* blocks count */
 	__u64 logical;		/* start logical block number */
-	ext4_fsblk_t physical;		/* start physical block number */
+	blk64_t physical;		/* start physical block number */
 };
 
 struct fiemap_extent_list {
@@ -461,9 +459,9 @@ static int defrag_fadvise(int fd, struct move_extent defrag_data,
  * @file:		file name.
  * @blk_count:		file blocks.
  */
-static int check_free_size(int fd, const char *file, ext4_fsblk_t blk_count)
+static int check_free_size(int fd, const char *file, blk64_t blk_count)
 {
-	ext4_fsblk_t	free_blk_count;
+	blk64_t		free_blk_count;
 	struct statfs64	fsbuf;
 	uid_t		current_uid = getuid();
 
@@ -521,8 +519,7 @@ static int file_frag_count(int fd)
  * @extents:		file extents.
  * @blk_count:		file blocks.
  */
-static int file_check(int fd, const char *file, int extents,
-					ext4_fsblk_t blk_count)
+static int file_check(int fd, const char *file, int extents, blk64_t blk_count)
 {
 	int	ret;
 	struct flock	lock;
@@ -761,9 +758,9 @@ static int get_exts_count(struct fiemap_extent_list *ext_list_head)
  *
  * @ext_list_head:	the extent list head of the target file
  */
-static ext4_fsblk_t get_file_blocks(struct fiemap_extent_list *ext_list_head)
+static blk64_t get_file_blocks(struct fiemap_extent_list *ext_list_head)
 {
-	ext4_fsblk_t blk_count = 0;
+	blk64_t blk_count = 0;
 	struct fiemap_extent_list *ext_list_tmp = ext_list_head;
 
 	do {
@@ -954,7 +951,7 @@ static int file_defrag(const char *file, const struct stat64 *buf,
 	int	file_frags_start, file_frags_end;
 	char	tmp_inode_name[PATH_MAX + 8];
 	size_t	threshold;
-	ext4_fsblk_t			blk_count = 0;
+	blk64_t				blk_count = 0;
 	struct fiemap_extent_list	*orig_list = NULL;
 	struct fiemap_extent_list	*donor_list = NULL;
 	struct fiemap_extent_group	*orig_group_head = NULL;

             reply	other threads:[~2011-06-15  6:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-15  6:37 Kazuya Mio [this message]
2011-06-16  3:19 ` [PATCH 08/11 RESEND] e4defrag: Use blk64_t instead of ext4_fsblk_t Andreas Dilger

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=4DF85313.7000404@sx.jp.nec.com \
    --to=k-mio@sx.jp.nec.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.