[PATCH] ext3 should use uint for internal inode containers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Talking to sct, he'd prefer to see ext3 continue to use only uints for inode number containers which are internal to the filesystem, since the filesystem itself can only do 32-bit inode numbers (on-disk format restriction), and uint is always 32, while ulong is sometimes 64. So, this patch bumps the unsigned longs from ext3-inode-numbers-are-unsigned-long.patch back down to unsigned ints.

(this patch applies over that one)

Thanks,

-Eric

Signed-off-by: Eric Sandeen <[email protected]>

diff -u a/fs/ext3/ialloc.c linux-2.6.17/fs/ext3/ialloc.c
--- a/fs/ext3/ialloc.c
+++ linux-2.6.17/fs/ext3/ialloc.c
@@ -202,7 +202,7 @@
static int find_group_dir(struct super_block *sb, struct inode *parent)
{
	int ngroups = EXT3_SB(sb)->s_groups_count;
-	unsigned long freei, avefreei;
+	unsigned int freei, avefreei;
	struct ext3_group_desc *desc, *best_desc = NULL;
	struct buffer_head *bh;
	int group, best_group = -1;
@@ -261,10 +261,10 @@
	struct ext3_super_block *es = sbi->s_es;
	int ngroups = sbi->s_groups_count;
	int inodes_per_group = EXT3_INODES_PER_GROUP(sb);
-	unsigned long freei, avefreei;
+	unsigned int freei, avefreei;
	ext3_fsblk_t freeb, avefreeb;
	ext3_fsblk_t blocks_per_dir;
-	unsigned long ndirs;
+	unsigned int ndirs;
	int max_debt, max_dirs, min_inodes;
	ext3_grpblk_t min_blocks;
	int group = -1, i;
diff -u a/fs/ext3/super.c linux-2.6.17/fs/ext3/super.c
--- a/fs/ext3/super.c
+++ linux-2.6.17/fs/ext3/super.c
@@ -45,7 +45,7 @@
static int ext3_load_journal(struct super_block *, struct ext3_super_block *,
			     unsigned long journal_devnum);
static int ext3_create_journal(struct super_block *, struct ext3_super_block *,
-			       unsigned long);
+			       unsigned int);
static void ext3_commit_super (struct super_block * sb,
			       struct ext3_super_block * es,
			       int sync);
@@ -711,7 +711,7 @@
}

static int parse_options (char *options, struct super_block *sb,
-			  unsigned long *inum, unsigned long *journal_devnum,
+			  unsigned int *inum, unsigned long *journal_devnum,
			  ext3_fsblk_t *n_blocks_count, int is_remount)
{
	struct ext3_sb_info *sbi = EXT3_SB(sb);
@@ -1353,7 +1353,7 @@
	ext3_fsblk_t sb_block = get_sb_block(&data);
	ext3_fsblk_t logic_sb_block;
	unsigned long offset = 0;
-	unsigned long journal_inum = 0;
+	unsigned int journal_inum = 0;
	unsigned long journal_devnum = 0;
	unsigned long def_mount_opts;
	struct inode *root;
@@ -1803,7 +1803,7 @@
}

static journal_t *ext3_get_journal(struct super_block *sb,
-				   unsigned long journal_inum)
+				   unsigned int journal_inum)
{
	struct inode *journal_inode;
	journal_t *journal;
@@ -1938,7 +1938,7 @@
			     unsigned long journal_devnum)
{
	journal_t *journal;
-	unsigned long journal_inum = le32_to_cpu(es->s_journal_inum);
+	unsigned int journal_inum = le32_to_cpu(es->s_journal_inum);
	dev_t journal_dev;
	int err = 0;
	int really_read_only;
@@ -2024,7 +2024,7 @@

static int ext3_create_journal(struct super_block * sb,
			       struct ext3_super_block * es,
-			       unsigned long journal_inum)
+			       unsigned int journal_inum)
{
	journal_t *journal;

@@ -2037,7 +2037,7 @@
	if (!(journal = ext3_get_journal(sb, journal_inum)))
		return -EINVAL;

-	printk(KERN_INFO "EXT3-fs: creating new journal on inode %lu\n",
+	printk(KERN_INFO "EXT3-fs: creating new journal on inode %u\n",
	       journal_inum);

	if (journal_create(journal)) {


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux