Re: [PATCH 0/3] readahead drop behind and size adjustment

2007-07-24 Thread Andreas Dilger
On Jul 23, 2007  18:17 -0700, Andrew Morton wrote:
 hm, yes, there is a risk that the code was accidentally correct.  Or the
 code has only ever dealt with power-of-2 inputs, in which case it happens
 to work either way.
 
 David(s) and ext4-people: could we please have a close review of these
 changes?
  @@ -1706,8 +1704,8 @@ static int ext4_fill_super (struct super
  -   sbi-s_addr_per_block_bits = log2(EXT4_ADDR_PER_BLOCK(sb));
  -   sbi-s_desc_per_block_bits = log2(EXT4_DESC_PER_BLOCK(sb));
  +   sbi-s_addr_per_block_bits = ilog2(EXT4_ADDR_PER_BLOCK(sb));
  +   sbi-s_desc_per_block_bits = ilog2(EXT4_DESC_PER_BLOCK(sb));

For the ext[234] code there has only ever been power-of-two values for
ADDR_PER_BLOCK() and DESC_PER_BLOCK().

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.

-
To unsubscribe from this list: send the line unsubscribe linux-ext4 in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Patch 2/13] Miscellaneous Cleanups

2007-07-24 Thread Girish Shilamkar
Miscellaneous cleanups.

Signed-off-by: Andreas Dilger [EMAIL PROTECTED]
Signed-off-by: Girish Shilamkar [EMAIL PROTECTED]

Index: e2fsprogs-1.40.1/Makefile.in
===
--- e2fsprogs-1.40.1.orig/Makefile.in
+++ e2fsprogs-1.40.1/Makefile.in
@@ -10,7 +10,7 @@ INSTALL = @INSTALL@
 @[EMAIL PROTECTED] resize
 @[EMAIL PROTECTED] debugfs
 
-LIB_SUBDIRS=lib/et lib/ss lib/e2p lib/ext2fs lib/uuid lib/blkid intl
+LIB_SUBDIRS=lib/et lib/ss lib/e2p lib/uuid lib/ext2fs lib/blkid intl
 PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po
 SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
 
Index: e2fsprogs-1.40.1/debugfs/set_fields.c
===
--- e2fsprogs-1.40.1.orig/debugfs/set_fields.c
+++ e2fsprogs-1.40.1/debugfs/set_fields.c
@@ -22,6 +22,9 @@
 #ifdef HAVE_ERRNO_H
 #include errno.h
 #endif
+#if HAVE_STRINGS_H
+# include strings.h
+#endif
 #include fcntl.h
 #include utime.h
 
Index: e2fsprogs-1.40.1/lib/blkid/getsize.c
===
--- e2fsprogs-1.40.1.orig/lib/blkid/getsize.c
+++ e2fsprogs-1.40.1/lib/blkid/getsize.c
@@ -186,7 +186,7 @@ blkid_loff_t blkid_get_dev_size(int fd)
 #ifdef TEST_PROGRAM
 int main(int argc, char **argv)
 {
-   blkid_loff_t bytes;
+   long long bytes;
int fd;
 
if (argc  2) {


-
To unsubscribe from this list: send the line unsubscribe linux-ext4 in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Patch 3/13] Rpm check.

2007-07-24 Thread Girish Shilamkar
Rpm check.

Signed-off-by: Andreas Dilger [EMAIL PROTECTED]

Index: e2fsprogs-1.40.1/e2fsprogs.spec.in
===
--- e2fsprogs-1.40.1.orig/e2fsprogs.spec.in
+++ e2fsprogs-1.40.1/e2fsprogs.spec.in
@@ -52,6 +52,7 @@ also want to install e2fsprogs.
 %build
 %configure --enable-elf-shlibs --enable-nls
 make
+make check
 
 %install
 rm -rf $RPM_BUILD_ROOT


-
To unsubscribe from this list: send the line unsubscribe linux-ext4 in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Patch 4/13] Allow regular files to be preallocated on-disk.

2007-07-24 Thread Girish Shilamkar
Allow regular files to be preallocated on-disk up to the next multiple
of the system PAGE_SIZE without complaining about extra blocks.

Signed-off-by: Andreas Dilger [EMAIL PROTECTED]
Signed-off-by: Girish Shilamkar [EMAIL PROTECTED]
Signed-off-by: Kalpak Shah [EMAIL PROTECTED]

Index: e2fsprogs-1.40.1/e2fsck/pass1.c
===
--- e2fsprogs-1.40.1.orig/e2fsck/pass1.c
+++ e2fsprogs-1.40.1/e2fsck/pass1.c
@@ -1591,9 +1591,14 @@ static void check_blocks(e2fsck_t ctx, s
bad_size = 2;
}
} else {
+   e2_blkcnt_t blkpg = getpagesize() / fs-blocksize;
+
size = EXT2_I_SIZE(inode);
if ((pb.last_block = 0) 
-   (size  (__u64) pb.last_block * fs-blocksize))
+   /* allow allocated blocks to end of PAGE_SIZE */
+   (size  (__u64)pb.last_block * fs-blocksize) 
+   (pb.last_block / blkpg * blkpg != pb.last_block ||
+size  (__u64)(pb.last_block  ~(blkpg-1)) *fs-blocksize))
bad_size = 3;
else if (size  ext2_max_sizes[fs-super-s_log_block_size])
bad_size = 4;


-
To unsubscribe from this list: send the line unsubscribe linux-ext4 in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Patch 7/13] Many inodes in filesystem.

2007-07-24 Thread Girish Shilamkar
Handle filesystems with many hard links that have more than ~700M inodes.
The float variable lacks precision at this scale.

Signed-off-by: Andreas Dilger [EMAIL PROTECTED]
Signed-off-by: Girish Shilamkar [EMAIL PROTECTED]
Signed-off-by: Kalpak Shah [EMAIL PROTECTED]

Index: e2fsprogs-1.40.1/lib/ext2fs/icount.c
===
--- e2fsprogs-1.40.1.orig/lib/ext2fs/icount.c
+++ e2fsprogs-1.40.1/lib/ext2fs/icount.c
@@ -376,6 +376,10 @@ static struct ext2_icount_el *get_icount
range = 0.1;
}
mid = low + ((int) (range * (high-low)));
+   if (mid  high)
+   mid = high;
+   if (mid  low)
+   mid = low;
}
 #endif
if (ino == icount-list[mid].ino) {


-
To unsubscribe from this list: send the line unsubscribe linux-ext4 in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Patch 13/13] Improve e2fsck heuristics for detecting corrupted inodes.

2007-07-24 Thread Girish Shilamkar
The present e2fsck code checks the inode, per field basis. It doesn't take into
consideration to total sanity of the inode. This may cause e2fsck turning a
garbage inode into a sane inode. 
The following patch adds a heuristics to detect
the degree of badness of an inode. icount mechanism is used to keep track of the
badness of every inode. The badness is increased as various fields in inode are
found to be corrupt. Badness above a certain threshold value results in deletion
of the inode. The default threshold value is 7, it can be specified to e2fsck
using -E inode_badness_threshold=value

Signed-off-by: Andreas Dilger [EMAIL PROTECTED]
Signed-off-by: Girish Shilamkar [EMAIL PROTECTED]

Index: e2fsprogs-1.40.1/e2fsck/e2fsck.h
===
--- e2fsprogs-1.40.1.orig/e2fsck/e2fsck.h
+++ e2fsprogs-1.40.1/e2fsck/e2fsck.h
@@ -11,6 +11,7 @@
 
 #include stdio.h
 #include string.h
+#include stddef.h
 #ifdef HAVE_UNISTD_H
 #include unistd.h
 #endif
@@ -195,6 +196,18 @@ typedef enum {
E2F_CLONE_ZERO
 } clone_opt_t;
 
+#define EXT4_FITS_IN_INODE(ext4_inode, einode, field)  \
+   ((offsetof(typeof(*ext4_inode), field) +\
+ sizeof(ext4_inode-field))\
+   = (EXT2_GOOD_OLD_INODE_SIZE +  \
+   (einode)-i_extra_isize))   \
+
+#define BADNESS_NORMAL 1
+#define BADNESS_HIGH   2
+#define BADNESS_THRESHOLD  7
+#define BADNESS_BAD_MODE   100
+#define BADNESS_LARGE_FILE 219902322ULL
+
 /*
  * Define the extended attribute refcount structure
  */
@@ -229,7 +242,6 @@ struct e2fsck_struct {
unsigned long max);
 
ext2fs_inode_bitmap inode_used_map; /* Inodes which are in use */
-   ext2fs_inode_bitmap inode_bad_map; /* Inodes which are bad somehow */
ext2fs_inode_bitmap inode_dir_map; /* Inodes which are directories */
ext2fs_inode_bitmap inode_bb_map; /* Inodes which are in bad blocks */
ext2fs_inode_bitmap inode_imagic_map; /* AFS inodes */
@@ -244,6 +256,8 @@ struct e2fsck_struct {
 */
ext2_icount_t   inode_count;
ext2_icount_t inode_link_info;
+   ext2_icount_t inode_badness;
+   int inode_badness_threshold;
 
ext2_refcount_t refcount;
ext2_refcount_t refcount_extra;
@@ -341,6 +355,7 @@ struct e2fsck_struct {
__u32 fs_ext_attr_blocks;
__u32 extent_files;
 
+   time_t now_tolerance_val;
time_t now;
 
int ext_attr_ver;
@@ -453,6 +468,8 @@ extern int e2fsck_pass1_check_device_ino
   struct ext2_inode *inode);
 extern int e2fsck_pass1_check_symlink(ext2_filsys fs,
  struct ext2_inode *inode, char *buf);
+extern void e2fsck_mark_inode_bad(e2fsck_t ctx, ino_t ino, int count);
+extern int is_inode_bad(e2fsck_t ctx, ino_t ino);
 
 /* pass2.c */
 extern int e2fsck_process_bad_inode(e2fsck_t ctx, ext2_ino_t dir,
Index: e2fsprogs-1.40.1/e2fsck/pass1.c
===
--- e2fsprogs-1.40.1.orig/e2fsck/pass1.c
+++ e2fsprogs-1.40.1/e2fsck/pass1.c
@@ -20,7 +20,8 @@
  * - A bitmap of which inodes are in use.  (inode_used_map)
  * - A bitmap of which inodes are directories. (inode_dir_map)
  * - A bitmap of which inodes are regular files.   (inode_reg_map)
- * - A bitmap of which inodes have bad fields. (inode_bad_map)
+ * - An icount mechanism is used to keep track of
+ *   inodes with bad fields and its badness(ctx-inode_badness)
  * - A bitmap of which inodes are in bad blocks.   (inode_bb_map)
  * - A bitmap of which inodes are imagic inodes.   (inode_imagic_map)
  * - A bitmap of which inodes need to be expanded  (expand_eisize_map)
@@ -68,7 +69,6 @@ static void check_blocks(e2fsck_t ctx, s
 static void mark_table_blocks(e2fsck_t ctx);
 static void alloc_bb_map(e2fsck_t ctx);
 static void alloc_imagic_map(e2fsck_t ctx);
-static void mark_inode_bad(e2fsck_t ctx, ino_t ino);
 static void handle_fs_bad_blocks(e2fsck_t ctx);
 static void process_inodes(e2fsck_t ctx, char *block_buf);
 static EXT2_QSORT_TYPE process_inode_cmp(const void *a, const void *b);
@@ -220,6 +220,7 @@ static void check_immutable(e2fsck_t ctx
if (!(pctx-inode-i_flags  BAD_SPECIAL_FLAGS))
return;
 
+   e2fsck_mark_inode_bad(ctx, pctx-ino, BADNESS_NORMAL);
if (!fix_problem(ctx, PR_1_SET_IMMUTABLE, pctx))
return;
 
@@ -238,6 +239,7 @@ static void check_size(e2fsck_t ctx, str
if ((inode-i_size == 0)  (inode-i_size_high == 0))
return;

+   e2fsck_mark_inode_bad(ctx, pctx-ino, BADNESS_NORMAL);
if (!fix_problem(ctx, PR_1_SET_NONZSIZE, pctx))
return;

@@ -352,6 +354,7 @@ static void check_inode_extra_space(e2fs
 */
if 

Re: [Patch 1/13] iostats

2007-07-24 Thread Theodore Tso
On Tue, Jul 24, 2007 at 04:34:36PM +0530, Girish Shilamkar wrote:
  
 +struct struct_io_stats {
 + unsigned long long reads;
 + unsigned long long writes;
 +};

I'd suggest doing something like this instead:

struct struct_io_stats {
int num_fields;
int reserved;
unsigned long long bytes_read;
unsigned long long bytes_written;
};

There are other statistics that you might want to gather.  For
example, read_requests and write_requests.  Or perhaps some
statistics based on discontiguous read/writes (i.e., i/o operations
that cause seeks).  Also, in the future we might want to add some kind
of readahead functionality, and that would probably require more
statistics as well.

 + memset(track-io_start, 0, sizeof(struct struct_io_stats));
 + if (channel  channel-manager  channel-manager-get_stats)
 + channel-manager-get_stats(channel, track-io_start);
  }

If you're going to use a caller allocates paradigm, then the caller
would be responsible for doing this:

  track-io_start.num_fields = 2;

... so the library routine knows how much of the structure it is safe
for it to fill in.  Alternatively, it might be easier to simply have
the io_manager pass back a pointer to its own stats structure, and
then the caller would use the num_fields_size to figure out how much
of the structure it can trust.

- Ted
-
To unsubscribe from this list: send the line unsubscribe linux-ext4 in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Patch 7/13] Many inodes in filesystem.

2007-07-24 Thread Theodore Tso
On Tue, Jul 24, 2007 at 04:34:59PM +0530, Girish Shilamkar wrote:
 Handle filesystems with many hard links that have more than ~700M inodes.
 The float variable lacks precision at this scale.

This was fixed in e2fsprogs mainline a slightly different way.  Just
above it:

range = ((float) (ino - lowval)) /
(highval - lowval);
if (range  0.9)
range = 0.9;
if (range  0.1)
range = 0.1;

The problem with just correcting the midpoint calculation as you
proposed in your patch is that you could end up doing a linear search
through the whole array in some really abberrant cases.  With this fix
applied in e2fsprogs, the patch below isn't required.

Regards,

- Ted

 Signed-off-by: Andreas Dilger [EMAIL PROTECTED]
 Signed-off-by: Girish Shilamkar [EMAIL PROTECTED]
 Signed-off-by: Kalpak Shah [EMAIL PROTECTED]
 
 Index: e2fsprogs-1.40.1/lib/ext2fs/icount.c
 ===
 --- e2fsprogs-1.40.1.orig/lib/ext2fs/icount.c
 +++ e2fsprogs-1.40.1/lib/ext2fs/icount.c
 @@ -376,6 +376,10 @@ static struct ext2_icount_el *get_icount
   range = 0.1;
   }
   mid = low + ((int) (range * (high-low)));
 + if (mid  high)
 + mid = high;
 + if (mid  low)
 + mid = low;
   }
  #endif
   if (ino == icount-list[mid].ino) {
 
 
-
To unsubscribe from this list: send the line unsubscribe linux-ext4 in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


New e2fsprog doc on the ext4 wiki page.

2007-07-24 Thread Jose R. Santos
Hi folks

As discussed in the conference call, we are going to create a new doc
on the ext4 wiki dedicated to track the development of some of the
features needed in e2fsprogs.  The page will consist of mostly changes
needed in order to keep e2fsprogs up to date with mainline ext4 kernel
code.

I don't plan to add bug fixes, cleanup or trivial changes to the page
as this would make it hard to keep the page up to date.  The link to
the page will be:

http://ext4.wiki.kernel.org/index.php?title=E2fsprogs_features_and_patchesaction=edit

Comments on what you would like to see of this page or in the initial
list of features I have gather below are welcome. 


Undo I/O manager:
-Patches submited to the mailing list by Aneesh Kumar
-To be merged after 1.40
http://thread.gmane.org/gmane.comp.file-systems.ext4/2826

64bit blk Support:
- Patches submited to the mailing list by Valerie Clement
- Requires different binaries for doing 64bit support.
- Unified binaries will most likely require API/ABI changes.
- 64bit blk support requires 64bit binaries.  Breaks on PPC64
32bit user-space env.
- Ted T'so suggests a different approach:
  http://thread.gmane.org/gmane.comp.file-systems.ext4/2845
http://thread.gmane.org/gmane.comp.file-systems.ext4/2125

Uninitialized block groups:
- Girish Shilamkar recently submited new patch to the mailing list
- Kernel patches not in mainline yet.  What's the hold up here?
- No archive link yet.

i_version support:
- Kernel patches not in mainline yet.  Ongoing discussions.
- Patches submitted?

ext4migrate:
- Patches submited to the mailing list by Aneesh Kumar
http://thread.gmane.org/gmane.comp.file-systems.ext4/1395

Extents support:
- Patches submitted?

Nano second support:
- Patches submitted?

Greater than 32000 subdir support:
- Girish Shilamkar recently submited new patch to the mailing list
- No archive link yet.


-JRS
-
To unsubscribe from this list: send the line unsubscribe linux-ext4 in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Patch 9/13] Adds two extended options and config file counterparts.

2007-07-24 Thread Theodore Tso
On Tue, Jul 24, 2007 at 04:35:04PM +0530, Girish Shilamkar wrote:
 This patch adds two extended options and config file counterparts.
 On the command line:
 
   -E shared=preserve|lost+found|delete
 
  Select the disposition of files containing shared blocks.  preserve
  is the old behavior which remains the default.  lost+found causes
  files to be unlinked after cloning so they will be reconnected to
  /lost+found in pass 3.   delete skips cloning entirely and simply
  deletes the files.

Jim Garlick and I discussed this back in April, and I pointed out a
flaw in his patch.  It doesn't correctly handle the case where the
system administrator wishes to move an inode that contains blocks
claimed by other inodes to lost+found, since it only unlinks the first
filename of the inode.  The result is that the inode loses one of its
directory entries, but it doesn't get oved to lost+found.

Jim reworked the patch to solve this issue, by keeping a linked list
of all of the directory entries where a particular inode could be
found.  This increases the memory used and increases the time to do
pass 1C, though.  The patch you have in your patch queue is the
original version of the patch, not his updated one.

I'm still not happy with this approach, though, since it adds extra
complexity and special case handling into e2fsprogs.  I had made a
counter-proposal as a better long-term approach, which Jim seemed to
agree would meet his needs:

One of my long-term plans was to extend the fix_problem() function to
log a detailed set of problems fixed into a file (either binary or
XML) that could parsed by other programs as part of some kind of
recovery process.  What would get written out is the problem ID plus
the entire problem_context structure, which has actually quite a lot
of information.  This would be enough for a lot of post-processing,
including making it easier for people to implement policies such as
deleted or archiving for review by the Site Security Officer any files
which had some of their blocks cloned.

- Ted
-
To unsubscribe from this list: send the line unsubscribe linux-ext4 in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: New e2fsprog doc on the ext4 wiki page.

2007-07-24 Thread Andreas Dilger
On Jul 24, 2007  21:48 +0530, Aneesh Kumar K.V wrote:
 Jose R. Santos wrote:
 ext4migrate:
 - Patches submited to the mailing list by Aneesh Kumar
 http://thread.gmane.org/gmane.comp.file-systems.ext4/1395
 
 I guess what we are looking at here is 
 
 a) ext3 - ext4 conversion would be done via option for defrag. This
 conversion is now done via a ioctl. This is the suggested method for
 defragmenting an ext3 inode (convert to ext4 and then defrag). 
 
 b) small inode to large inode conversion is done via tune2fs -I  
 new_inode_size
   I have patches for this ready. Will be sending them in a day or two.
 
 So the ext4migrate command may not be really needed.

Ah, excellent news.  Having a single tool (tune2fs) to manage configuration
changes is much nicer.  Having the generic undo manager to handle these
kind of changes will allow us to do all kind of changes in the future.

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.

-
To unsubscribe from this list: send the line unsubscribe linux-ext4 in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: New e2fsprog doc on the ext4 wiki page.

2007-07-24 Thread Jose R. Santos
On Tue, 24 Jul 2007 21:48:58 +0530
Aneesh Kumar K.V [EMAIL PROTECTED] wrote:

 
 
 Jose R. Santos wrote:
  Hi folks
  
 
  
  ext4migrate:
  - Patches submited to the mailing list by Aneesh Kumar
  http://thread.gmane.org/gmane.comp.file-systems.ext4/1395
  
 
 
 I guess what we are looking at here is 
 
 a) ext3 - ext4 conversion would be done via option for defrag. This
 conversion is now done via a ioctl. This is the suggested method for
 defragmenting an ext3 inode (convert to ext4 and then defrag). 
 
 b) small inode to large inode conversion is done via tune2fs -I 
 new_inode_size I have patches for this ready. Will be sending them
 in a day or two.
 
 So the ext4migrate command may not be really needed.
 
 
 -aneesh  

I will remove this item then and add the tune2fs changes.

Is the defrag code going to be part of e2fsprogs or is this going to be
a standalone app?

-JRS
-
To unsubscribe from this list: send the line unsubscribe linux-ext4 in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: New e2fsprog doc on the ext4 wiki page.

2007-07-24 Thread Aneesh Kumar K.V



Jose R. Santos wrote:

On Tue, 24 Jul 2007 21:48:58 +0530
Aneesh Kumar K.V [EMAIL PROTECTED] wrote:



Jose R. Santos wrote:

Hi folks



ext4migrate:
- Patches submited to the mailing list by Aneesh Kumar
http://thread.gmane.org/gmane.comp.file-systems.ext4/1395



I guess what we are looking at here is 


a) ext3 - ext4 conversion would be done via option for defrag. This
conversion is now done via a ioctl. This is the suggested method for
defragmenting an ext3 inode (convert to ext4 and then defrag). 


b) small inode to large inode conversion is done via tune2fs -I 
new_inode_size I have patches for this ready. Will be sending them
in a day or two.

So the ext4migrate command may not be really needed.


-aneesh  


I will remove this item then and add the tune2fs changes.

Is the defrag code going to be part of e2fsprogs or is this going to be
a standalone app?



As per the last version posted

http://article.gmane.org/gmane.comp.file-systems.ext4/2290

There is a e4defrag command.

-aneesh
-
To unsubscribe from this list: send the line unsubscribe linux-ext4 in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Patch 0/13] Patches for e2fsprogs

2007-07-24 Thread Theodore Tso
On Tue, Jul 24, 2007 at 04:34:31PM +0530, Girish Shilamkar wrote:
 Hi,
   I am sending the patches for e2fsprogs as decided in the ext4 conf
 call.
 The patches are based on e2fsprogs-1.40.1. Some of these patches have
 already been sent on the list before.

One other minor thing; it would be greatly appreciated it if when
folks send multiple patches in a bundle by having all of the patches
be a reply to the an introductory message.  i.e.:

[Patch 0/13] Patches for e2fsprogs
  |--- [Patch 1/13] iostats.
  |--- [Patch 2/13] Cleanup.
  |--- [Patch 3/13] Rpm Check.
  |--- [Patch 4/14] Allow regular files to be preallocated on-disk.

This makes it easier to make sure the patches stay together in mail
readers even when there are replies to the patches.  It just makes
life a little easier for people going through mail archives.

Thanks!!

- Ted
-
To unsubscribe from this list: send the line unsubscribe linux-ext4 in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


+ ext2-show-all-mount-options.patch added to -mm tree

2007-07-24 Thread akpm

The patch titled
 ext2: show all mount options
has been added to the -mm tree.  Its filename is
 ext2-show-all-mount-options.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

--
Subject: ext2: show all mount options
From: Miklos Szeredi [EMAIL PROTECTED]

Using mtab is problematic for various reasons, one of them is that
unprivileged mounts won't turn up in there.  So we want to get rid of it, and
use /proc/mounts instead.

But most filesystems are lazy, and are not showing all mount options.  Which
means, that without mtab, the user won't be able to see some or all of the
options.

It would be nice if the generic code could remember the mount options, and
show them without the need to add extra code to filesystems.  But this is not
easy, because different filesystems handle mount options given options, and
not tough the rest.  This is not taken into account by mount(8) either, so
/etc/mtab will be broken in this case.

This series fixes up -show_options() in ext[234].

Signed-off-by: Miklos Szeredi [EMAIL PROTECTED]
Cc: linux-ext4@vger.kernel.org
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 fs/ext2/super.c|   61 +--
 include/linux/ext2_fs_sb.h |1 
 2 files changed, 60 insertions(+), 2 deletions(-)

diff -puN fs/ext2/super.c~ext2-show-all-mount-options fs/ext2/super.c
--- a/fs/ext2/super.c~ext2-show-all-mount-options
+++ a/fs/ext2/super.c
@@ -205,10 +205,66 @@ static void ext2_clear_inode(struct inod
 
 static int ext2_show_options(struct seq_file *seq, struct vfsmount *vfs)
 {
-   struct ext2_sb_info *sbi = EXT2_SB(vfs-mnt_sb);
+   struct super_block *sb = vfs-mnt_sb;
+   struct ext2_sb_info *sbi = EXT2_SB(sb);
+   struct ext2_super_block *es = sbi-s_es;
+   unsigned long def_mount_opts;
+
+   def_mount_opts = le32_to_cpu(es-s_default_mount_opts);
 
-   if (sbi-s_mount_opt  EXT2_MOUNT_GRPID)
+   if (sbi-s_sb_block != 1)
+   seq_printf(seq, ,sb=%lu, sbi-s_sb_block);
+   if (test_opt(sb, MINIX_DF))
+   seq_puts(seq, ,minixdf);
+   if (test_opt(sb, GRPID))
seq_puts(seq, ,grpid);
+   if (!test_opt(sb, GRPID)  (def_mount_opts  EXT2_DEFM_BSDGROUPS))
+   seq_puts(seq, ,nogrpid);
+   if (sbi-s_resuid != EXT2_DEF_RESUID ||
+   le16_to_cpu(es-s_def_resuid) != EXT2_DEF_RESUID) {
+   seq_printf(seq, ,resuid=%u, sbi-s_resuid);
+   }
+   if (sbi-s_resgid != EXT2_DEF_RESGID ||
+   le16_to_cpu(es-s_def_resgid) != EXT2_DEF_RESGID) {
+   seq_printf(seq, ,resgid=%u, sbi-s_resgid);
+   }
+   if (test_opt(sb, ERRORS_CONT)) {
+   int def_errors = le16_to_cpu(es-s_errors);
+
+   if (def_errors == EXT2_ERRORS_PANIC ||
+   def_errors == EXT2_ERRORS_RO) {
+   seq_puts(seq, ,errors=continue);
+   }
+   }
+   if (test_opt(sb, ERRORS_RO))
+   seq_puts(seq, ,errors=remount-ro);
+   if (test_opt(sb, ERRORS_PANIC))
+   seq_puts(seq, ,errors=panic);
+   if (test_opt(sb, NO_UID32))
+   seq_puts(seq, ,nouid32);
+   if (test_opt(sb, DEBUG))
+   seq_puts(seq, ,debug);
+   if (test_opt(sb, OLDALLOC))
+   seq_puts(seq, ,oldalloc);
+
+#ifdef CONFIG_EXT2_FS_XATTR
+   if (test_opt(sb, XATTR_USER))
+   seq_puts(seq, ,user_xattr);
+   if (!test_opt(sb, XATTR_USER) 
+   (def_mount_opts  EXT2_DEFM_XATTR_USER)) {
+   seq_puts(seq, ,nouser_xattr);
+   }
+#endif
+
+#ifdef CONFIG_EXT2_FS_POSIX_ACL
+   if (test_opt(sb, POSIX_ACL))
+   seq_puts(seq, ,acl);
+   if (!test_opt(sb, POSIX_ACL)  (def_mount_opts  EXT2_DEFM_ACL))
+   seq_puts(seq, ,noacl);
+#endif
+
+   if (test_opt(sb, NOBH))
+   seq_puts(seq, ,nobh);
 
 #if defined(CONFIG_QUOTA)
if (sbi-s_mount_opt  EXT2_MOUNT_USRQUOTA)
@@ -660,6 +716,7 @@ static int ext2_fill_super(struct super_
if (!sbi)
return -ENOMEM;
sb-s_fs_info = sbi;
+   sbi-s_sb_block = sb_block;
 
/*
 * See what the current blocksize for the device is, and
diff -puN include/linux/ext2_fs_sb.h~ext2-show-all-mount-options 
include/linux/ext2_fs_sb.h
--- a/include/linux/ext2_fs_sb.h~ext2-show-all-mount-options
+++ a/include/linux/ext2_fs_sb.h
@@ -39,6 +39,7 @@ struct ext2_sb_info {
struct ext2_super_block * s_es; /* Pointer to the super block in the 
buffer */
struct buffer_head ** s_group_desc;
unsigned long  s_mount_opt;
+   unsigned long s_sb_block;
uid_t s_resuid;
gid_t s_resgid;
unsigned short s_mount_state;
_

Patches currently in -mm which might be from [EMAIL PROTECTED] are

+ ext3-show-all-mount-options.patch added to -mm tree

2007-07-24 Thread akpm

The patch titled
 ext3: show all mount options
has been added to the -mm tree.  Its filename is
 ext3-show-all-mount-options.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

--
Subject: ext3: show all mount options
From: Miklos Szeredi [EMAIL PROTECTED]

Signed-off-by: Miklos Szeredi [EMAIL PROTECTED]
Cc: linux-ext4@vger.kernel.org
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 fs/ext3/super.c|   70 +++
 include/linux/ext3_fs_sb.h |1 
 2 files changed, 71 insertions(+)

diff -puN fs/ext3/super.c~ext3-show-all-mount-options fs/ext3/super.c
--- a/fs/ext3/super.c~ext3-show-all-mount-options
+++ a/fs/ext3/super.c
@@ -545,9 +545,78 @@ static inline void ext3_show_quota_optio
 #endif
 }
 
+/*
+ * Show an option if
+ *  - it's set to a non-default value OR
+ *  - if the per-sb default is different from the global default
+ */
 static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs)
 {
struct super_block *sb = vfs-mnt_sb;
+   struct ext3_sb_info *sbi = EXT3_SB(sb);
+   struct ext3_super_block *es = sbi-s_es;
+   unsigned long def_mount_opts;
+
+   def_mount_opts = le32_to_cpu(es-s_default_mount_opts);
+
+   if (sbi-s_sb_block != 1)
+   seq_printf(seq, ,sb=%lu, sbi-s_sb_block);
+   if (test_opt(sb, MINIX_DF))
+   seq_puts(seq, ,minixdf);
+   if (test_opt(sb, GRPID))
+   seq_puts(seq, ,grpid);
+   if (!test_opt(sb, GRPID)  (def_mount_opts  EXT3_DEFM_BSDGROUPS))
+   seq_puts(seq, ,nogrpid);
+   if (sbi-s_resuid != EXT3_DEF_RESUID ||
+   le16_to_cpu(es-s_def_resuid) != EXT3_DEF_RESUID) {
+   seq_printf(seq, ,resuid=%u, sbi-s_resuid);
+   }
+   if (sbi-s_resgid != EXT3_DEF_RESGID ||
+   le16_to_cpu(es-s_def_resgid) != EXT3_DEF_RESGID) {
+   seq_printf(seq, ,resgid=%u, sbi-s_resgid);
+   }
+   if (test_opt(sb, ERRORS_CONT)) {
+   int def_errors = le16_to_cpu(es-s_errors);
+
+   if (def_errors == EXT3_ERRORS_PANIC ||
+   def_errors == EXT3_ERRORS_RO) {
+   seq_puts(seq, ,errors=continue);
+   }
+   }
+   if (test_opt(sb, ERRORS_RO))
+   seq_puts(seq, ,errors=remount-ro);
+   if (test_opt(sb, ERRORS_PANIC))
+   seq_puts(seq, ,errors=panic);
+   if (test_opt(sb, NO_UID32))
+   seq_puts(seq, ,nouid32);
+   if (test_opt(sb, DEBUG))
+   seq_puts(seq, ,debug);
+   if (test_opt(sb, OLDALLOC))
+   seq_puts(seq, ,oldalloc);
+#ifdef CONFIG_EXT3_FS_XATTR
+   if (test_opt(sb, XATTR_USER))
+   seq_puts(seq, ,user_xattr);
+   if (!test_opt(sb, XATTR_USER) 
+   (def_mount_opts  EXT3_DEFM_XATTR_USER)) {
+   seq_puts(seq, ,nouser_xattr);
+   }
+#endif
+#ifdef CONFIG_EXT3_FS_POSIX_ACL
+   if (test_opt(sb, POSIX_ACL))
+   seq_puts(seq, ,acl);
+   if (!test_opt(sb, POSIX_ACL)  (def_mount_opts  EXT3_DEFM_ACL))
+   seq_puts(seq, ,noacl);
+#endif
+   if (!test_opt(sb, RESERVATION))
+   seq_puts(seq, ,noreservation);
+   if (sbi-s_commit_interval) {
+   seq_printf(seq, ,commit=%u,
+  (unsigned) (sbi-s_commit_interval / HZ));
+   }
+   if (test_opt(sb, BARRIER))
+   seq_puts(seq, ,barrier=1);
+   if (test_opt(sb, NOBH))
+   seq_puts(seq, ,nobh);
 
if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA)
seq_puts(seq, ,data=journal);
@@ -1424,6 +1493,7 @@ static int ext3_fill_super (struct super
sbi-s_mount_opt = 0;
sbi-s_resuid = EXT3_DEF_RESUID;
sbi-s_resgid = EXT3_DEF_RESGID;
+   sbi-s_sb_block = sb_block;
 
unlock_kernel();
 
diff -puN include/linux/ext3_fs_sb.h~ext3-show-all-mount-options 
include/linux/ext3_fs_sb.h
--- a/include/linux/ext3_fs_sb.h~ext3-show-all-mount-options
+++ a/include/linux/ext3_fs_sb.h
@@ -44,6 +44,7 @@ struct ext3_sb_info {
struct ext3_super_block * s_es; /* Pointer to the super block in the 
buffer */
struct buffer_head ** s_group_desc;
unsigned long  s_mount_opt;
+   ext3_fsblk_t s_sb_block;
uid_t s_resuid;
gid_t s_resgid;
unsigned short s_mount_state;
_

Patches currently in -mm which might be from [EMAIL PROTECTED] are

fuse-convert-to-new-aops.patch
ext2-show-all-mount-options.patch
ext3-show-all-mount-options.patch
ext4-show-all-mount-options.patch
unprivileged-mounts-add-user-mounts-to-the-kernel.patch
unprivileged-mounts-allow-unprivileged-umount.patch
unprivileged-mounts-account-user-mounts.patch
unprivileged-mounts-propagate-error-values-from-clone_mnt.patch

+ ext4-show-all-mount-options.patch added to -mm tree

2007-07-24 Thread akpm

The patch titled
 ext4: show all mount options
has been added to the -mm tree.  Its filename is
 ext4-show-all-mount-options.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

--
Subject: ext4: show all mount options
From: Miklos Szeredi [EMAIL PROTECTED]

Signed-off-by: Miklos Szeredi [EMAIL PROTECTED]
Cc: linux-ext4@vger.kernel.org
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 fs/ext4/super.c|   72 +++
 include/linux/ext4_fs_sb.h |1 
 2 files changed, 73 insertions(+)

diff -puN fs/ext4/super.c~ext4-show-all-mount-options fs/ext4/super.c
--- a/fs/ext4/super.c~ext4-show-all-mount-options
+++ a/fs/ext4/super.c
@@ -596,9 +596,80 @@ static inline void ext4_show_quota_optio
 #endif
 }
 
+/*
+ * Show an option if
+ *  - it's set to a non-default value OR
+ *  - if the per-sb default is different from the global default
+ */
 static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
 {
struct super_block *sb = vfs-mnt_sb;
+   struct ext4_sb_info *sbi = EXT4_SB(sb);
+   struct ext4_super_block *es = sbi-s_es;
+   unsigned long def_mount_opts;
+
+   def_mount_opts = le32_to_cpu(es-s_default_mount_opts);
+
+   if (sbi-s_sb_block != 1)
+   seq_printf(seq, ,sb=%llu, sbi-s_sb_block);
+   if (test_opt(sb, MINIX_DF))
+   seq_puts(seq, ,minixdf);
+   if (test_opt(sb, GRPID))
+   seq_puts(seq, ,grpid);
+   if (!test_opt(sb, GRPID)  (def_mount_opts  EXT4_DEFM_BSDGROUPS))
+   seq_puts(seq, ,nogrpid);
+   if (sbi-s_resuid != EXT4_DEF_RESUID ||
+   le16_to_cpu(es-s_def_resuid) != EXT4_DEF_RESUID) {
+   seq_printf(seq, ,resuid=%u, sbi-s_resuid);
+   }
+   if (sbi-s_resgid != EXT4_DEF_RESGID ||
+   le16_to_cpu(es-s_def_resgid) != EXT4_DEF_RESGID) {
+   seq_printf(seq, ,resgid=%u, sbi-s_resgid);
+   }
+   if (test_opt(sb, ERRORS_CONT)) {
+   int def_errors = le16_to_cpu(es-s_errors);
+
+   if (def_errors == EXT4_ERRORS_PANIC ||
+   def_errors == EXT4_ERRORS_RO) {
+   seq_puts(seq, ,errors=continue);
+   }
+   }
+   if (test_opt(sb, ERRORS_RO))
+   seq_puts(seq, ,errors=remount-ro);
+   if (test_opt(sb, ERRORS_PANIC))
+   seq_puts(seq, ,errors=panic);
+   if (test_opt(sb, NO_UID32))
+   seq_puts(seq, ,nouid32);
+   if (test_opt(sb, DEBUG))
+   seq_puts(seq, ,debug);
+   if (test_opt(sb, OLDALLOC))
+   seq_puts(seq, ,oldalloc);
+#ifdef CONFIG_EXT4_FS_XATTR
+   if (test_opt(sb, XATTR_USER))
+   seq_puts(seq, ,user_xattr);
+   if (!test_opt(sb, XATTR_USER) 
+   (def_mount_opts  EXT4_DEFM_XATTR_USER)) {
+   seq_puts(seq, ,nouser_xattr);
+   }
+#endif
+#ifdef CONFIG_EXT4_FS_POSIX_ACL
+   if (test_opt(sb, POSIX_ACL))
+   seq_puts(seq, ,acl);
+   if (!test_opt(sb, POSIX_ACL)  (def_mount_opts  EXT4_DEFM_ACL))
+   seq_puts(seq, ,noacl);
+#endif
+   if (!test_opt(sb, RESERVATION))
+   seq_puts(seq, ,noreservation);
+   if (sbi-s_commit_interval) {
+   seq_printf(seq, ,commit=%u,
+  (unsigned) (sbi-s_commit_interval / HZ));
+   }
+   if (test_opt(sb, BARRIER))
+   seq_puts(seq, ,barrier=1);
+   if (test_opt(sb, NOBH))
+   seq_puts(seq, ,nobh);
+   if (!test_opt(sb, EXTENTS))
+   seq_puts(seq, ,noextents);
 
if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)
seq_puts(seq, ,data=journal);
@@ -1485,6 +1556,7 @@ static int ext4_fill_super (struct super
sbi-s_mount_opt = 0;
sbi-s_resuid = EXT4_DEF_RESUID;
sbi-s_resgid = EXT4_DEF_RESGID;
+   sbi-s_sb_block = sb_block;
 
unlock_kernel();
 
diff -puN include/linux/ext4_fs_sb.h~ext4-show-all-mount-options 
include/linux/ext4_fs_sb.h
--- a/include/linux/ext4_fs_sb.h~ext4-show-all-mount-options
+++ a/include/linux/ext4_fs_sb.h
@@ -45,6 +45,7 @@ struct ext4_sb_info {
struct ext4_super_block * s_es; /* Pointer to the super block in the 
buffer */
struct buffer_head ** s_group_desc;
unsigned long  s_mount_opt;
+   ext4_fsblk_t s_sb_block;
uid_t s_resuid;
gid_t s_resgid;
unsigned short s_mount_state;
_

Patches currently in -mm which might be from [EMAIL PROTECTED] are

fuse-convert-to-new-aops.patch
ext2-show-all-mount-options.patch
ext3-show-all-mount-options.patch
ext4-show-all-mount-options.patch
unprivileged-mounts-add-user-mounts-to-the-kernel.patch
unprivileged-mounts-allow-unprivileged-umount.patch

e2fsprogs: Undo I/O Manager and large inode migration support in tune2fs

2007-07-24 Thread Aneesh Kumar K.V

Hi Ted,

The series is on top of

f1f115a78f5ea599fc5f8815a741d43fedd5840d

Changes from last post include

a) Add O_EXCL flag to tdb_open.
b) Fix the return value when we fail to create the tdb file
c) Add tune2fs -I new_inode_size for migrating to large inode size.


-
To unsubscribe from this list: send the line unsubscribe linux-ext4 in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] e2fsprogs: Add undoe2fs

2007-07-24 Thread Aneesh Kumar K.V
From: Aneesh Kumar K.V [EMAIL PROTECTED]

undoe2fs can be used to replay the transaction saved
in the transaction file using undo I/O Manager

Signed-off-by: Aneesh Kumar K.V [EMAIL PROTECTED]
---
 misc/Makefile.in |   10 +-
 misc/undoe2fs.c  |   77 ++
 2 files changed, 85 insertions(+), 2 deletions(-)
 create mode 100644 misc/undoe2fs.c

diff --git a/misc/Makefile.in b/misc/Makefile.in
index ccad78c..51bb17a 100644
--- a/misc/Makefile.in
+++ b/misc/Makefile.in
@@ -15,7 +15,7 @@ INSTALL = @INSTALL@
 @[EMAIL PROTECTED] e2image.8
 
 SPROGS=mke2fs badblocks tune2fs dumpe2fs blkid logsave \
-   $(E2IMAGE_PROG) @FSCK_PROG@ 
+   $(E2IMAGE_PROG) @FSCK_PROG@  undoe2fs
 USPROGS=   mklost+found filefrag
 SMANPAGES= tune2fs.8 mklost+found.8 mke2fs.8 dumpe2fs.8 badblocks.8 \
e2label.8 findfs.8 blkid.8 $(E2IMAGE_MAN) \
@@ -39,6 +39,7 @@ E2IMAGE_OBJS= e2image.o
 FSCK_OBJS= fsck.o base_device.o
 BLKID_OBJS=blkid.o
 FILEFRAG_OBJS= filefrag.o
+UNDOE2FS_OBJS=  undoe2fs.o
 
 XTRA_CFLAGS=   -I$(srcdir)/../e2fsck -I.
 
@@ -47,7 +48,7 @@ SRCS= $(srcdir)/tune2fs.c $(srcdir)/mklost+found.c 
$(srcdir)/mke2fs.c \
$(srcdir)/badblocks.c $(srcdir)/fsck.c $(srcdir)/util.c \
$(srcdir)/uuidgen.c $(srcdir)/blkid.c $(srcdir)/logsave.c \
$(srcdir)/filefrag.c $(srcdir)/base_device.c \
-   $(srcdir)/../e2fsck/profile.c
+   $(srcdir)/../e2fsck/profile.c $(srcdir)/undoe2fs.c
 
 LIBS= $(LIBEXT2FS) $(LIBCOM_ERR) 
 DEPLIBS= $(LIBEXT2FS) $(LIBCOM_ERR) 
@@ -108,6 +109,10 @@ e2image: $(E2IMAGE_OBJS) $(DEPLIBS)
@echo  LD $@
@$(CC) $(ALL_LDFLAGS) -o e2image $(E2IMAGE_OBJS) $(LIBS) $(LIBINTL)
 
+undoe2fs: $(UNDOE2FS_OBJS) $(DEPLIBS)
+   @echo  LD $@
+   @$(CC) $(ALL_LDFLAGS) -o undoe2fs $(UNDOE2FS_OBJS) $(LIBS)
+
 base_device: base_device.c
@echo  LD $@
@$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) $(srcdir)/base_device.c \
@@ -434,3 +439,4 @@ filefrag.o: $(srcdir)/filefrag.c
 base_device.o: $(srcdir)/base_device.c $(srcdir)/fsck.h
 profile.o: $(srcdir)/../e2fsck/profile.c $(top_srcdir)/lib/et/com_err.h \
  $(srcdir)/../e2fsck/profile.h prof_err.h
+undoe2fs.o: $(srcdir)/undoe2fs.c $(top_srcdir)/lib/ext2fs/tdb.h
diff --git a/misc/undoe2fs.c b/misc/undoe2fs.c
new file mode 100644
index 000..d14d44a
--- /dev/null
+++ b/misc/undoe2fs.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright IBM Corporation, 2007
+ * Author Aneesh Kumar K.V [EMAIL PROTECTED]
+ *
+ * %Begin-Header%
+ * This file may be redistributed under the terms of the GNU Public
+ * License.
+ * %End-Header%
+ */
+
+#include stdio.h
+#include stdlib.h
+#include fcntl.h
+#if HAVE_ERRNO_H
+#include errno.h
+#endif
+#include ext2fs/tdb.h
+
+void usage(char *prg_name)
+{
+   fprintf(stderr,
+   Usage: %s transaction file filesystem\n, prg_name);
+   exit(1);
+
+}
+
+
+main(int argc, char *argv[])
+{
+   TDB_CONTEXT *tdb;
+   TDB_DATA key, data;
+   unsigned long  blk_num;
+   unsigned long long int location;
+   int fd, retval;
+
+   if (argc != 3)
+   usage(argv[0]);
+
+   tdb = tdb_open(argv[1], 0, 0, O_RDONLY, 0600);
+
+   if (!tdb) {
+   fprintf(stderr, Failed tdb_open %s\n,  strerror(errno));
+   exit(1);
+   }
+
+   fd = open(argv[2], O_WRONLY);
+   if (fd  == -1) {
+   fprintf(stderr, Failed open %s\n, strerror(errno));
+   exit(1);
+   }
+
+   for (key = tdb_firstkey(tdb); key.dptr; key = tdb_nextkey(tdb, key)) {
+   data = tdb_fetch(tdb, key);
+   if (!data.dptr) {
+   fprintf(stderr,
+   Failed tdb_fetch %s\n, tdb_errorstr(tdb));
+   exit(1);
+   }
+   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);
+   retval = lseek(fd, location, SEEK_SET);
+   if (retval == -1) {
+   fprintf(stderr, Failed lseek %s\n, strerror(errno));
+   exit(1);
+   }
+   retval = write(fd, data.dptr, data.dsize);
+   if (retval == -1) {
+   fprintf(stderr, Failed write %s\n, strerror(errno));
+   exit(1);
+   }
+   }
+   close(fd);
+   tdb_close(tdb);
+
+}
-- 
1.5.3.rc2.22.g69a9b-dirty

-
To unsubscribe from this list: send the line unsubscribe linux-ext4 in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html