Andreas Dilger wrote:
> 
> What you are missing is the updates to
> the quota file(s).

Thanks!  Here she is:

/*
 * akpm: how many blocks doth make a writepage()?
 *
 * With N blocks per page, it may be:
 * N data blocks
 * 2 indirect block
 * 2 dindirect
 * 1 tindirect
 * N+5 bitmap blocks (from the above)
 * N+5 group descriptor summary blocks
 * 1 inode block
 * 1 superblock.
 * 2 * EXT3_SINGLEDATA_TRANS_BLOCKS for the quote files
 *
 * 3 * (N + 5) + 2 + 2 * EXT3_SINGLEDATA_TRANS_BLOCKS
 *
 * With ordered or writeback data it's the same, less the N data blocks.
 *
 * If the inode's direct blocks can hold an integral number of pages then a
 * page cannot straddle two indirect blocks, and we can only touch one indirect
 * and dindirect block, and the "5" above becomes "3".
 *
 * This still overestimates under some circumstances.  If we were to pass the
 * start and end offsets in here as well we could do block_to_path() on each block
 * and work out the exact number of indirects which are touched.  Pah.
 */

int ext3_writepage_trans_blocks(struct inode *inode)
{
        int bpp = jfs_blocks_per_page(inode);
        int indirects = (EXT3_NDIR_BLOCKS % bpp) ? 5 : 3;
        int ret;
        
        if (ext3_should_journal_data(inode))
                ret = 3 * (bpp + indirects) + 2;
        else
                ret = 2 * (bpp + indirects) + 2;

#ifdef CONFIG_QUOTA
        if (sb_any_quota_enabled(inode->i_sb))
                ret += 2 * EXT3_SINGLEDATA_TRANS_BLOCKS;
#endif

        return ret;
}

> > [ BH_* bits ]
>
> I guess it depends on what the goal is.  Since the JFS code is right
> inside the buffer layer, we definitely don't want to have conflicting
> BH_* bits with the reiserfs code.  I have worked up some patches to
> move the reiserfs BH_* bits into fs.h, so that at least the rest of
> the world knows about it.  The other solution is to declare certain
> bits "fs private" to avoid reusing them.  It gets messy however...

How about, in fs.h:

  #define BH_Req          3       /* 0 if the buffer has been invalidated */
  #define BH_Mapped       4       /* 1 if the buffer has a disk mapping */
  #define BH_New          5       /* 1 if the buffer is new and not yet written out */
  #define BH_Protected    6       /* 1 if the buffer is protected */
+ #define BH_FSPrivate    7

And then in foo_fs.h:

#define BH_Foo1 (BH_FSPrivate)
#define BH_Foo2 (BH_FSPrivate+1)

?

> 
> > Question: It may be useful to prevent simultaneous commits
> > against different partitions on the same disk.  How does one
> > determine this, given an in-core superblock?  Presumably,
> > comparing majors isn't enough.
> 
> Probably not worth the effort (breaks separation between filesystems),
> and in the end with meta devices it is really hard to determine this.
> Meta devices will all have the same major, but may be many-to-one or
> one-to-many for volume-to-disk mappings.

mm.. I do have a global list of journal_t's now.  For doing global
things like shrink_journal_memory().  This is not used in anger yet,
but I do fear that as kjournald blocks until the commit record
completes, we could get congestion when there are many kjournald's
all competing for the same disk head.  Think of a 100 gig drive...

Anyway.  It won't be rocket science to serialise the kjournald
instance's commits.  Testing will tell.

Current patch is at

        http://www.zip.com.au/~akpm/11May01-ext3-akpm.patch.gz

This is a working filesystem!

I'll spend tomorrow generally pulling out development cruft and
putting things in the right place in preparation for CVS.
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]

Reply via email to