From patchwork Tue Feb 3 19:56:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valerie Aurora Henson X-Patchwork-Id: 21789 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.176.167]) by ozlabs.org (Postfix) with ESMTP id BB80FDDF1A for ; Wed, 4 Feb 2009 06:56:51 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751932AbZBCT4t (ORCPT ); Tue, 3 Feb 2009 14:56:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751936AbZBCT4t (ORCPT ); Tue, 3 Feb 2009 14:56:49 -0500 Received: from mx1.redhat.com ([66.187.233.31]:48223 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751932AbZBCT4t (ORCPT ); Tue, 3 Feb 2009 14:56:49 -0500 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n13JulnR011370; Tue, 3 Feb 2009 14:56:47 -0500 Received: from shell.devel.redhat.com (shell.devel.redhat.com [10.10.36.195]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n13Juluh022238; Tue, 3 Feb 2009 14:56:47 -0500 Received: from shell.devel.redhat.com (localhost.localdomain [127.0.0.1]) by shell.devel.redhat.com (8.13.8/8.13.8) with ESMTP id n13JujmX009631; Tue, 3 Feb 2009 14:56:45 -0500 Received: (from vaurora@localhost) by shell.devel.redhat.com (8.13.8/8.13.8/Submit) id n13Jujh8009630; Tue, 3 Feb 2009 14:56:45 -0500 X-Authentication-Warning: shell.devel.redhat.com: vaurora set sender to vaurora@redhat.com using -f Date: Tue, 3 Feb 2009 14:56:45 -0500 From: Valerie Aurora Henson To: linux-ext4@vger.kernel.org Cc: Theodore Tso , Nick Dokos Subject: Using libext2fs in libe2p? Message-ID: <20090203195645.GG20654@shell> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.4.2.2i X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Nick Dokos noticed that libe2p now depends on libext2fs in the 64-bit tree, since we use ext2fs_blocks_count() and friends (see diff below). Possible solutions: Link libext2fs with libe2p Open code 64-bit block counts Require users of libe2p to link with libext2fs Move ext2fs_blocks_count() and friends into a header file and inline them I am agnostic. -VAL --- 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/lib/e2p/ls.c b/lib/e2p/ls.c index 6d2ce70..1923793 100644 --- a/lib/e2p/ls.c +++ b/lib/e2p/ls.c @@ -20,6 +20,7 @@ #include #include "e2p.h" +#include "ext2fs/ext2fs.h" static void print_user (unsigned short uid, FILE *f) { @@ -219,9 +220,9 @@ void list_super2(struct ext2_super_block * sb, FILE *f) fprintf(f, "Filesystem OS type: %s\n", str); free(str); fprintf(f, "Inode count: %u\n", sb->s_inodes_count); - fprintf(f, "Block count: %u\n", sb->s_blocks_count); - fprintf(f, "Reserved block count: %u\n", sb->s_r_blocks_count); - fprintf(f, "Free blocks: %u\n", sb->s_free_blocks_count); + fprintf(f, "Block count: %llu\n", ext2fs_blocks_count(sb)); + fprintf(f, "Reserved block count: %llu\n", ext2fs_r_blocks_count(sb)); + fprintf(f, "Free blocks: %llu\n", ext2fs_free_blocks_count(sb)); fprintf(f, "Free inodes: %u\n", sb->s_free_inodes_count); fprintf(f, "First block: %u\n", sb->s_first_data_block); fprintf(f, "Block size: %u\n", EXT2_BLOCK_SIZE(sb));