linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Replace iget with iget_locked in defrag-free-space-fragementation
@ 2008-02-02 16:40 Theodore Ts'o
  2008-02-06  0:54 ` Mingming Cao
  2008-02-06  0:55 ` Mingming Cao
  0 siblings, 2 replies; 4+ messages in thread
From: Theodore Ts'o @ 2008-02-02 16:40 UTC (permalink / raw)
  To: linux-ext4; +Cc: Mingming Cao, Takashi Sato, Akira Fujita


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;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: Replace iget with iget_locked in defrag-free-space-fragementation
  2008-02-02 16:40 Replace iget with iget_locked in defrag-free-space-fragementation Theodore Ts'o
@ 2008-02-06  0:54 ` Mingming Cao
  2008-02-06  0:55 ` Mingming Cao
  1 sibling, 0 replies; 4+ messages in thread
From: Mingming Cao @ 2008-02-06  0:54 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: linux-ext4, Takashi Sato, Akira Fujita

On Sat, 2008-02-02 at 11:40 -0500, Theodore Ts'o wrote:
> 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.
> 
> 
I noticed that you have merged the changes in the patch queue...

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);
> 
read_inode() also sunset, as removed in 
http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.24/2.6.24-mm1/broken-out/iget-remove-iget-and-the-read_inode-super-op-as.patch

so above changes won't compile in mm tree.

I have fixed it in patch queue, using ext4_iget() to replace iget() and read-inode() as suggested in iget-stop-ext4-from-using-iget-and-read_inode-try.patch 

http://repo.or.cz/w/ext4-patch-queue.git?a=blob;f=ext4-online-defrag-iget-read-inode-fix.patch;h=94660ca7371680fcd02bb5804016b4cae4f20846;hb=85589744f9d53579a12aa463ccd42fb450aec786

> 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
> 



> @@ -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;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Replace iget with iget_locked in defrag-free-space-fragementation
  2008-02-02 16:40 Replace iget with iget_locked in defrag-free-space-fragementation Theodore Ts'o
  2008-02-06  0:54 ` Mingming Cao
@ 2008-02-06  0:55 ` Mingming Cao
  2008-02-06  3:28   ` Theodore Tso
  1 sibling, 1 reply; 4+ messages in thread
From: Mingming Cao @ 2008-02-06  0:55 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: linux-ext4, Takashi Sato, Akira Fujita

On Sat, 2008-02-02 at 11:40 -0500, Theodore Ts'o wrote:
> 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

BTW, Ted, could you clarify about this one? I am able to build the patch
queue on akpm's 2.6.24-mm1 tree with Dave Hansen's read-only bind
changes. Maybe I missed something.

Mingming

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Replace iget with iget_locked in defrag-free-space-fragementation
  2008-02-06  0:55 ` Mingming Cao
@ 2008-02-06  3:28   ` Theodore Tso
  0 siblings, 0 replies; 4+ messages in thread
From: Theodore Tso @ 2008-02-06  3:28 UTC (permalink / raw)
  To: Mingming Cao; +Cc: linux-ext4, Takashi Sato, Akira Fujita

On Tue, Feb 05, 2008 at 04:55:52PM -0800, Mingming Cao wrote:
> On Sat, 2008-02-02 at 11:40 -0500, Theodore Ts'o wrote:
> > 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
> 
> BTW, Ted, could you clarify about this one? I am able to build the patch
> queue on akpm's 2.6.24-mm1 tree with Dave Hansen's read-only bind
> changes. Maybe I missed something.

That's because I've already removed the BKL patches that conflict.

       	       	    	    	    	    - Ted

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-02-06  3:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-02 16:40 Replace iget with iget_locked in defrag-free-space-fragementation Theodore Ts'o
2008-02-06  0:54 ` Mingming Cao
2008-02-06  0:55 ` Mingming Cao
2008-02-06  3:28   ` Theodore Tso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).