From patchwork Wed Jun 15 06:37:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kazuya Mio X-Patchwork-Id: 100486 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 1E414B6F8C for ; Wed, 15 Jun 2011 16:42:42 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753059Ab1FOGml (ORCPT ); Wed, 15 Jun 2011 02:42:41 -0400 Received: from TYO202.gate.nec.co.jp ([202.32.8.206]:64767 "EHLO tyo202.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753007Ab1FOGmk (ORCPT ); Wed, 15 Jun 2011 02:42:40 -0400 Received: from mailgate3.nec.co.jp ([10.7.69.197]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id p5F6gbpb000106; Wed, 15 Jun 2011 15:42:37 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id p5F6gbV04797; Wed, 15 Jun 2011 15:42:37 +0900 (JST) Received: from mail03.kamome.nec.co.jp (mail03.kamome.nec.co.jp [10.25.43.7]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id p5F6gavY014826; Wed, 15 Jun 2011 15:42:36 +0900 (JST) Received: from saigo.jp.nec.com ([10.26.220.6] [10.26.220.6]) by mail02.kamome.nec.co.jp with ESMTP id BT-MMP-1577272; Wed, 15 Jun 2011 15:37:08 +0900 Received: from [10.64.168.30] ([10.64.168.30] [10.64.168.30]) by mail.jp.nec.com with ESMTP; Wed, 15 Jun 2011 15:37:07 +0900 Message-ID: <4DF85313.7000404@sx.jp.nec.com> Date: Wed, 15 Jun 2011 15:37:07 +0900 From: Kazuya Mio User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; ja; rv:1.9.2.18) Gecko/20110613 Thunderbird/3.1.11 MIME-Version: 1.0 To: ext4 , Theodore Tso Subject: [PATCH 08/11 RESEND] e4defrag: Use blk64_t instead of ext4_fsblk_t Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org e2fsprogs has blk64_t defined for the physical block number. e4defrag uses it instead of ext4_fsblk_t. Signed-off-by: Kazuya Mio --- misc/e4defrag.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;