public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Ratchov <alexandre.ratchov@bull.net>
To: linux-ext4@vger.kernel.org
Cc: Jean-Pierre Dion <jean-pierre.dion@bull.net>
Subject: [patch 05/12] rfc: 2fsprogs update
Date: Tue, 26 Sep 2006 16:47:44 +0200	[thread overview]
Message-ID: <20060926144744.GE25755@openx1.frec.bull.fr> (raw)
In-Reply-To: <20060926143343.GA20020@openx1.frec.bull.fr>

Allow htree directories to be extent mapped.

Index: e2fsprogs/e2fsck/pass1.c
===================================================================
--- e2fsprogs.orig/e2fsck/pass1.c	2006-07-10 03:45:19.000000000 -0600
+++ e2fsprogs/e2fsck/pass1.c	2006-07-10 03:47:55.000000000 -0600
@@ -1364,10 +1364,23 @@ clear_extattr:
 	return 0;
 }
 
+static int htree_blk_iter_cb(ext2_filsys fs EXT2FS_ATTR((unused)),
+			     blk_t *blocknr,
+			     e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)),
+			     blk_t ref_blk EXT2FS_ATTR((unused)),
+			     int ref_offset EXT2FS_ATTR((unused)),
+			     void *priv_data)
+{
+	blk_t *blk = priv_data;
+
+	*blk = *blocknr;
+
+	return BLOCK_ABORT;
+}
+
 /* Returns 1 if bad htree, 0 if OK */
 static int handle_htree(e2fsck_t ctx, struct problem_context *pctx,
-			ext2_ino_t ino EXT2FS_ATTR((unused)),
-			struct ext2_inode *inode,
+			ext2_ino_t ino, struct ext2_inode *inode,
 			char *block_buf)
 {
 	struct ext2_dx_root_info	*root;
@@ -1381,7 +1394,8 @@ static int handle_htree(e2fsck_t ctx, st
 	     fix_problem(ctx, PR_1_HTREE_SET, pctx)))
 		return 1;
 
-	blk = inode->i_block[0];
+	ext2fs_block_iterate2(fs, ino, BLOCK_FLAG_DATA_ONLY | BLOCK_FLAG_HOLE,
+			      block_buf, htree_blk_iter_cb, &blk);
 	if (((blk == 0) ||
 	     (blk < fs->super->s_first_data_block) ||
 	     (blk >= fs->super->s_blocks_count)) &&

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.

  parent reply	other threads:[~2006-09-26 14:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-26 14:33 rfc: 2fsprogs update Alexandre Ratchov
2006-09-26 14:45 ` [patch 02/12] " Alexandre Ratchov
2006-09-26 14:46 ` [patch 03/12] " Alexandre Ratchov
2006-09-26 14:47 ` [patch 04/12] " Alexandre Ratchov
2006-09-26 17:32   ` Theodore Tso
2006-09-26 19:54     ` Andreas Dilger
2006-09-26 21:16       ` Theodore Tso
2006-09-27 12:59     ` Alexandre Ratchov
2006-09-27 14:10       ` Theodore Tso
2006-09-26 14:47 ` Alexandre Ratchov [this message]
2006-09-26 14:48 ` [patch 06/12] " Alexandre Ratchov
2006-09-26 14:48 ` [patch 07/12] " Alexandre Ratchov
2006-09-26 17:37   ` Theodore Tso
2006-09-27 13:36     ` Alexandre Ratchov
2006-09-27 14:38       ` Theodore Tso
2006-09-26 14:49 ` [patch 08/12] " Alexandre Ratchov
2006-09-26 14:50 ` [patch 10/12] " Alexandre Ratchov
2006-09-26 14:50 ` [patch 11/12] " Alexandre Ratchov
2006-09-26 14:50 ` [patch 12/12] " Alexandre Ratchov
2006-09-26 16:47 ` Alexandre Ratchov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060926144744.GE25755@openx1.frec.bull.fr \
    --to=alexandre.ratchov@bull.net \
    --cc=jean-pierre.dion@bull.net \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox