aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColy Li <coyli@suse.de>2007-10-16 18:38:25 -0400
committerTheodore Ts'o <tytso@mit.edu>2007-10-17 18:49:59 -0400
commitf077d0d7ea5d65d01f2ce2e7131e964c13a32433 (patch)
tree17022250e65dd332ea6da88e70df7df3f27725dc
parent6f38c74f5a01c7bccf58f9d7ee47ea24fb45752f (diff)
ext4: Remove (partial, never completed) fragment support
Fragment support in ext2/3/4 was never implemented, and it probably will never be implemented. So remove it from ext4. Signed-off-by: Coly Li <coyli@suse.de> Acked-by: Andreas Dilger <adilger@clusterfs.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r--fs/ext4/ialloc.c5
-rw-r--r--fs/ext4/inode.c10
-rw-r--r--fs/ext4/super.c15
-rw-r--r--include/linux/ext4_fs.h35
-rw-r--r--include/linux/ext4_fs_i.h5
-rw-r--r--include/linux/ext4_fs_sb.h3
6 files changed, 6 insertions, 67 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index d0c7793d9393..38e9a0a705df 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -573,11 +573,6 @@ got:
573 /* dirsync only applies to directories */ 573 /* dirsync only applies to directories */
574 if (!S_ISDIR(mode)) 574 if (!S_ISDIR(mode))
575 ei->i_flags &= ~EXT4_DIRSYNC_FL; 575 ei->i_flags &= ~EXT4_DIRSYNC_FL;
576#ifdef EXT4_FRAGMENTS
577 ei->i_faddr = 0;
578 ei->i_frag_no = 0;
579 ei->i_frag_size = 0;
580#endif
581 ei->i_file_acl = 0; 576 ei->i_file_acl = 0;
582 ei->i_dir_acl = 0; 577 ei->i_dir_acl = 0;
583 ei->i_dtime = 0; 578 ei->i_dtime = 0;
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 0df2b1e06d0b..1685f6a87789 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2711,11 +2711,6 @@ void ext4_read_inode(struct inode * inode)
2711 } 2711 }
2712 inode->i_blocks = le32_to_cpu(raw_inode->i_blocks); 2712 inode->i_blocks = le32_to_cpu(raw_inode->i_blocks);
2713 ei->i_flags = le32_to_cpu(raw_inode->i_flags); 2713 ei->i_flags = le32_to_cpu(raw_inode->i_flags);
2714#ifdef EXT4_FRAGMENTS
2715 ei->i_faddr = le32_to_cpu(raw_inode->i_faddr);
2716 ei->i_frag_no = raw_inode->i_frag;
2717 ei->i_frag_size = raw_inode->i_fsize;
2718#endif
2719 ei->i_file_acl = le32_to_cpu(raw_inode->i_file_acl); 2714 ei->i_file_acl = le32_to_cpu(raw_inode->i_file_acl);
2720 if (EXT4_SB(inode->i_sb)->s_es->s_creator_os != 2715 if (EXT4_SB(inode->i_sb)->s_es->s_creator_os !=
2721 cpu_to_le32(EXT4_OS_HURD)) 2716 cpu_to_le32(EXT4_OS_HURD))
@@ -2860,11 +2855,6 @@ static int ext4_do_update_inode(handle_t *handle,
2860 raw_inode->i_blocks = cpu_to_le32(inode->i_blocks); 2855 raw_inode->i_blocks = cpu_to_le32(inode->i_blocks);
2861 raw_inode->i_dtime = cpu_to_le32(ei->i_dtime); 2856 raw_inode->i_dtime = cpu_to_le32(ei->i_dtime);
2862 raw_inode->i_flags = cpu_to_le32(ei->i_flags); 2857 raw_inode->i_flags = cpu_to_le32(ei->i_flags);
2863#ifdef EXT4_FRAGMENTS
2864 raw_inode->i_faddr = cpu_to_le32(ei->i_faddr);
2865 raw_inode->i_frag = ei->i_frag_no;
2866 raw_inode->i_fsize = ei->i_frag_size;
2867#endif
2868 if (EXT4_SB(inode->i_sb)->s_es->s_creator_os != 2858 if (EXT4_SB(inode->i_sb)->s_es->s_creator_os !=
2869 cpu_to_le32(EXT4_OS_HURD)) 2859 cpu_to_le32(EXT4_OS_HURD))
2870 raw_inode->i_file_acl_high = 2860 raw_inode->i_file_acl_high =
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 83f9cd358e5a..e2bdf93693a6 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1726,14 +1726,6 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
1726 if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) 1726 if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE)
1727 sb->s_time_gran = 1 << (EXT4_EPOCH_BITS - 2); 1727 sb->s_time_gran = 1 << (EXT4_EPOCH_BITS - 2);
1728 } 1728 }
1729 sbi->s_frag_size = EXT4_MIN_FRAG_SIZE <<
1730 le32_to_cpu(es->s_log_frag_size);
1731 if (blocksize != sbi->s_frag_size) {
1732 printk(KERN_ERR
1733 "EXT4-fs: fragsize %lu != blocksize %u (unsupported)\n",
1734 sbi->s_frag_size, blocksize);
1735 goto failed_mount;
1736 }
1737 sbi->s_desc_size = le16_to_cpu(es->s_desc_size); 1729 sbi->s_desc_size = le16_to_cpu(es->s_desc_size);
1738 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_64BIT)) { 1730 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_64BIT)) {
1739 if (sbi->s_desc_size < EXT4_MIN_DESC_SIZE_64BIT || 1731 if (sbi->s_desc_size < EXT4_MIN_DESC_SIZE_64BIT ||
@@ -1747,7 +1739,6 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
1747 } else 1739 } else
1748 sbi->s_desc_size = EXT4_MIN_DESC_SIZE; 1740 sbi->s_desc_size = EXT4_MIN_DESC_SIZE;
1749 sbi->s_blocks_per_group = le32_to_cpu(es->s_blocks_per_group); 1741 sbi->s_blocks_per_group = le32_to_cpu(es->s_blocks_per_group);
1750 sbi->s_frags_per_group = le32_to_cpu(es->s_frags_per_group);
1751 sbi->s_inodes_per_group = le32_to_cpu(es->s_inodes_per_group); 1742 sbi->s_inodes_per_group = le32_to_cpu(es->s_inodes_per_group);
1752 if (EXT4_INODE_SIZE(sb) == 0) 1743 if (EXT4_INODE_SIZE(sb) == 0)
1753 goto cantfind_ext4; 1744 goto cantfind_ext4;
@@ -1771,12 +1762,6 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
1771 sbi->s_blocks_per_group); 1762 sbi->s_blocks_per_group);
1772 goto failed_mount; 1763 goto failed_mount;
1773 } 1764 }
1774 if (sbi->s_frags_per_group > blocksize * 8) {
1775 printk (KERN_ERR
1776 "EXT4-fs: #fragments per group too big: %lu\n",
1777 sbi->s_frags_per_group);
1778 goto failed_mount;
1779 }
1780 if (sbi->s_inodes_per_group > blocksize * 8) { 1765 if (sbi->s_inodes_per_group > blocksize * 8) {
1781 printk (KERN_ERR 1766 printk (KERN_ERR
1782 "EXT4-fs: #inodes per group too big: %lu\n", 1767 "EXT4-fs: #inodes per group too big: %lu\n",
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h
index cdee7aaa57aa..3baeb996fd3f 100644
--- a/include/linux/ext4_fs.h
+++ b/include/linux/ext4_fs.h
@@ -105,20 +105,6 @@
105#define EXT4_BLOCK_ALIGN(size, blkbits) ALIGN((size), (1 << (blkbits))) 105#define EXT4_BLOCK_ALIGN(size, blkbits) ALIGN((size), (1 << (blkbits)))
106 106
107/* 107/*
108 * Macro-instructions used to manage fragments
109 */
110#define EXT4_MIN_FRAG_SIZE 1024
111#define EXT4_MAX_FRAG_SIZE 4096
112#define EXT4_MIN_FRAG_LOG_SIZE 10
113#ifdef __KERNEL__
114# define EXT4_FRAG_SIZE(s) (EXT4_SB(s)->s_frag_size)
115# define EXT4_FRAGS_PER_BLOCK(s) (EXT4_SB(s)->s_frags_per_block)
116#else
117# define EXT4_FRAG_SIZE(s) (EXT4_MIN_FRAG_SIZE << (s)->s_log_frag_size)
118# define EXT4_FRAGS_PER_BLOCK(s) (EXT4_BLOCK_SIZE(s) / EXT4_FRAG_SIZE(s))
119#endif
120
121/*
122 * Structure of a blocks group descriptor 108 * Structure of a blocks group descriptor
123 */ 109 */
124struct ext4_group_desc 110struct ext4_group_desc
@@ -311,27 +297,24 @@ struct ext4_inode {
311 __le32 i_generation; /* File version (for NFS) */ 297 __le32 i_generation; /* File version (for NFS) */
312 __le32 i_file_acl; /* File ACL */ 298 __le32 i_file_acl; /* File ACL */
313 __le32 i_dir_acl; /* Directory ACL */ 299 __le32 i_dir_acl; /* Directory ACL */
314 __le32 i_faddr; /* Fragment address */ 300 __le32 i_obso_faddr; /* Obsoleted fragment address */
315 union { 301 union {
316 struct { 302 struct {
317 __u8 l_i_frag; /* Fragment number */ 303 __le16 l_i_reserved1; /* Obsoleted fragment number/size which are removed in ext4 */
318 __u8 l_i_fsize; /* Fragment size */
319 __le16 l_i_file_acl_high; 304 __le16 l_i_file_acl_high;
320 __le16 l_i_uid_high; /* these 2 fields */ 305 __le16 l_i_uid_high; /* these 2 fields */
321 __le16 l_i_gid_high; /* were reserved2[0] */ 306 __le16 l_i_gid_high; /* were reserved2[0] */
322 __u32 l_i_reserved2; 307 __u32 l_i_reserved2;
323 } linux2; 308 } linux2;
324 struct { 309 struct {
325 __u8 h_i_frag; /* Fragment number */ 310 __le16 h_i_reserved1; /* Obsoleted fragment number/size which are removed in ext4 */
326 __u8 h_i_fsize; /* Fragment size */
327 __u16 h_i_mode_high; 311 __u16 h_i_mode_high;
328 __u16 h_i_uid_high; 312 __u16 h_i_uid_high;
329 __u16 h_i_gid_high; 313 __u16 h_i_gid_high;
330 __u32 h_i_author; 314 __u32 h_i_author;
331 } hurd2; 315 } hurd2;
332 struct { 316 struct {
333 __u8 m_i_frag; /* Fragment number */ 317 __le16 h_i_reserved1; /* Obsoleted fragment number/size which are removed in ext4 */
334 __u8 m_i_fsize; /* Fragment size */
335 __le16 m_i_file_acl_high; 318 __le16 m_i_file_acl_high;
336 __u32 m_i_reserved2[2]; 319 __u32 m_i_reserved2[2];
337 } masix2; 320 } masix2;
@@ -419,8 +402,6 @@ do { \
419 402
420#if defined(__KERNEL__) || defined(__linux__) 403#if defined(__KERNEL__) || defined(__linux__)
421#define i_reserved1 osd1.linux1.l_i_reserved1 404#define i_reserved1 osd1.linux1.l_i_reserved1
422#define i_frag osd2.linux2.l_i_frag
423#define i_fsize osd2.linux2.l_i_fsize
424#define i_file_acl_high osd2.linux2.l_i_file_acl_high 405#define i_file_acl_high osd2.linux2.l_i_file_acl_high
425#define i_uid_low i_uid 406#define i_uid_low i_uid
426#define i_gid_low i_gid 407#define i_gid_low i_gid
@@ -431,8 +412,6 @@ do { \
431#elif defined(__GNU__) 412#elif defined(__GNU__)
432 413
433#define i_translator osd1.hurd1.h_i_translator 414#define i_translator osd1.hurd1.h_i_translator
434#define i_frag osd2.hurd2.h_i_frag;
435#define i_fsize osd2.hurd2.h_i_fsize;
436#define i_uid_high osd2.hurd2.h_i_uid_high 415#define i_uid_high osd2.hurd2.h_i_uid_high
437#define i_gid_high osd2.hurd2.h_i_gid_high 416#define i_gid_high osd2.hurd2.h_i_gid_high
438#define i_author osd2.hurd2.h_i_author 417#define i_author osd2.hurd2.h_i_author
@@ -440,8 +419,6 @@ do { \
440#elif defined(__masix__) 419#elif defined(__masix__)
441 420
442#define i_reserved1 osd1.masix1.m_i_reserved1 421#define i_reserved1 osd1.masix1.m_i_reserved1
443#define i_frag osd2.masix2.m_i_frag
444#define i_fsize osd2.masix2.m_i_fsize
445#define i_file_acl_high osd2.masix2.m_i_file_acl_high 422#define i_file_acl_high osd2.masix2.m_i_file_acl_high
446#define i_reserved2 osd2.masix2.m_i_reserved2 423#define i_reserved2 osd2.masix2.m_i_reserved2
447 424
@@ -528,9 +505,9 @@ struct ext4_super_block {
528/*10*/ __le32 s_free_inodes_count; /* Free inodes count */ 505/*10*/ __le32 s_free_inodes_count; /* Free inodes count */
529 __le32 s_first_data_block; /* First Data Block */ 506 __le32 s_first_data_block; /* First Data Block */
530 __le32 s_log_block_size; /* Block size */ 507 __le32 s_log_block_size; /* Block size */
531 __le32 s_log_frag_size; /* Fragment size */ 508 __le32 s_obso_log_frag_size; /* Obsoleted fragment size */
532/*20*/ __le32 s_blocks_per_group; /* # Blocks per group */ 509/*20*/ __le32 s_blocks_per_group; /* # Blocks per group */
533 __le32 s_frags_per_group; /* # Fragments per group */ 510 __le32 s_obso_frags_per_group; /* Obsoleted fragments per group */
534 __le32 s_inodes_per_group; /* # Inodes per group */ 511 __le32 s_inodes_per_group; /* # Inodes per group */
535 __le32 s_mtime; /* Mount time */ 512 __le32 s_mtime; /* Mount time */
536/*30*/ __le32 s_wtime; /* Write time */ 513/*30*/ __le32 s_wtime; /* Write time */
diff --git a/include/linux/ext4_fs_i.h b/include/linux/ext4_fs_i.h
index 1a511e9905aa..86ddfe2089f3 100644
--- a/include/linux/ext4_fs_i.h
+++ b/include/linux/ext4_fs_i.h
@@ -78,11 +78,6 @@ struct ext4_ext_cache {
78struct ext4_inode_info { 78struct ext4_inode_info {
79 __le32 i_data[15]; /* unconverted */ 79 __le32 i_data[15]; /* unconverted */
80 __u32 i_flags; 80 __u32 i_flags;
81#ifdef EXT4_FRAGMENTS
82 __u32 i_faddr;
83 __u8 i_frag_no;
84 __u8 i_frag_size;
85#endif
86 ext4_fsblk_t i_file_acl; 81 ext4_fsblk_t i_file_acl;
87 __u32 i_dir_acl; 82 __u32 i_dir_acl;
88 __u32 i_dtime; 83 __u32 i_dtime;
diff --git a/include/linux/ext4_fs_sb.h b/include/linux/ext4_fs_sb.h
index 0a8e47d47c91..b40e827cd495 100644
--- a/include/linux/ext4_fs_sb.h
+++ b/include/linux/ext4_fs_sb.h
@@ -28,11 +28,8 @@
28 * third extended-fs super-block data in memory 28 * third extended-fs super-block data in memory
29 */ 29 */
30struct ext4_sb_info { 30struct ext4_sb_info {
31 unsigned long s_frag_size; /* Size of a fragment in bytes */
32 unsigned long s_desc_size; /* Size of a group descriptor in bytes */ 31 unsigned long s_desc_size; /* Size of a group descriptor in bytes */
33 unsigned long s_frags_per_block;/* Number of fragments per block */
34 unsigned long s_inodes_per_block;/* Number of inodes per block */ 32 unsigned long s_inodes_per_block;/* Number of inodes per block */
35 unsigned long s_frags_per_group;/* Number of fragments in a group */
36 unsigned long s_blocks_per_group;/* Number of blocks in a group */ 33 unsigned long s_blocks_per_group;/* Number of blocks in a group */
37 unsigned long s_inodes_per_group;/* Number of inodes in a group */ 34 unsigned long s_inodes_per_group;/* Number of inodes in a group */
38 unsigned long s_itb_per_group; /* Number of inode table blocks per group */ 35 unsigned long s_itb_per_group; /* Number of inode table blocks per group */