Re: [Patch 4/6]: ext3 reservations: Turn ext3 per-sb reservationslist into an rbtree.

From: Mingming Cao
Date: Wed Sep 08 2004 - 13:59:08 EST


On Wed, 2004-09-08 at 11:05, Stephen C. Tweedie wrote:
> Hi,
>
> On Tue, 2004-09-07 at 23:48, Andrew Morton wrote:
>
> > Takes this structure up to 32 bytes on x86. That's a moderate amount of
> > inode bloat for something which is only used when an application currently
> > has the inode open for writing.
> >
> > Have you given any thought to dynamic allocation of the above?
>
> No, none at all. <thinks>
>
> We already have an ext3 function that's called on all opens ---
> currently it checks nothing except O_LARGEFILE, but it's an easy and
> obvious place where we could set up the may-write bits.
>
Yes, we could add a check anout FMODE_WRITE and a check about
inode->i_writecount in ext3_open_file(), to just do reservation
structure allocation for the first writer of the inode.

> We'd have to take special care with directories, and potentially with
> xattrs, but I don't see any great problems with doing it.
>
> > And if we were to do that, there are a few things which we could move out
> > of the ext3 in-core inode and into the above structure, such as
> > i_next_alloc_block and i_next_alloc_goal.
>
> Yep.
>
> > Does the reservation code work for directory growth, btw?
>
> Yes, it should be hidden inside the allocation code, and should work
> straight out of the box for directories.

Yes, as you said, current reservation code could work for directories.
But we did not do reservation for directory right now because we don't
really sure whether it is worth doing it.

One thing is, if later we decide to make reservation per-fd instead of
per-inode, we probably need fd->private_data to store the per-fd
reservation structure. But this field is already been used by directory
for htree structures.


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