Re: getdents - ext4 vs btrfs performance
- Subject: Re: getdents - ext4 vs btrfs performance
- From: "Ted Ts'o" <tytso@xxxxxxx>
- Date: Wed, 14 Mar 2012 12:48:04 -0400
- Cc: Yongqiang Yang <xiaoqiangnk@xxxxxxxxx>, Phillip Susi <phillsusi@xxxxxxxxx>, Andreas Dilger <adilger@xxxxxxxxxxxxx>, Lukas Czerner <lczerner@xxxxxxxxxx>, Jacek Luczak <difrost.kernel@xxxxxxxxx>, "linux-ext4@xxxxxxxxxxxxxxx" <linux-ext4@xxxxxxxxxxxxxxx>, linux-fsdevel <linux-fsdevel@xxxxxxxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>, "linux-btrfs@xxxxxxxxxxxxxxx" <linux-btrfs@xxxxxxxxxxxxxxx>
- In-reply-to: <4F60A881.3070607@zabbo.net>
- Mail-followup-to: Ted Ts'o <tytso@xxxxxxx>, Zach Brown <zab@xxxxxxxxx>, Yongqiang Yang <xiaoqiangnk@xxxxxxxxx>, Phillip Susi <phillsusi@xxxxxxxxx>, Andreas Dilger <adilger@xxxxxxxxxxxxx>, Lukas Czerner <lczerner@xxxxxxxxxx>, Jacek Luczak <difrost.kernel@xxxxxxxxx>, "linux-ext4@xxxxxxxxxxxxxxx" <linux-ext4@xxxxxxxxxxxxxxx>, linux-fsdevel <linux-fsdevel@xxxxxxxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>, "linux-btrfs@xxxxxxxxxxxxxxx" <linux-btrfs@xxxxxxxxxxxxxxx>
- User-agent: Mutt/1.5.20 (2009-06-14)
On Wed, Mar 14, 2012 at 10:17:37AM -0400, Zach Brown wrote:
>
> >We could do this if we have two b-trees, one indexed by filename and
> >one indexed by inode number, which is what JFS (and I believe btrfs)
> >does.
>
> Typically the inode number of the destination inode isn't used to index
> entries for a readdir tree because of (wait for it) hard links. You end
> up right back where you started with multiple entries per key.
Well, if you are using 32-bit (or even 48-bit) inode numbers and a
64-bit telldir cookie, it's possible to make the right thing happen.
But yes, if you are using 32-bit inode numbers and a 32-bit telldir
cookie, dealing with what happens when you have multiple hard links to
the same inode in the same directory gets tricky.
> A painful solution is to have the key in the readdir tree allocated by
> the tree itself -- count key populations in subtrees per child pointer
> and use that to find free keys.
One thing that might work is to have a 16-bit extra field in the
directory entry that gives an signed offset to the inode number so
that such that inode+offset is a unique value within the btree sorted
by inode+offset number. Since this tree is only used for returning
entries in an optimal (or as close to optimal as can be arranged)
order, we could get away with that.
- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux NFS]
[Linux NILFS]
[Linux USB Devel]
[Video for Linux]
[Linux Audio Users]
[Photo]
[Yosemite News]
[Yosemite Photos]
[Free Online Dating]
[Linux Kernel]
[Linux SCSI]
[XFree86]