All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: linux-ext4@vger.kernel.org
Cc: Mingming Cao <cmm@us.ibm.com>,
	Takashi Sato <t-sato@yk.jp.nec.com>,
	Akira Fujita <a-fujita@rs.jp.nec.com>
Subject: Replace iget with iget_locked in defrag-free-space-fragementation
Date: Sat, 02 Feb 2008 11:40:23 -0500	[thread overview]
Message-ID: <E1JLLPj-0006dq-9C@closure.thunk.org> (raw)


FYI, since iget() is going to be disappearing in 2.6.25, and akpm has
disabled ext4 in the -mm tree as a result, I'm folding the following
patch into the defrag-free-space-fragmentation.patch in the ext4 tree.

We also have an issue where the read-only bind patches from Dave Hansen
are making changes which conflict with the ext4 patch tree, which is
making akpm very grumpy.  I'll try to take a look at this later in the
weekend...

						- Ted

diff --git a/fs/ext4/defrag.c b/fs/ext4/defrag.c
index d9a14e4..6370fb8 100644
--- a/fs/ext4/defrag.c
+++ b/fs/ext4/defrag.c
@@ -287,9 +287,13 @@ static int ext4_ext_extents_info(struct ext4_extents_info *ext_info,
 	int entries = 0;
 	int err = 0;
 
-	inode = iget(sb, ext_info->ino);
+	inode = iget_locked(sb, ext_info->ino);
 	if (!inode)
 		return -EACCES;
+	if (inode->i_state & I_NEW) {
+		sb->s_op->read_inode(inode);
+		unlock_new_inode(inode);
+	}
 
 	down_write(&EXT4_I(inode)->i_data_sem);
 
@@ -588,9 +592,13 @@ static int ext4_ext_defrag_victim(struct file *target_filp,
 	ext.len = 0;
 
 	/* Get the inode of the victim file */
-	victim_inode = iget(sb, ex_info->ino);
+	victim_inode = iget_locked(sb, ex_info->ino);
 	if (!victim_inode)
 		return -EACCES;
+	if (victim_inode->i_state & I_NEW) {
+		sb->s_op->read_inode(victim_inode);
+		unlock_new_inode(victim_inode);
+	}
 
 	/* Setup file for the victim file */
 	victim_dent.d_inode = victim_inode;

             reply	other threads:[~2008-02-02 16:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-02 16:40 Theodore Ts'o [this message]
2008-02-06  0:54 ` Replace iget with iget_locked in defrag-free-space-fragementation Mingming Cao
2008-02-06  0:55 ` Mingming Cao
2008-02-06  3:28   ` Theodore Tso

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=E1JLLPj-0006dq-9C@closure.thunk.org \
    --to=tytso@mit.edu \
    --cc=a-fujita@rs.jp.nec.com \
    --cc=cmm@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=t-sato@yk.jp.nec.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.