From patchwork Fri Apr 8 18:00:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 90402 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 12960B6F84 for ; Sat, 9 Apr 2011 04:00:32 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756856Ab1DHSAM (ORCPT ); Fri, 8 Apr 2011 14:00:12 -0400 Received: from mail-qw0-f46.google.com ([209.85.216.46]:41747 "EHLO mail-qw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757348Ab1DHSAI (ORCPT ); Fri, 8 Apr 2011 14:00:08 -0400 Received: by qwk3 with SMTP id 3so2241950qwk.19 for ; Fri, 08 Apr 2011 11:00:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to:cc :content-type; bh=rFVSn6I0O/oKHRzMgM8sVru/WCw/JM+Rm9MoeRY+vLI=; b=OJXadBJoovWRKih8FCX1EFkP1hpg/HS02JyEjiFKxDuZNI0S3vpGJC9ByfRRYGFpyq 7jHgbfa2g0/BppIEqv6pljwXkCxvzr1lxR+T4q4NhEstkfTLiRKEmZc29hAtZLlt6fjX 0lsEmohWrt6jszLtK4dyfnnB9ER00PgDSkjeg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=UmEOgyqpUIb/Qt0ceIhDJsKiPKhKwvJJzQCN3f2+cC6+wSVTjLyv0eSog/6Q1H8NU4 +lEdPf+fV2spDrgcOJutgv54QA9/1C0o4SYzqOWM7GsvaYxvazIczyNJNTr/p/qVRJte x6JeKIGtvlpOM8VrpFb+c3MZy6hsJ/ARyCrHs= MIME-Version: 1.0 Received: by 10.224.135.223 with SMTP id o31mr2084575qat.319.1302285607455; Fri, 08 Apr 2011 11:00:07 -0700 (PDT) Received: by 10.229.78.160 with HTTP; Fri, 8 Apr 2011 11:00:07 -0700 (PDT) Date: Fri, 8 Apr 2011 11:00:07 -0700 Message-ID: Subject: [RFC] exclude bitmap and 32bit bitmap cheksum fields From: Amir Goldstein To: Theodore Tso Cc: Ext4 Developers List Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hi Ted, Following our conversation, here is a proposal how to squeeze: - 32bit exclude bitmap block address - 32bit block+exclude bitmap checksum - 32bit inode bitmap checksum into the reaming 8 bytes in the group descriptor. The idea is that the 16bit persistent free inode/block counters are redundant to the inode/block bitmap information and are needed in 2 use cases: 1. sanity checks on fsck 2. quick load of in-memory counters The first use case is nulled by the introduction of inode/block bitmap checksums. The second use case can be bypassed with no substantial penalty: in-memory counters can be calculated on first inode/block bitmap access, when the GRP_NEED_INIT (or another) flag is set in the group_info struct, just like their cousins, the buddy bitmap counters. Amir. --- 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/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h index 0deb554..5cbaeb2 100644 --- a/lib/ext2fs/ext2_fs.h +++ b/lib/ext2fs/ext2_fs.h @@ -153,11 +153,11 @@ struct ext2_group_desc __u32 bg_block_bitmap; /* Blocks bitmap block */ __u32 bg_inode_bitmap; /* Inodes bitmap block */ __u32 bg_inode_table; /* Inodes table block */ - __u16 bg_free_blocks_count; /* Free blocks count */ - __u16 bg_free_inodes_count; /* Free inodes count */ + __u32 bg_exclude_bitmap; /* Exclude bitmap block */ __u16 bg_used_dirs_count; /* Directories count */ __u16 bg_flags; - __u32 bg_reserved[2]; + __u32 bg_block_bitmap_csum; /* Blocks+exclude bitmap checksum */ + __u32 bg_inode_bitmap_csum; /* Inodes bitmap checksum */ __u16 bg_itable_unused; /* Unused inodes count */ __u16 bg_checksum; /* crc16(s_uuid+grouo_num+group_desc)*/ }; @@ -170,18 +170,17 @@ struct ext4_group_desc __u32 bg_block_bitmap; /* Blocks bitmap block */ __u32 bg_inode_bitmap; /* Inodes bitmap block */ __u32 bg_inode_table; /* Inodes table block */ - __u16 bg_free_blocks_count; /* Free blocks count */ - __u16 bg_free_inodes_count; /* Free inodes count */ + __u32 bg_exclude_bitmap; /* Exclude bitmap block */ __u16 bg_used_dirs_count; /* Directories count */ __u16 bg_flags; - __u32 bg_reserved[2]; + __u32 bg_block_bitmap_csum; /* Blocks+exclude bitmap checksum */ + __u32 bg_inode_bitmap_csum; /* Inodes bitmap checksum */ __u16 bg_itable_unused; /* Unused inodes count */ __u16 bg_checksum; /* crc16(s_uuid+grouo_num+group_desc)*/ __u32 bg_block_bitmap_hi; /* Blocks bitmap block MSB */ __u32 bg_inode_bitmap_hi; /* Inodes bitmap block MSB */ __u32 bg_inode_table_hi; /* Inodes table block MSB */ - __u16 bg_free_blocks_count_hi;/* Free blocks count MSB */ - __u16 bg_free_inodes_count_hi;/* Free inodes count MSB */ + __u32 bg_exclude_bitmap; /* Exclude bitmap block MSB */ __u16 bg_used_dirs_count_hi; /* Directories count MSB */ __u16 bg_pad; __u32 bg_reserved2[3]; @@ -190,6 +189,7 @@ struct ext4_group_desc #define EXT2_BG_INODE_UNINIT 0x0001 /* Inode table/bitmap not initialized */ #define EXT2_BG_BLOCK_UNINIT 0x0002 /* Block bitmap not initialized */ #define EXT2_BG_INODE_ZEROED 0x0004 /* On-disk itable initialized to zero */ +#define EXT2_BG_EXCLUDE_UNINIT 0x0008 /* Exclude bitmap not initialized */ /* * Data structures used by the directory indexing feature @@ -751,6 +751,7 @@ struct ext2_super_block { #define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020 #define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040 #define EXT4_FEATURE_RO_COMPAT_HAS_SNAPSHOT 0x0080 +#define EXT4_FEATURE_RO_COMPAT_BITMAP_CSUM 0x0100 #define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001 #define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002