From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Theodore Tso <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [RFC PATCH 1/1] e2fsprogs: Add undo I/O manager.
Date: Thu, 07 Jun 2007 17:10:54 +0530 [thread overview]
Message-ID: <4667EEC6.8040001@linux.vnet.ibm.com> (raw)
In-Reply-To: <20070606120218.GC32603@thunk.org>
Theodore Tso wrote:
> On Wed, Jun 06, 2007 at 03:32:27PM +0530, Aneesh Kumar K.V wrote:
>> If we allow to change the block size in between that would mean the
>> records that we store in the tdb database will be of variable size (
>> different block sizes). That would also add all the code/complexity that
>> i have in is_trans_overlapping. So if we are looking at avoiding the
>> above for() loop then we should have constant block size (4K ?). But in
>> your above statement, you are counting overhead as a percentage of
>> blocksize. So how do we handle this ?
>
> As I suggested in my previous mail message, the block size rarely
> changes (mke2fs being the primary counter-example, and then only in a
> fairly restricted case). So as far as the tdb is concerned, we have
> to use a constant blocksize (the first one which is used when writing
> to the i/o block). So the undo manager would save away the blocksize
> the first time it was written to --- and yes, we would have to store
> that information in the tdb file so the restore program knows what
> block size is used, but that's easy; just write out the blocksize that
> out as an ascii number (to avoid byte swapping issues) with the key
> "blocksize" :-).
>
>
I don't think we need to store the blocksize because we can use the
data.dsize that is returned from tdb_fetch as the block size. For the
replay below is what i have right now.
for (key = tdb_firstkey(tdb); key.dptr; key = tdb_nextkey(tdb, key)) {
data = tdb_fetch(tdb, key);
blk_num = *(unsigned long *)key.dptr;
location = blk_num * data.dsize;
printf("Replayed transaction of size %d at location %ld\n", data.dsize,
blk_num);
lseek(fd, location, SEEK_SET);
write(fd, data.dptr, data.dsize);
}
>
>>> What version of e2fsprogs are you developing against?
>> Right now i am manually linking it against libtdb.
>>
>> dpkg --search /usr/lib/libtdb.so
>> tdb-dev: /usr/lib/libtdb.so
>
> Any particular reason you're not using the development version from
> Mercurial for your development? In general it's good practice to send
> patches against the latest develoment tip. What caught my eye of that
> particular comment was that it was pretty much saying that you weren't
> doing that....
>
Nothing particular. In the beginning i have imported the extent based
patches into a git repository and i continued using the same. Once we
all agree with the approach followed by the code i will port the same to
the code found in mercurial.
-aneesh
prev parent reply other threads:[~2007-06-07 11:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4c7823c85d4ea3b4535f9fc0e4afa93078317f81.1179828850.git.aneesh.kumar@linux.vnet.ibm.com>
2007-05-22 10:17 ` [RFC PATCH 1/1] e2fsprogs: Add undo I/O manager Aneesh Kumar K.V
2007-06-03 23:17 ` Theodore Tso
2007-06-06 10:02 ` Aneesh Kumar K.V
2007-06-06 12:02 ` Theodore Tso
2007-06-07 11:40 ` Aneesh Kumar K.V [this message]
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=4667EEC6.8040001@linux.vnet.ibm.com \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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 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).