Remove trailing whitespace for the entire source tree
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/lib/ext2fs/alloc.c b/lib/ext2fs/alloc.c
index ebe2bf6..230bec9 100644
--- a/lib/ext2fs/alloc.c
+++ b/lib/ext2fs/alloc.c
@@ -7,7 +7,7 @@
* This file may be redistributed under the terms of the GNU Public
* License.
* %End-Header%
- *
+ *
*/
#include <stdio.h>
@@ -100,7 +100,7 @@
*
* Should have a special policy for directories.
*/
-errcode_t ext2fs_new_inode(ext2_filsys fs, ext2_ino_t dir,
+errcode_t ext2fs_new_inode(ext2_filsys fs, ext2_ino_t dir,
int mode EXT2FS_ATTR((unused)),
ext2fs_inode_bitmap map, ext2_ino_t *ret)
{
@@ -109,13 +109,13 @@
ext2_ino_t start_inode;
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
-
+
if (!map)
map = fs->inode_map;
if (!map)
return EXT2_ET_NO_INODE_BITMAP;
-
- if (dir > 0)
+
+ if (dir > 0)
dir_group = (dir - 1) / EXT2_INODES_PER_GROUP(fs->super);
start_inode = (dir_group * EXT2_INODES_PER_GROUP(fs->super)) + 1;
@@ -134,7 +134,7 @@
if (i > fs->super->s_inodes_count)
i = EXT2_FIRST_INODE(fs->super);
} while (i != start_inode);
-
+
if (ext2fs_test_inode_bitmap(map, i))
return EXT2_ET_INODE_ALLOC_FAIL;
*ret = i;
@@ -221,7 +221,7 @@
retval = io_channel_write_blk(fs->io, block, 1, block_buf);
if (retval)
goto fail;
-
+
ext2fs_block_alloc_stats(fs, block, +1);
*ret = block;
@@ -260,7 +260,7 @@
return EXT2_ET_BLOCK_ALLOC_FAIL;
}
-void ext2fs_set_alloc_block_callback(ext2_filsys fs,
+void ext2fs_set_alloc_block_callback(ext2_filsys fs,
errcode_t (*func)(ext2_filsys fs,
blk64_t goal,
blk64_t *ret),
diff --git a/lib/ext2fs/alloc_sb.c b/lib/ext2fs/alloc_sb.c
index cdcb866..b0aeb96 100644
--- a/lib/ext2fs/alloc_sb.c
+++ b/lib/ext2fs/alloc_sb.c
@@ -1,5 +1,5 @@
/*
- * alloc_sb.c --- Allocate the superblock and block group descriptors for a
+ * alloc_sb.c --- Allocate the superblock and block group descriptors for a
* newly initialized filesystem. Used by mke2fs when initializing a filesystem
*
* Copyright (C) 1994, 1995, 1996, 2003 Theodore Ts'o.
@@ -40,20 +40,20 @@
*
* See also the comment for ext2fs_super_and_bgd_loc()
*/
-int ext2fs_reserve_super_and_bgd(ext2_filsys fs,
+int ext2fs_reserve_super_and_bgd(ext2_filsys fs,
dgrp_t group,
ext2fs_block_bitmap bmap)
{
blk_t super_blk, old_desc_blk, new_desc_blk;
int j, old_desc_blocks, num_blocks;
- num_blocks = ext2fs_super_and_bgd_loc(fs, group, &super_blk,
+ num_blocks = ext2fs_super_and_bgd_loc(fs, group, &super_blk,
&old_desc_blk, &new_desc_blk, 0);
if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG)
old_desc_blocks = fs->super->s_first_meta_bg;
else
- old_desc_blocks =
+ old_desc_blocks =
fs->desc_blocks + fs->super->s_reserved_gdt_blocks;
if (super_blk || (group == 0))
diff --git a/lib/ext2fs/alloc_stats.c b/lib/ext2fs/alloc_stats.c
index a8514cc..97661dc 100644
--- a/lib/ext2fs/alloc_stats.c
+++ b/lib/ext2fs/alloc_stats.c
@@ -7,7 +7,7 @@
* This file may be redistributed under the terms of the GNU Public
* License.
* %End-Header%
- *
+ *
*/
#include <stdio.h>
@@ -73,7 +73,7 @@
(fs->block_alloc_stats)(fs, (blk64_t) blk, inuse);
}
-void ext2fs_set_block_alloc_stats_callback(ext2_filsys fs,
+void ext2fs_set_block_alloc_stats_callback(ext2_filsys fs,
void (*func)(ext2_filsys fs,
blk64_t blk,
int inuse),
diff --git a/lib/ext2fs/alloc_tables.c b/lib/ext2fs/alloc_tables.c
index 7726eef..4d2535e 100644
--- a/lib/ext2fs/alloc_tables.c
+++ b/lib/ext2fs/alloc_tables.c
@@ -101,7 +101,7 @@
if (last_grp > fs->group_desc_count)
last_grp = fs->group_desc_count;
}
-
+
/*
* Allocate the block and inode bitmaps, if necessary
*/
@@ -130,7 +130,7 @@
if (!fs->group_desc[group].bg_block_bitmap) {
retval = ext2fs_get_free_blocks(fs, start_blk, last_blk,
1, bmap, &new_blk);
- if (retval == EXT2_ET_BLOCK_ALLOC_FAIL)
+ if (retval == EXT2_ET_BLOCK_ALLOC_FAIL)
retval = ext2fs_get_free_blocks(fs, group_blk,
last_blk, 1, bmap, &new_blk);
if (retval)
@@ -158,7 +158,7 @@
if (!fs->group_desc[group].bg_inode_bitmap) {
retval = ext2fs_get_free_blocks(fs, start_blk, last_blk,
1, bmap, &new_blk);
- if (retval == EXT2_ET_BLOCK_ALLOC_FAIL)
+ if (retval == EXT2_ET_BLOCK_ALLOC_FAIL)
retval = ext2fs_get_free_blocks(fs, group_blk,
last_blk, 1, bmap, &new_blk);
if (retval)
diff --git a/lib/ext2fs/badblocks.c b/lib/ext2fs/badblocks.c
index da7889d..6eadb12 100644
--- a/lib/ext2fs/badblocks.c
+++ b/lib/ext2fs/badblocks.c
@@ -1,6 +1,6 @@
/*
* badblocks.c --- routines to manipulate the bad block structure
- *
+ *
* Copyright (C) 1994, 1995, 1996 Theodore Ts'o.
*
* %Begin-Header%
@@ -34,7 +34,7 @@
{
ext2_u32_list bb;
errcode_t retval;
-
+
retval = ext2fs_get_mem(sizeof(struct ext2_struct_u32_list), &bb);
if (retval)
return retval;
@@ -54,7 +54,7 @@
*ret = bb;
return 0;
}
-
+
/*
* This procedure creates an empty u32 list.
@@ -79,7 +79,7 @@
errcode_t ext2fs_u32_copy(ext2_u32_list src, ext2_u32_list *dest)
{
errcode_t retval;
-
+
retval = make_u32_list(src->size, src->num, src->list, dest);
if (retval)
return retval;
@@ -271,11 +271,11 @@
if (bb->magic != EXT2_ET_MAGIC_BADBLOCKS_LIST)
return 0;
-
+
if (iter->ptr < bb->num) {
*blk = bb->list[iter->ptr++];
return 1;
- }
+ }
*blk = 0;
return 0;
}
diff --git a/lib/ext2fs/bb_compat.c b/lib/ext2fs/bb_compat.c
index 40f7343..5a158b3 100644
--- a/lib/ext2fs/bb_compat.c
+++ b/lib/ext2fs/bb_compat.c
@@ -1,6 +1,6 @@
/*
* bb_compat.c --- compatibility badblocks routines
- *
+ *
* Copyright (C) 1997 Theodore Ts'o.
*
* %Begin-Header%
diff --git a/lib/ext2fs/bb_inode.c b/lib/ext2fs/bb_inode.c
index dbda79f..cbeeb98 100644
--- a/lib/ext2fs/bb_inode.c
+++ b/lib/ext2fs/bb_inode.c
@@ -1,12 +1,12 @@
/*
* bb_inode.c --- routines to update the bad block inode.
- *
+ *
* WARNING: This routine modifies a lot of state in the filesystem; if
* this routine returns an error, the bad block inode may be in an
* inconsistent state.
- *
+ *
* Copyright (C) 1994, 1995 Theodore Ts'o.
- *
+ *
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
@@ -49,7 +49,7 @@
e2_blkcnt_t blockcnt,
blk_t ref_block, int ref_offset,
void *priv_data);
-
+
/*
* Given a bad blocks bitmap, update the bad blocks inode to reflect
* the map.
@@ -59,12 +59,12 @@
errcode_t retval;
struct set_badblock_record rec;
struct ext2_inode inode;
-
+
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
if (!fs->block_map)
return EXT2_ET_NO_BLOCK_BITMAP;
-
+
rec.bad_block_count = 0;
rec.ind_blocks_size = rec.ind_blocks_ptr = 0;
rec.max_ind_blocks = 10;
@@ -78,9 +78,9 @@
goto cleanup;
memset(rec.block_buf, 0, fs->blocksize);
rec.err = 0;
-
+
/*
- * First clear the old bad blocks (while saving the indirect blocks)
+ * First clear the old bad blocks (while saving the indirect blocks)
*/
retval = ext2fs_block_iterate2(fs, EXT2_BAD_INO,
BLOCK_FLAG_DEPTH_TRAVERSE, 0,
@@ -91,7 +91,7 @@
retval = rec.err;
goto cleanup;
}
-
+
/*
* Now set the bad blocks!
*
@@ -108,22 +108,22 @@
BLOCK_FLAG_APPEND, 0,
set_bad_block_proc, &rec);
ext2fs_badblocks_list_iterate_end(rec.bb_iter);
- if (retval)
+ if (retval)
goto cleanup;
if (rec.err) {
retval = rec.err;
goto cleanup;
}
}
-
+
/*
* Update the bad block inode's mod time and block count
- * field.
+ * field.
*/
retval = ext2fs_read_inode(fs, EXT2_BAD_INO, &inode);
if (retval)
goto cleanup;
-
+
inode.i_atime = inode.i_mtime = fs->now ? fs->now : time(0);
if (!inode.i_ctime)
inode.i_ctime = fs->now ? fs->now : time(0);
@@ -133,7 +133,7 @@
retval = ext2fs_write_inode(fs, EXT2_BAD_INO, &inode);
if (retval)
goto cleanup;
-
+
cleanup:
ext2fs_free_mem(&rec.ind_blocks);
ext2fs_free_mem(&rec.block_buf);
@@ -176,7 +176,7 @@
if (rec->ind_blocks_size >= rec->max_ind_blocks) {
old_size = rec->max_ind_blocks * sizeof(blk_t);
rec->max_ind_blocks += 10;
- retval = ext2fs_resize_mem(old_size,
+ retval = ext2fs_resize_mem(old_size,
rec->max_ind_blocks * sizeof(blk_t),
&rec->ind_blocks);
if (retval) {
@@ -192,12 +192,12 @@
* Mark the block as unused, and update accounting information
*/
ext2fs_block_alloc_stats(fs, *block_nr, -1);
-
+
*block_nr = 0;
return BLOCK_CHANGED;
}
-
+
/*
* Helper function for update_bb_inode()
*
@@ -250,12 +250,12 @@
return BLOCK_ABORT;
}
}
-
+
/*
* Update block counts
*/
ext2fs_block_alloc_stats(fs, blk, +1);
-
+
*block_nr = blk;
return BLOCK_CHANGED;
}
diff --git a/lib/ext2fs/bitmaps.c b/lib/ext2fs/bitmaps.c
index b033fa3..ea08b3e 100644
--- a/lib/ext2fs/bitmaps.c
+++ b/lib/ext2fs/bitmaps.c
@@ -46,7 +46,7 @@
void ext2fs_set_bitmap_padding(ext2fs_generic_bitmap map)
{
ext2fs_set_generic_bitmap_padding(map);
-}
+}
errcode_t ext2fs_allocate_inode_bitmap(ext2_filsys fs,
const char *descr,
@@ -79,9 +79,9 @@
start = fs->super->s_first_data_block;
end = fs->super->s_blocks_count-1;
- real_end = (EXT2_BLOCKS_PER_GROUP(fs->super)
+ real_end = (EXT2_BLOCKS_PER_GROUP(fs->super)
* fs->group_desc_count)-1 + start;
-
+
return (ext2fs_make_generic_bitmap(EXT2_ET_MAGIC_BLOCK_BITMAP, fs,
start, end, real_end,
descr, 0, ret));
@@ -168,7 +168,7 @@
blk_t start, unsigned int num,
void *in)
{
- return (ext2fs_set_generic_bitmap_range(bmap,
+ return (ext2fs_set_generic_bitmap_range(bmap,
EXT2_ET_MAGIC_BLOCK_BITMAP,
start, num, in));
}
diff --git a/lib/ext2fs/bitops.c b/lib/ext2fs/bitops.c
index 9c34847..485e997 100644
--- a/lib/ext2fs/bitops.c
+++ b/lib/ext2fs/bitops.c
@@ -1,7 +1,7 @@
/*
* bitops.c --- Bitmap frobbing code. See bitops.h for the inlined
* routines.
- *
+ *
* Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
*
* %Begin-Header%
diff --git a/lib/ext2fs/bitops.h b/lib/ext2fs/bitops.h
index 391b8cd..82ca138 100644
--- a/lib/ext2fs/bitops.h
+++ b/lib/ext2fs/bitops.h
@@ -1,14 +1,14 @@
/*
* bitops.h --- Bitmap frobbing code. The byte swapping routines are
* also included here.
- *
+ *
* Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
*
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
* %End-Header%
- *
+ *
* i386 bitops operations taken from <asm/bitops.h>, Copyright 1992,
* Linus Torvalds.
*/
@@ -118,7 +118,7 @@
/*
* The inline routines themselves...
- *
+ *
* If NO_INLINE_FUNCS is defined, then we won't try to do inline
* functions at all; they will be included as normal functions in
* inline.c
@@ -185,7 +185,7 @@
*/
struct __dummy_h { unsigned long a[100]; };
#define EXT2FS_ADDR (*(struct __dummy_h *) addr)
-#define EXT2FS_CONST_ADDR (*(const struct __dummy_h *) addr)
+#define EXT2FS_CONST_ADDR (*(const struct __dummy_h *) addr)
_INLINE_ int ext2fs_set_bit(unsigned int nr, void * addr)
{
@@ -230,7 +230,7 @@
return 0;
/* This looks at memory. Mark it volatile to tell gcc not to move it around */
__asm__ __volatile__(
- "cld\n\t"
+ "cld\n\t"
"xorl %%eax,%%eax\n\t"
"xorl %%edx,%%edx\n\t"
"repe; scasl\n\t"
@@ -250,7 +250,7 @@
{
unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
int set = 0, bit = offset & 31, res;
-
+
if (bit) {
/*
* Look for zero in first byte
@@ -376,7 +376,7 @@
d0 = ffs(*cp);
if (d0 == 0)
return size;
-
+
return res + d0 - 1;
}
@@ -384,10 +384,10 @@
{
unsigned char * p;
int set = 0, bit = offset & 7, res = 0, d0;
-
+
res = offset >> 3;
p = ((unsigned char *) addr) + res;
-
+
if (bit) {
set = ffs(*p & ~((1 << bit) - 1));
if (set)
@@ -405,7 +405,7 @@
return (res + d0 - 1);
}
-#endif
+#endif
_INLINE_ int ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap,
blk_t block)
@@ -417,35 +417,35 @@
_INLINE_ int ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
blk_t block)
{
- return ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap,
+ return ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap,
block);
}
_INLINE_ int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap,
blk_t block)
{
- return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,
+ return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,
block);
}
_INLINE_ int ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
ext2_ino_t inode)
{
- return ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap,
+ return ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap,
inode);
}
_INLINE_ int ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
ext2_ino_t inode)
{
- return ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap,
+ return ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap,
inode);
}
_INLINE_ int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
ext2_ino_t inode)
{
- return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,
+ return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,
inode);
}
@@ -464,7 +464,7 @@
_INLINE_ int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap,
blk_t block)
{
- return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,
+ return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,
block);
}
@@ -483,7 +483,7 @@
_INLINE_ int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
ext2_ino_t inode)
{
- return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,
+ return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,
inode);
}
diff --git a/lib/ext2fs/block.c b/lib/ext2fs/block.c
index 71fec23..b19c450 100644
--- a/lib/ext2fs/block.c
+++ b/lib/ext2fs/block.c
@@ -1,6 +1,6 @@
/*
* block.c --- iterate over all blocks in an inode
- *
+ *
* Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
*
* %Begin-Header%
@@ -80,7 +80,7 @@
ret |= BLOCK_ERROR;
return ret;
}
- ctx->errcode = ext2fs_read_ind_block(ctx->fs, *ind_block,
+ ctx->errcode = ext2fs_read_ind_block(ctx->fs, *ind_block,
ctx->ind_buf);
if (ctx->errcode) {
ret |= BLOCK_ERROR;
@@ -92,7 +92,7 @@
if (ctx->flags & BLOCK_FLAG_APPEND) {
for (i = 0; i < limit; i++, ctx->bcount++, block_nr++) {
flags = (*ctx->func)(ctx->fs, block_nr, ctx->bcount,
- *ind_block, offset,
+ *ind_block, offset,
ctx->priv_data);
changed |= flags;
if (flags & BLOCK_ABORT) {
@@ -106,7 +106,7 @@
if (*block_nr == 0)
continue;
flags = (*ctx->func)(ctx->fs, block_nr, ctx->bcount,
- *ind_block, offset,
+ *ind_block, offset,
ctx->priv_data);
changed |= flags;
if (flags & BLOCK_ABORT) {
@@ -132,7 +132,7 @@
check_for_ro_violation_return(ctx, ret);
return ret;
}
-
+
static int block_iterate_dind(blk_t *dind_block, blk_t ref_block,
int ref_offset, struct block_context *ctx)
{
@@ -157,7 +157,7 @@
ret |= BLOCK_ERROR;
return ret;
}
- ctx->errcode = ext2fs_read_ind_block(ctx->fs, *dind_block,
+ ctx->errcode = ext2fs_read_ind_block(ctx->fs, *dind_block,
ctx->dind_buf);
if (ctx->errcode) {
ret |= BLOCK_ERROR;
@@ -211,7 +211,7 @@
check_for_ro_violation_return(ctx, ret);
return ret;
}
-
+
static int block_iterate_tind(blk_t *tind_block, blk_t ref_block,
int ref_offset, struct block_context *ctx)
{
@@ -236,7 +236,7 @@
ret |= BLOCK_ERROR;
return ret;
}
- ctx->errcode = ext2fs_read_ind_block(ctx->fs, *tind_block,
+ ctx->errcode = ext2fs_read_ind_block(ctx->fs, *tind_block,
ctx->tind_buf);
if (ctx->errcode) {
ret |= BLOCK_ERROR;
@@ -290,7 +290,7 @@
check_for_ro_violation_return(ctx, ret);
return ret;
}
-
+
errcode_t ext2fs_block_iterate2(ext2_filsys fs,
ext2_ino_t ino,
int flags,
@@ -357,7 +357,7 @@
check_for_ro_violation_goto(&ctx, ret, abort_exit);
}
}
-
+
if (inode.i_flags & EXT4_EXTENTS_FL) {
ext2_extent_handle_t handle;
struct ext2fs_extent extent;
@@ -385,7 +385,7 @@
check_for_ro_violation_goto(&ctx, ret,
extent_errout);
if (r & BLOCK_CHANGED) {
- ctx.errcode =
+ ctx.errcode =
ext2fs_extent_set_bmap(handle,
(blk64_t) blockcnt++,
(blk64_t) blk, 0);
@@ -529,7 +529,7 @@
void *priv_data)
{
struct xlate xl;
-
+
xl.real_private = priv_data;
xl.func = func;
diff --git a/lib/ext2fs/bmap.c b/lib/ext2fs/bmap.c
index be7ccbc..4edf425 100644
--- a/lib/ext2fs/bmap.c
+++ b/lib/ext2fs/bmap.c
@@ -26,14 +26,14 @@
#endif
extern errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino,
- struct ext2_inode *inode,
+ struct ext2_inode *inode,
char *block_buf, int bmap_flags,
blk_t block, blk_t *phys_blk);
#define inode_bmap(inode, nr) ((inode)->i_block[(nr)])
-static _BMAP_INLINE_ errcode_t block_ind_bmap(ext2_filsys fs, int flags,
- blk_t ind, char *block_buf,
+static _BMAP_INLINE_ errcode_t block_ind_bmap(ext2_filsys fs, int flags,
+ blk_t ind, char *block_buf,
int *blocks_alloc,
blk_t nr, blk_t *ret_blk)
{
@@ -90,17 +90,17 @@
}
static _BMAP_INLINE_ errcode_t block_dind_bmap(ext2_filsys fs, int flags,
- blk_t dind, char *block_buf,
+ blk_t dind, char *block_buf,
int *blocks_alloc,
blk_t nr, blk_t *ret_blk)
{
blk_t b;
errcode_t retval;
blk_t addr_per_block;
-
+
addr_per_block = (blk_t) fs->blocksize >> 2;
- retval = block_ind_bmap(fs, flags & ~BMAP_SET, dind, block_buf,
+ retval = block_ind_bmap(fs, flags & ~BMAP_SET, dind, block_buf,
blocks_alloc, nr / addr_per_block, &b);
if (retval)
return retval;
@@ -110,17 +110,17 @@
}
static _BMAP_INLINE_ errcode_t block_tind_bmap(ext2_filsys fs, int flags,
- blk_t tind, char *block_buf,
+ blk_t tind, char *block_buf,
int *blocks_alloc,
blk_t nr, blk_t *ret_blk)
{
blk_t b;
errcode_t retval;
blk_t addr_per_block;
-
+
addr_per_block = (blk_t) fs->blocksize >> 2;
- retval = block_dind_bmap(fs, flags & ~BMAP_SET, tind, block_buf,
+ retval = block_dind_bmap(fs, flags & ~BMAP_SET, tind, block_buf,
blocks_alloc, nr / addr_per_block, &b);
if (retval)
return retval;
@@ -224,7 +224,7 @@
*phys_blk = inode_bmap(inode, block);
b = block ? inode_bmap(inode, block-1) : 0;
-
+
if ((*phys_blk == 0) && (bmap_flags & BMAP_ALLOC)) {
retval = ext2fs_alloc_block(fs, b, block_buf, &b);
if (retval)
@@ -235,7 +235,7 @@
}
goto done;
}
-
+
/* Indirect block */
block -= EXT2_NDIR_BLOCKS;
blk32 = *phys_blk;
@@ -255,13 +255,13 @@
inode_bmap(inode, EXT2_IND_BLOCK) = b;
blocks_alloc++;
}
- retval = block_ind_bmap(fs, bmap_flags, b, block_buf,
+ retval = block_ind_bmap(fs, bmap_flags, b, block_buf,
&blocks_alloc, block, &blk32);
if (retval == 0)
*phys_blk = blk32;
goto done;
}
-
+
/* Doubly indirect block */
block -= addr_per_block;
if (block < addr_per_block * addr_per_block) {
@@ -280,7 +280,7 @@
inode_bmap(inode, EXT2_DIND_BLOCK) = b;
blocks_alloc++;
}
- retval = block_dind_bmap(fs, bmap_flags, b, block_buf,
+ retval = block_dind_bmap(fs, bmap_flags, b, block_buf,
&blocks_alloc, block, &blk32);
if (retval == 0)
*phys_blk = blk32;
@@ -304,7 +304,7 @@
inode_bmap(inode, EXT2_TIND_BLOCK) = b;
blocks_alloc++;
}
- retval = block_tind_bmap(fs, bmap_flags, b, block_buf,
+ retval = block_tind_bmap(fs, bmap_flags, b, block_buf,
&blocks_alloc, block, &blk32);
if (retval == 0)
*phys_blk = blk32;
diff --git a/lib/ext2fs/bmove.c b/lib/ext2fs/bmove.c
index 7d4b21a..019db91 100644
--- a/lib/ext2fs/bmove.c
+++ b/lib/ext2fs/bmove.c
@@ -44,7 +44,7 @@
pb = (struct process_block_struct *) priv_data;
block = orig = *block_nr;
ret = 0;
-
+
/*
* Let's see if this is one which we need to relocate
*/
@@ -98,7 +98,7 @@
struct process_block_struct pb;
ext2_inode_scan scan;
char *block_buf;
-
+
retval = ext2fs_open_inode_scan(fs, 0, &scan);
if (retval)
return retval;
@@ -107,7 +107,7 @@
pb.error = 0;
pb.alloc_map = alloc_map ? alloc_map : fs->block_map;
pb.flags = flags;
-
+
retval = ext2fs_get_array(4, fs->blocksize, &block_buf);
if (retval)
return retval;
@@ -131,12 +131,12 @@
retval = ext2fs_get_next_inode(scan, &ino, &inode);
if (retval)
return retval;
-
+
while (ino) {
if ((inode.i_links_count == 0) ||
!ext2fs_inode_has_valid_blocks(&inode))
goto next;
-
+
pb.ino = ino;
pb.inode = &inode;
diff --git a/lib/ext2fs/brel.h b/lib/ext2fs/brel.h
index be97243..a7f9776 100644
--- a/lib/ext2fs/brel.h
+++ b/lib/ext2fs/brel.h
@@ -1,6 +1,6 @@
/*
* brel.h
- *
+ *
* Copyright (C) 1996, 1997 Theodore Ts'o.
*
* %Begin-Header%
@@ -47,7 +47,7 @@
* Initialize for iterating over the block relocation entries.
*/
errcode_t (*start_iter)(ext2_brel brel);
-
+
/*
* The iterator function for the inode relocation entries.
* Returns an inode number of 0 when out of entries.
diff --git a/lib/ext2fs/brel_ma.c b/lib/ext2fs/brel_ma.c
index 3753e9f..1c4f218 100644
--- a/lib/ext2fs/brel_ma.c
+++ b/lib/ext2fs/brel_ma.c
@@ -1,6 +1,6 @@
/*
* brel_ma.c
- *
+ *
* Copyright (C) 1996, 1997 Theodore Ts'o.
*
* TODO: rewrite to not use a direct array!!! (Fortunately this
@@ -61,18 +61,18 @@
if (retval)
goto errout;
memset(brel, 0, sizeof(struct ext2_block_relocation_table));
-
+
retval = ext2fs_get_mem(strlen(name)+1, &brel->name);
if (retval)
goto errout;
strcpy(brel->name, name);
-
+
retval = ext2fs_get_mem(sizeof(struct brel_ma), &ma);
if (retval)
goto errout;
memset(ma, 0, sizeof(struct brel_ma));
brel->priv_data = ma;
-
+
size = (size_t) (sizeof(struct ext2_block_relocate_entry) *
(max_block+1));
retval = ext2fs_get_array(max_block+1,
@@ -92,7 +92,7 @@
brel->move = bma_move;
brel->delete = bma_delete;
brel->free = bma_free;
-
+
*new_brel = brel;
return 0;
diff --git a/lib/ext2fs/check_desc.c b/lib/ext2fs/check_desc.c
index c84589b..299cb01 100644
--- a/lib/ext2fs/check_desc.c
+++ b/lib/ext2fs/check_desc.c
@@ -1,6 +1,6 @@
/*
* check_desc.c --- Check the group descriptors of an ext2 filesystem
- *
+ *
* Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
*
* %Begin-Header%
@@ -53,7 +53,7 @@
EXT4_FEATURE_INCOMPAT_FLEX_BG)) {
first_block = ext2fs_group_first_block(fs, i);
last_block = ext2fs_group_last_block(fs, i);
- if (i == (fs->group_desc_count - 1))
+ if (i == (fs->group_desc_count - 1))
last_block = fs->super->s_blocks_count-1;
}
@@ -88,7 +88,7 @@
retval = EXT2_ET_GDESC_BAD_INODE_TABLE;
goto errout;
}
- for (j = 0, b = blk; j < fs->inode_blocks_per_group;
+ for (j = 0, b = blk; j < fs->inode_blocks_per_group;
j++, b++) {
if (ext2fs_test_block_bitmap(bmap, b)) {
retval = EXT2_ET_GDESC_BAD_INODE_TABLE;
diff --git a/lib/ext2fs/closefs.c b/lib/ext2fs/closefs.c
index 206faa6..baf8ce1 100644
--- a/lib/ext2fs/closefs.c
+++ b/lib/ext2fs/closefs.c
@@ -1,6 +1,6 @@
/*
* closefs.c --- close an ext2 filesystem
- *
+ *
* Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
*
* %Begin-Header%
@@ -58,7 +58,7 @@
*
* See also the comment for ext2fs_reserve_super_and_bgd()
*/
-int ext2fs_super_and_bgd_loc(ext2_filsys fs,
+int ext2fs_super_and_bgd_loc(ext2_filsys fs,
dgrp_t group,
blk_t *ret_super_blk,
blk_t *ret_old_desc_blk,
@@ -75,7 +75,7 @@
if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG)
old_desc_blocks = fs->super->s_first_meta_bg;
else
- old_desc_blocks =
+ old_desc_blocks =
fs->desc_blocks + fs->super->s_reserved_gdt_blocks;
if (group == fs->group_desc_count-1) {
@@ -112,7 +112,7 @@
numblocks--;
}
}
-
+
numblocks -= 2 + fs->inode_blocks_per_group;
if (ret_super_blk)
@@ -200,7 +200,7 @@
struct ext2_super_block *super_shadow)
{
dgrp_t sgrp = group;
-
+
if (sgrp > ((1 << 16) - 1))
sgrp = (1 << 16) - 1;
#ifdef WORDS_BIGENDIAN
@@ -209,7 +209,7 @@
fs->super->s_block_group_nr = sgrp;
#endif
- return io_channel_write_blk(fs->io, group_block, -SUPERBLOCK_SIZE,
+ return io_channel_write_blk(fs->io, group_block, -SUPERBLOCK_SIZE,
super_shadow);
}
@@ -228,7 +228,7 @@
#endif
char *group_ptr;
int old_desc_blocks;
-
+
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
fs_state = fs->super->s_state;
@@ -241,13 +241,13 @@
retval = ext2fs_get_mem(SUPERBLOCK_SIZE, &super_shadow);
if (retval)
goto errout;
- retval = ext2fs_get_array(fs->desc_blocks, fs->blocksize,
+ retval = ext2fs_get_array(fs->desc_blocks, fs->blocksize,
&group_shadow);
if (retval)
goto errout;
memset(group_shadow, 0, (size_t) fs->blocksize *
fs->desc_blocks);
-
+
/* swap the group descriptors */
for (j=0, s=fs->group_desc, t=group_shadow;
j < fs->group_desc_count; j++, t++, s++) {
@@ -258,7 +258,7 @@
super_shadow = fs->super;
group_shadow = fs->group_desc;
#endif
-
+
/*
* Set the state of the FS to be non-valid. (The state has
* already been backed up earlier, and will be restored after
@@ -293,7 +293,7 @@
blk_t super_blk, old_desc_blk, new_desc_blk;
int meta_bg;
- ext2fs_super_and_bgd_loc(fs, i, &super_blk, &old_desc_blk,
+ ext2fs_super_and_bgd_loc(fs, i, &super_blk, &old_desc_blk,
&new_desc_blk, &meta_bg);
if (!(fs->flags & EXT2_FLAG_MASTER_SB_ONLY) &&i && super_blk) {
@@ -304,7 +304,7 @@
}
if (fs->flags & EXT2_FLAG_SUPER_ONLY)
continue;
- if ((old_desc_blk) &&
+ if ((old_desc_blk) &&
(!(fs->flags & EXT2_FLAG_MASTER_SB_ONLY) || (i == 0))) {
retval = io_channel_write_blk(fs->io,
old_desc_blk, old_desc_blocks, group_ptr);
@@ -370,7 +370,7 @@
errcode_t ext2fs_close(ext2_filsys fs)
{
errcode_t retval;
-
+
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
if (fs->flags & EXT2_FLAG_DIRTY) {
diff --git a/lib/ext2fs/csum.c b/lib/ext2fs/csum.c
index 257d713..459c3c0 100644
--- a/lib/ext2fs/csum.c
+++ b/lib/ext2fs/csum.c
@@ -63,7 +63,7 @@
{
if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
EXT4_FEATURE_RO_COMPAT_GDT_CSUM) &&
- (fs->group_desc[group].bg_checksum !=
+ (fs->group_desc[group].bg_checksum !=
ext2fs_group_desc_csum(fs, group)))
return 0;
diff --git a/lib/ext2fs/dblist.c b/lib/ext2fs/dblist.c
index 188e36e..4a80367 100644
--- a/lib/ext2fs/dblist.c
+++ b/lib/ext2fs/dblist.c
@@ -1,13 +1,13 @@
/*
* dblist.c -- directory block list functions
- *
+ *
* Copyright 1997 by Theodore Ts'o
- *
+ *
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
* %End-Header%
- *
+ *
*/
#include <stdio.h>
@@ -33,7 +33,7 @@
ext2_ino_t num_dirs, max_dirs;
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
-
+
num_dirs = 0;
max_dirs = fs->super->s_inodes_per_group;
for (i = 0; i < fs->group_desc_count; i++) {
@@ -89,7 +89,7 @@
&dblist->list);
if (retval)
goto cleanup;
-
+
if (list)
memcpy(dblist->list, list, len);
else
@@ -159,7 +159,7 @@
struct ext2_db_entry *new_entry;
errcode_t retval;
unsigned long old_size;
-
+
EXT2_CHECK_MAGIC(dblist, EXT2_ET_MAGIC_DBLIST);
if (dblist->count >= dblist->size) {
@@ -190,7 +190,7 @@
int blockcnt)
{
dgrp_t i;
-
+
EXT2_CHECK_MAGIC(dblist, EXT2_ET_MAGIC_DBLIST);
for (i=0; i < dblist->count; i++) {
@@ -226,7 +226,7 @@
{
ext2_ino_t i;
int ret;
-
+
EXT2_CHECK_MAGIC(dblist, EXT2_ET_MAGIC_DBLIST);
if (!dblist->sorted)
@@ -248,7 +248,7 @@
if (db_a->blk != db_b->blk)
return (int) (db_a->blk - db_b->blk);
-
+
if (db_a->ino != db_b->ino)
return (int) (db_a->ino - db_b->ino);
@@ -260,7 +260,7 @@
return (int) dblist->count;
}
-errcode_t ext2fs_dblist_get_last(ext2_dblist dblist,
+errcode_t ext2fs_dblist_get_last(ext2_dblist dblist,
struct ext2_db_entry **entry)
{
EXT2_CHECK_MAGIC(dblist, EXT2_ET_MAGIC_DBLIST);
@@ -274,7 +274,7 @@
}
errcode_t ext2fs_dblist_drop_last(ext2_dblist dblist)
-{
+{
EXT2_CHECK_MAGIC(dblist, EXT2_ET_MAGIC_DBLIST);
if (dblist->count == 0)
diff --git a/lib/ext2fs/dblist_dir.c b/lib/ext2fs/dblist_dir.c
index 28a04c7..6f370cd 100644
--- a/lib/ext2fs/dblist_dir.c
+++ b/lib/ext2fs/dblist_dir.c
@@ -2,12 +2,12 @@
* dblist_dir.c --- iterate by directory entry
*
* Copyright 1997 by Theodore Ts'o
- *
+ *
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
* %End-Header%
- *
+ *
*/
#include <stdio.h>
@@ -54,7 +54,7 @@
ctx.errcode = 0;
retval = ext2fs_dblist_iterate(dblist, db_dir_proc, &ctx);
-
+
if (!block_buf)
ext2fs_free_mem(&ctx.buf);
if (retval)
@@ -71,7 +71,7 @@
ctx = (struct dir_context *) priv_data;
ctx->dir = db_info->ino;
ctx->errcode = 0;
-
+
ret = ext2fs_process_dir_block(fs, &db_info->blk,
db_info->blockcnt, 0, 0, priv_data);
if ((ret & BLOCK_ABORT) && !ctx->errcode)
diff --git a/lib/ext2fs/dir_iterate.c b/lib/ext2fs/dir_iterate.c
index 6bb536b..1f8cf8f 100644
--- a/lib/ext2fs/dir_iterate.c
+++ b/lib/ext2fs/dir_iterate.c
@@ -1,6 +1,6 @@
/*
* dir_iterate.c --- ext2fs directory iteration operations
- *
+ *
* Copyright (C) 1993, 1994, 1994, 1995, 1996, 1997 Theodore Ts'o.
*
* %Begin-Header%
@@ -34,7 +34,7 @@
{
struct ext2_dir_entry *dirent;
int rec_len;
-
+
while (offset < final_offset) {
dirent = (struct ext2_dir_entry *)(buf + offset);
rec_len = (dirent->rec_len || fs->blocksize < 65536) ?
@@ -63,13 +63,13 @@
{
struct dir_context ctx;
errcode_t retval;
-
+
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
retval = ext2fs_check_directory(fs, dir);
if (retval)
return retval;
-
+
ctx.dir = dir;
ctx.flags = flags;
if (block_buf)
@@ -110,7 +110,7 @@
return (*xl->func)(dirent, offset, blocksize, buf, xl->real_private);
}
-extern errcode_t ext2fs_dir_iterate(ext2_filsys fs,
+extern errcode_t ext2fs_dir_iterate(ext2_filsys fs,
ext2_ino_t dir,
int flags,
char *block_buf,
@@ -122,7 +122,7 @@
void *priv_data)
{
struct xlate xl;
-
+
xl.real_private = priv_data;
xl.func = func;
@@ -155,7 +155,7 @@
return 0;
entry = blockcnt ? DIRENT_OTHER_FILE : DIRENT_DOT_FILE;
-
+
ctx->errcode = ext2fs_read_dir_block(fs, *blocknr, ctx->buf);
if (ctx->errcode)
return BLOCK_ABORT;
@@ -183,7 +183,7 @@
ctx->priv_data);
if (entry < DIRENT_OTHER_FILE)
entry++;
-
+
if (ret & DIRENT_CHANGED) {
rec_len = (dirent->rec_len || fs->blocksize < 65536) ?
dirent->rec_len : 65536;
@@ -193,10 +193,10 @@
do_abort++;
break;
}
-next:
+next:
if (next_real_entry == offset)
next_real_entry += rec_len;
-
+
if (ctx->flags & DIRENT_FLAG_INCLUDE_REMOVED) {
size = ((dirent->name_len & 0xFF) + 11) & ~3;
diff --git a/lib/ext2fs/dirblock.c b/lib/ext2fs/dirblock.c
index c61e001..501c656 100644
--- a/lib/ext2fs/dirblock.c
+++ b/lib/ext2fs/dirblock.c
@@ -1,6 +1,6 @@
/*
* dirblock.c --- directory block routines.
- *
+ *
* Copyright (C) 1995, 1996 Theodore Ts'o.
*
* %Begin-Header%
@@ -26,7 +26,7 @@
char *p, *end;
struct ext2_dir_entry *dirent;
unsigned int name_len, rec_len;
-
+
retval = io_channel_read_blk(fs->io, block, 1, buf);
if (retval)
diff --git a/lib/ext2fs/dirhash.c b/lib/ext2fs/dirhash.c
index 9fd2016..c42ccd9 100644
--- a/lib/ext2fs/dirhash.c
+++ b/lib/ext2fs/dirhash.c
@@ -2,7 +2,7 @@
* dirhash.c -- Calculate the hash of a directory entry
*
* Copyright (c) 2001 Daniel Phillips
- *
+ *
* Copyright (c) 2002 Theodore Ts'o.
*
* %Begin-Header%
@@ -25,7 +25,7 @@
* (see Applied Cryptography, 2nd edition, p448).
*
* Jeremy Fitzhardinge <jeremy@zip.com.au> 1998
- *
+ *
* This code is made available under the terms of the GPL
*/
#define DELTA 0x9E3779B9
@@ -37,10 +37,10 @@
__u32 a = in[0], b = in[1], c = in[2], d = in[3];
int n = 16;
- do {
- sum += DELTA;
- b0 += ((b1 << 4)+a) ^ (b1+sum) ^ ((b1 >> 5)+b);
- b1 += ((b0 << 4)+c) ^ (b0+sum) ^ ((b0 >> 5)+d);
+ do {
+ sum += DELTA;
+ b0 += ((b1 << 4)+a) ^ (b1+sum) ^ ((b1 >> 5)+b);
+ b1 += ((b0 << 4)+c) ^ (b0+sum) ^ ((b0 >> 5)+d);
} while(--n);
buf[0] += b0;
@@ -130,7 +130,7 @@
else
c = (int) *scp++;
hash = hash1 + (hash0 ^ (c * 7152373));
-
+
if (hash & 0x80000000) hash -= 0x7fffffff;
hash1 = hash0;
hash0 = hash;
@@ -177,11 +177,11 @@
* Returns the hash of a filename. If len is 0 and name is NULL, then
* this function can be used to test whether or not a hash version is
* supported.
- *
+ *
* The seed is an 4 longword (32 bits) "secret" which can be used to
* uniquify a hash. If the seed is all zero's, then some default seed
* may be used.
- *
+ *
* A particular hash version specifies whether or not the seed is
* represented, and whether or not the returned hash is 32 bits or 64
* bits. 32 bit hashes will return 0 for the minor hash.
@@ -213,7 +213,7 @@
if (i < 4)
memcpy(buf, seed, sizeof(buf));
}
-
+
switch (version) {
case EXT2_HASH_LEGACY_UNSIGNED:
unsigned_flag++;
diff --git a/lib/ext2fs/dosio.c b/lib/ext2fs/dosio.c
index d695b18..d93cc6a 100644
--- a/lib/ext2fs/dosio.c
+++ b/lib/ext2fs/dosio.c
@@ -2,7 +2,7 @@
* dosio.c -- Disk I/O module for the ext2fs/DOS library.
*
* Copyright (c) 1997 by Theodore Ts'o.
- *
+ *
* Copyright (c) 1997 Mark Habersack
* This file may be distributed under the terms of the GNU Public License.
*
@@ -179,7 +179,7 @@
PARTITION *part;
PTABLE_ENTRY *pent;
PARTITION **newparts;
-
+
if(!dev)
{
_dio_error = ERR_BADDEV;
diff --git a/lib/ext2fs/dupfs.c b/lib/ext2fs/dupfs.c
index 1cf314c..2f9bedc 100644
--- a/lib/ext2fs/dupfs.c
+++ b/lib/ext2fs/dupfs.c
@@ -1,6 +1,6 @@
/*
* dupfs.c --- duplicate a ext2 filesystem handle
- *
+ *
* Copyright (C) 1997, 1998, 2001, 2003, 2005 by Theodore Ts'o.
*
* %Begin-Header%
@@ -25,7 +25,7 @@
errcode_t retval;
EXT2_CHECK_MAGIC(src, EXT2_ET_MAGIC_EXT2FS_FILSYS);
-
+
retval = ext2fs_get_mem(sizeof(struct struct_ext2_filsys), &fs);
if (retval)
return retval;
@@ -91,6 +91,6 @@
errout:
ext2fs_free(fs);
return retval;
-
+
}
diff --git a/lib/ext2fs/e2image.h b/lib/ext2fs/e2image.h
index e12b7d6..c05d43e 100644
--- a/lib/ext2fs/e2image.h
+++ b/lib/ext2fs/e2image.h
@@ -1,10 +1,10 @@
/*
* e2image.h --- header file describing the ext2 image format
- *
+ *
* Copyright (C) 2000 Theodore Ts'o.
*
* Note: this uses the POSIX IO interfaces, unlike most of the other
- * functions in this library. So sue me.
+ * functions in this library. So sue me.
*
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
@@ -24,7 +24,7 @@
char fs_uuid[16]; /* UUID of filesystem */
__u32 fs_blocksize; /* Block size of the filesystem */
__u32 fs_reserved[8];
-
+
__u32 image_device; /* Device number of image file */
__u32 image_inode; /* Inode number of image file */
__u32 image_time; /* Time of image creation */
@@ -37,15 +37,15 @@
__u32 offset_reserved[8];
};
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lib/ext2fs/expanddir.c b/lib/ext2fs/expanddir.c
index c124d3e..934eaf1 100644
--- a/lib/ext2fs/expanddir.c
+++ b/lib/ext2fs/expanddir.c
@@ -1,6 +1,6 @@
/*
* expand.c --- expand an ext2fs directory
- *
+ *
* Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999 Theodore Ts'o.
*
* %Begin-Header%
@@ -36,7 +36,7 @@
static blk_t last_blk = 0;
char *block;
errcode_t retval;
-
+
if (*blocknr) {
last_blk = *blocknr;
return 0;
@@ -62,7 +62,7 @@
}
memset(block, 0, fs->blocksize);
retval = io_channel_write_blk(fs->io, new_blk, 1, block);
- }
+ }
if (retval) {
es->err = retval;
return BLOCK_ABORT;
@@ -83,7 +83,7 @@
errcode_t retval;
struct expand_dir_struct es;
struct ext2_inode inode;
-
+
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
if (!(fs->flags & EXT2_FLAG_RW))
@@ -95,11 +95,11 @@
retval = ext2fs_check_directory(fs, dir);
if (retval)
return retval;
-
+
es.done = 0;
es.err = 0;
es.newblocks = 0;
-
+
retval = ext2fs_block_iterate2(fs, dir, BLOCK_FLAG_APPEND,
0, expand_dir_proc, &es);
@@ -114,7 +114,7 @@
retval = ext2fs_read_inode(fs, dir, &inode);
if (retval)
return retval;
-
+
inode.i_size += fs->blocksize;
ext2fs_iblk_add_blocks(fs, &inode, es.newblocks);
diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h
index 554c708..d7d7bdb 100644
--- a/lib/ext2fs/ext2_fs.h
+++ b/lib/ext2fs/ext2_fs.h
@@ -666,7 +666,7 @@
#define EXT2_DEFM_XATTR_USER 0x0004
#define EXT2_DEFM_ACL 0x0008
#define EXT2_DEFM_UID16 0x0010
-#define EXT3_DEFM_JMODE 0x0060
+#define EXT3_DEFM_JMODE 0x0060
#define EXT3_DEFM_JMODE_DATA 0x0020
#define EXT3_DEFM_JMODE_ORDERED 0x0040
#define EXT3_DEFM_JMODE_WBACK 0x0060
diff --git a/lib/ext2fs/ext2_io.h b/lib/ext2fs/ext2_io.h
index dce2138..2a579e6 100644
--- a/lib/ext2fs/ext2_io.h
+++ b/lib/ext2fs/ext2_io.h
@@ -1,6 +1,6 @@
/*
* io.h --- the I/O manager abstraction
- *
+ *
* Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
*
* %Begin-Header%
@@ -76,7 +76,7 @@
errcode_t (*flush)(io_channel channel);
errcode_t (*write_byte)(io_channel channel, unsigned long offset,
int count, const void *data);
- errcode_t (*set_option)(io_channel channel, const char *option,
+ errcode_t (*set_option)(io_channel channel, const char *option,
const char *arg);
errcode_t (*get_stats)(io_channel channel, io_stats *io_stats);
errcode_t (*read_blk64)(io_channel channel, unsigned long long block,
@@ -98,11 +98,11 @@
#define io_channel_write_blk(c,b,n,d) ((c)->manager->write_blk((c),b,n,d))
#define io_channel_flush(c) ((c)->manager->flush((c)))
#define io_channel_bumpcount(c) ((c)->refcount++)
-
+
/* io_manager.c */
-extern errcode_t io_channel_set_options(io_channel channel,
+extern errcode_t io_channel_set_options(io_channel channel,
const char *options);
-extern errcode_t io_channel_write_byte(io_channel channel,
+extern errcode_t io_channel_write_byte(io_channel channel,
unsigned long offset,
int count, const void *data);
extern errcode_t io_channel_read_blk64(io_channel channel,
@@ -130,4 +130,4 @@
(int blksize, errcode_t err);
#endif /* _EXT2FS_EXT2_IO_H */
-
+
diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h
index 04a95a2..e02a55f 100644
--- a/lib/ext2fs/ext2fs.h
+++ b/lib/ext2fs/ext2fs.h
@@ -1,6 +1,6 @@
/*
* ext2fs.h --- ext2fs
- *
+ *
* Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
*
* %Begin-Header%
@@ -259,7 +259,7 @@
* This is used by ext2fs_expand_dir() to be able to add a new block
* to an inode. It can also be used for programs that want to be able
* to deal with files that contain "holes".
- *
+ *
* BLOCK_FLAG_DEPTH_TRAVERSE indicates that the iterator function for
* the indirect, doubly indirect, etc. blocks should be called after
* all of the blocks containined in the indirect blocks are processed.
@@ -269,7 +269,7 @@
* BLOCK_FLAG_DATA_ONLY indicates that the iterator function should be
* called for data blocks only.
*
- * BLOCK_FLAG_READ_ONLY is a promise by the caller that it will not
+ * BLOCK_FLAG_READ_ONLY is a promise by the caller that it will not
* modify returned block number.
*
* BLOCK_FLAG_NO_LARGE is for internal use only. It informs
@@ -295,7 +295,7 @@
/*
* Flags for ext2fs_move_blocks
*/
-#define EXT2_BMOVE_GET_DBLIST 0x0001
+#define EXT2_BMOVE_GET_DBLIST 0x0001
#define EXT2_BMOVE_DEBUG 0x0002
#endif
@@ -560,7 +560,7 @@
blk_t *ret);
extern errcode_t ext2fs_alloc_block(ext2_filsys fs, blk_t goal,
char *block_buf, blk_t *ret);
-extern void ext2fs_set_alloc_block_callback(ext2_filsys fs,
+extern void ext2fs_set_alloc_block_callback(ext2_filsys fs,
errcode_t (*func)(ext2_filsys fs,
blk64_t goal,
blk64_t *ret),
@@ -569,10 +569,10 @@
blk64_t *ret));
/* alloc_sb.c */
-extern int ext2fs_reserve_super_and_bgd(ext2_filsys fs,
+extern int ext2fs_reserve_super_and_bgd(ext2_filsys fs,
dgrp_t group,
ext2fs_block_bitmap bmap);
-extern void ext2fs_set_block_alloc_stats_callback(ext2_filsys fs,
+extern void ext2fs_set_block_alloc_stats_callback(ext2_filsys fs,
void (*func)(ext2_filsys fs,
blk64_t blk,
int inuse),
@@ -706,10 +706,10 @@
/* bmap.c */
extern errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino,
- struct ext2_inode *inode,
+ struct ext2_inode *inode,
char *block_buf, int bmap_flags,
blk_t block, blk_t *phys_blk);
-extern errcode_t ext2fs_bmap2(ext2_filsys fs, ext2_ino_t ino,
+extern errcode_t ext2fs_bmap2(ext2_filsys fs, ext2_ino_t ino,
struct ext2_inode *inode,
char *block_buf, int bmap_flags, blk64_t block,
int *ret_flags, blk64_t *phys_blk);
@@ -729,7 +729,7 @@
extern errcode_t ext2fs_close(ext2_filsys fs);
extern errcode_t ext2fs_flush(ext2_filsys fs);
extern int ext2fs_bg_has_super(ext2_filsys fs, int group_block);
-extern int ext2fs_super_and_bgd_loc(ext2_filsys fs,
+extern int ext2fs_super_and_bgd_loc(ext2_filsys fs,
dgrp_t group,
blk_t *ret_super_blk,
blk_t *ret_old_desc_blk,
@@ -760,7 +760,7 @@
extern errcode_t ext2fs_copy_dblist(ext2_dblist src,
ext2_dblist *dest);
extern int ext2fs_dblist_count(ext2_dblist dblist);
-extern errcode_t ext2fs_dblist_get_last(ext2_dblist dblist,
+extern errcode_t ext2fs_dblist_get_last(ext2_dblist dblist,
struct ext2_db_entry **entry);
extern errcode_t ext2fs_dblist_drop_last(ext2_dblist dblist);
@@ -796,7 +796,7 @@
/* dir_iterate.c */
-extern errcode_t ext2fs_dir_iterate(ext2_filsys fs,
+extern errcode_t ext2fs_dir_iterate(ext2_filsys fs,
ext2_ino_t dir,
int flags,
char *block_buf,
@@ -806,7 +806,7 @@
char *buf,
void *priv_data),
void *priv_data);
-extern errcode_t ext2fs_dir_iterate2(ext2_filsys fs,
+extern errcode_t ext2fs_dir_iterate2(ext2_filsys fs,
ext2_ino_t dir,
int flags,
char *block_buf,
@@ -890,8 +890,8 @@
/* gen_bitmap.c */
extern void ext2fs_free_generic_bitmap(ext2fs_inode_bitmap bitmap);
-extern errcode_t ext2fs_make_generic_bitmap(errcode_t magic, ext2_filsys fs,
- __u32 start, __u32 end,
+extern errcode_t ext2fs_make_generic_bitmap(errcode_t magic, ext2_filsys fs,
+ __u32 start, __u32 end,
__u32 real_end,
const char *descr, char *init_map,
ext2fs_generic_bitmap *ret);
@@ -904,9 +904,9 @@
ext2fs_generic_bitmap *dest);
extern void ext2fs_clear_generic_bitmap(ext2fs_generic_bitmap bitmap);
extern errcode_t ext2fs_fudge_generic_bitmap_end(ext2fs_inode_bitmap bitmap,
- errcode_t magic,
+ errcode_t magic,
errcode_t neq,
- ext2_ino_t end,
+ ext2_ino_t end,
ext2_ino_t *oend);
extern void ext2fs_set_generic_bitmap_padding(ext2fs_generic_bitmap map);
extern errcode_t ext2fs_resize_generic_bitmap(errcode_t magic,
@@ -960,10 +960,10 @@
extern void ext2fs_free_icount(ext2_icount_t icount);
extern errcode_t ext2fs_create_icount_tdb(ext2_filsys fs, char *tdb_dir,
int flags, ext2_icount_t *ret);
-extern errcode_t ext2fs_create_icount2(ext2_filsys fs, int flags,
+extern errcode_t ext2fs_create_icount2(ext2_filsys fs, int flags,
unsigned int size,
ext2_icount_t hint, ext2_icount_t *ret);
-extern errcode_t ext2fs_create_icount(ext2_filsys fs, int flags,
+extern errcode_t ext2fs_create_icount(ext2_filsys fs, int flags,
unsigned int size,
ext2_icount_t *ret);
extern errcode_t ext2fs_icount_fetch(ext2_icount_t icount, ext2_ino_t ino,
@@ -979,9 +979,9 @@
/* inode.c */
extern errcode_t ext2fs_flush_icache(ext2_filsys fs);
-extern errcode_t ext2fs_get_next_inode_full(ext2_inode_scan scan,
+extern errcode_t ext2fs_get_next_inode_full(ext2_inode_scan scan,
ext2_ino_t *ino,
- struct ext2_inode *inode,
+ struct ext2_inode *inode,
int bufsize);
extern errcode_t ext2fs_open_inode_scan(ext2_filsys fs, int buffer_blocks,
ext2_inode_scan *ret_scan);
@@ -1000,12 +1000,12 @@
extern int ext2fs_inode_scan_flags(ext2_inode_scan scan, int set_flags,
int clear_flags);
extern errcode_t ext2fs_read_inode_full(ext2_filsys fs, ext2_ino_t ino,
- struct ext2_inode * inode,
+ struct ext2_inode * inode,
int bufsize);
extern errcode_t ext2fs_read_inode (ext2_filsys fs, ext2_ino_t ino,
struct ext2_inode * inode);
extern errcode_t ext2fs_write_inode_full(ext2_filsys fs, ext2_ino_t ino,
- struct ext2_inode * inode,
+ struct ext2_inode * inode,
int bufsize);
extern errcode_t ext2fs_write_inode(ext2_filsys fs, ext2_ino_t ino,
struct ext2_inode * inode);
@@ -1016,12 +1016,12 @@
/* inode_io.c */
extern io_manager inode_io_manager;
-extern errcode_t ext2fs_inode_io_intern(ext2_filsys fs, ext2_ino_t ino,
+extern errcode_t ext2fs_inode_io_intern(ext2_filsys fs, ext2_ino_t ino,
char **name);
extern errcode_t ext2fs_inode_io_intern2(ext2_filsys fs, ext2_ino_t ino,
struct ext2_inode *inode,
char **name);
-
+
/* ismounted.c */
extern errcode_t ext2fs_check_if_mounted(const char *file, int *mount_flags);
extern errcode_t ext2fs_check_mount_point(const char *device, int *mount_flags,
@@ -1064,11 +1064,11 @@
extern errcode_t ext2fs_open(const char *name, int flags, int superblock,
unsigned int block_size, io_manager manager,
ext2_filsys *ret_fs);
-extern errcode_t ext2fs_open2(const char *name, const char *io_options,
- int flags, int superblock,
+extern errcode_t ext2fs_open2(const char *name, const char *io_options,
+ int flags, int superblock,
unsigned int block_size, io_manager manager,
ext2_filsys *ret_fs);
-extern blk_t ext2fs_descriptor_block_loc(ext2_filsys fs, blk_t group_block,
+extern blk_t ext2fs_descriptor_block_loc(ext2_filsys fs, blk_t group_block,
dgrp_t i);
errcode_t ext2fs_get_data_io(ext2_filsys fs, io_channel *old_io);
errcode_t ext2fs_set_data_io(ext2_filsys fs, io_channel new_io);
@@ -1089,14 +1089,14 @@
ext2_badblocks_list *bb_list);
/* read_bb_file.c */
-extern errcode_t ext2fs_read_bb_FILE2(ext2_filsys fs, FILE *f,
+extern errcode_t ext2fs_read_bb_FILE2(ext2_filsys fs, FILE *f,
ext2_badblocks_list *bb_list,
void *priv_data,
void (*invalid)(ext2_filsys fs,
blk_t blk,
char *badstr,
void *priv_data));
-extern errcode_t ext2fs_read_bb_FILE(ext2_filsys fs, FILE *f,
+extern errcode_t ext2fs_read_bb_FILE(ext2_filsys fs, FILE *f,
ext2_badblocks_list *bb_list,
void (*invalid)(ext2_filsys fs,
blk_t blk));
@@ -1105,7 +1105,7 @@
extern errcode_t ext2fs_create_resize_inode(ext2_filsys fs);
/* swapfs.c */
-extern void ext2fs_swap_ext_attr(char *to, char *from, int bufsize,
+extern void ext2fs_swap_ext_attr(char *to, char *from, int bufsize,
int has_header);
extern void ext2fs_swap_ext_attr_header(struct ext2_ext_attr_header *to_header,
struct ext2_ext_attr_header *from_hdr);
@@ -1210,7 +1210,7 @@
memcpy(ptr, &p, sizeof(p));
return 0;
}
-
+
/*
* Resize memory
*/
diff --git a/lib/ext2fs/ext2fsP.h b/lib/ext2fs/ext2fsP.h
index eea32d6..c666faa 100644
--- a/lib/ext2fs/ext2fsP.h
+++ b/lib/ext2fs/ext2fsP.h
@@ -1,6 +1,6 @@
/*
* ext2fsP.h --- private header file for ext2 library
- *
+ *
* Copyright (C) 1997 Theodore Ts'o.
*
* %Begin-Header%
diff --git a/lib/ext2fs/ext_attr.c b/lib/ext2fs/ext_attr.c
index 3d208ec..9f5e10f 100644
--- a/lib/ext2fs/ext_attr.c
+++ b/lib/ext2fs/ext_attr.c
@@ -1,6 +1,6 @@
/*
* ext_attr.c --- extended attribute blocks
- *
+ *
* Copyright (C) 2001 Andreas Gruenbacher, <a.gruenbacher@computer.org>
*
* Copyright (C) 2002 Theodore Ts'o.
diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c
index a2cf679..929e5cd 100644
--- a/lib/ext2fs/extent.c
+++ b/lib/ext2fs/extent.c
@@ -147,7 +147,7 @@
eh_max = (size - sizeof(*eh)) / entry_size;
/* Allow two extent-sized items at the end of the block, for
* ext4_extent_tail with checksum in the future. */
- if ((ext2fs_le16_to_cpu(eh->eh_max) > eh_max) ||
+ if ((ext2fs_le16_to_cpu(eh->eh_max) > eh_max) ||
(ext2fs_le16_to_cpu(eh->eh_max) < (eh_max - 2)))
return EXT2_ET_EXTENT_HEADER_BAD;
@@ -731,7 +731,7 @@
return retval;
}
-errcode_t ext2fs_extent_replace(ext2_extent_handle_t handle,
+errcode_t ext2fs_extent_replace(ext2_extent_handle_t handle,
int flags EXT2FS_ATTR((unused)),
struct ext2fs_extent *extent)
{
@@ -1426,7 +1426,7 @@
if (common_args_process(argc, argv, min_argc, max_argc, cmd,
usage, flags))
return 1;
-
+
if (!current_handle) {
com_err(cmd, 0, "Extent handle not open");
return 1;
diff --git a/lib/ext2fs/fileio.c b/lib/ext2fs/fileio.c
index 8bf99fb..70325a8 100644
--- a/lib/ext2fs/fileio.c
+++ b/lib/ext2fs/fileio.c
@@ -1,6 +1,6 @@
/*
* fileio.c --- Simple file I/O routines
- *
+ *
* Copyright (C) 1997 Theodore Ts'o.
*
* %Begin-Header%
@@ -50,7 +50,7 @@
retval = ext2fs_get_mem(sizeof(struct ext2_file), &file);
if (retval)
return retval;
-
+
memset(file, 0, sizeof(struct ext2_file));
file->magic = EXT2_ET_MAGIC_EXT2_FILE;
file->fs = fs;
@@ -64,14 +64,14 @@
if (retval)
goto fail;
}
-
+
retval = ext2fs_get_array(3, fs->blocksize, &file->buf);
if (retval)
goto fail;
*ret = file;
return 0;
-
+
fail:
if (file->buf)
ext2fs_free_mem(&file->buf);
@@ -103,7 +103,7 @@
{
errcode_t retval;
ext2_filsys fs;
-
+
EXT2_CHECK_MAGIC(file, EXT2_ET_MAGIC_EXT2_FILE);
fs = file->fs;
@@ -176,7 +176,7 @@
if (!dontfill) {
if (file->physblock) {
retval = io_channel_read_blk(fs->io,
- file->physblock,
+ file->physblock,
1, file->buf);
if (retval)
return retval;
@@ -187,16 +187,16 @@
}
return 0;
}
-
+
errcode_t ext2fs_file_close(ext2_file_t file)
{
errcode_t retval;
-
+
EXT2_CHECK_MAGIC(file, EXT2_ET_MAGIC_EXT2_FILE);
retval = ext2fs_file_flush(file);
-
+
if (file->buf)
ext2fs_free_mem(&file->buf);
ext2fs_free_mem(&file);
@@ -232,14 +232,14 @@
left = EXT2_I_SIZE(&file->inode) - file->pos ;
if (c > left)
c = left;
-
+
memcpy(ptr, file->buf+start, c);
file->pos += c;
ptr += c;
count += c;
wanted -= c;
}
-
+
fail:
if (got)
*got = count;
@@ -265,7 +265,7 @@
retval = sync_buffer_position(file);
if (retval)
goto fail;
-
+
start = file->pos % fs->blocksize;
c = fs->blocksize - start;
if (c > nbytes)
@@ -286,7 +286,7 @@
count += c;
nbytes -= c;
}
-
+
fail:
if (written)
*written = count;
@@ -318,7 +318,7 @@
{
__u64 loffset, ret_loffset;
errcode_t retval;
-
+
loffset = offset;
retval = ext2fs_file_llseek(file, loffset, whence, &ret_loffset);
if (ret_pos)
@@ -354,14 +354,14 @@
/*
* This function sets the size of the file, truncating it if necessary
- *
+ *
* XXX still need to call truncate
*/
errcode_t ext2fs_file_set_size(ext2_file_t file, ext2_off_t size)
{
errcode_t retval;
EXT2_CHECK_MAGIC(file, EXT2_ET_MAGIC_EXT2_FILE);
-
+
file->inode.i_size = size;
file->inode.i_size_high = 0;
if (file->ino) {
@@ -370,7 +370,7 @@
return retval;
}
- /*
+ /*
* XXX truncate inode if necessary
*/
diff --git a/lib/ext2fs/finddev.c b/lib/ext2fs/finddev.c
index 2e9d70a..56b76df 100644
--- a/lib/ext2fs/finddev.c
+++ b/lib/ext2fs/finddev.c
@@ -1,7 +1,7 @@
/*
* finddev.c -- this routine attempts to find a particular device in
* /dev
- *
+ *
* Copyright (C) 2000 Theodore Ts'o.
*
* %Begin-Header%
@@ -134,7 +134,7 @@
add_to_dirlist("/devices", &list);
add_to_dirlist("/devfs", &list);
add_to_dirlist("/dev", &list);
-
+
while (list) {
current = list;
list = list->next;
@@ -160,7 +160,7 @@
return ret_path;
}
-
+
#ifdef DEBUG
int main(int argc, char** argv)
{
@@ -204,5 +204,5 @@
}
return 0;
}
-
+
#endif
diff --git a/lib/ext2fs/flushb.c b/lib/ext2fs/flushb.c
index 1882795..f0630ea 100644
--- a/lib/ext2fs/flushb.c
+++ b/lib/ext2fs/flushb.c
@@ -1,7 +1,7 @@
/*
* flushb.c --- Hides system-dependent information for both syncing a
* device to disk and to flush any buffers from disk cache.
- *
+ *
* Copyright (C) 2000 Theodore Ts'o.
*
* %Begin-Header%
@@ -29,7 +29,7 @@
#include "ext2fs.h"
/*
- * For Linux, define BLKFLSBUF and FDFLUSH if necessary, since
+ * For Linux, define BLKFLSBUF and FDFLUSH if necessary, since
* not all portable header file does so for us. This really should be
* fixed in the glibc header files. (Recent glibcs appear to define
* BLKFLSBUF in sys/mount.h, but FDFLUSH still doesn't seem to be
diff --git a/lib/ext2fs/freefs.c b/lib/ext2fs/freefs.c
index d6ac901..2a1c915 100644
--- a/lib/ext2fs/freefs.c
+++ b/lib/ext2fs/freefs.c
@@ -1,6 +1,6 @@
/*
* freefs.c --- free an ext2 filesystem
- *
+ *
* Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
*
* %Begin-Header%
@@ -52,7 +52,7 @@
if (fs->icache)
ext2fs_free_inode_cache(fs->icache);
-
+
fs->magic = 0;
ext2fs_free_mem(&fs);
diff --git a/lib/ext2fs/gen_bitmap.c b/lib/ext2fs/gen_bitmap.c
index 66172e5..a1b1d8f 100644
--- a/lib/ext2fs/gen_bitmap.c
+++ b/lib/ext2fs/gen_bitmap.c
@@ -1,6 +1,6 @@
/*
* gen_bitmap.c --- Generic (32-bit) bitmap routines
- *
+ *
* Copyright (C) 2001 Theodore Ts'o.
*
* %Begin-Header%
@@ -38,7 +38,7 @@
__u32 reserved[7];
};
-/*
+/*
* Used by previously inlined function, so we have to export this and
* not change the function signature
*/
@@ -63,7 +63,7 @@
return 0;
}
-errcode_t ext2fs_make_generic_bitmap(errcode_t magic, ext2_filsys fs,
+errcode_t ext2fs_make_generic_bitmap(errcode_t magic, ext2_filsys fs,
__u32 start, __u32 end, __u32 real_end,
const char *descr, char *init_map,
ext2fs_generic_bitmap *ret)
@@ -72,7 +72,7 @@
errcode_t retval;
size_t size;
- retval = ext2fs_get_mem(sizeof(struct ext2fs_struct_generic_bitmap),
+ retval = ext2fs_get_mem(sizeof(struct ext2fs_struct_generic_bitmap),
&bitmap);
if (retval)
return retval;
@@ -124,7 +124,7 @@
const char *descr,
ext2fs_generic_bitmap *ret)
{
- return ext2fs_make_generic_bitmap(EXT2_ET_MAGIC_GENERIC_BITMAP, 0,
+ return ext2fs_make_generic_bitmap(EXT2_ET_MAGIC_GENERIC_BITMAP, 0,
start, end, real_end, descr, 0, ret);
}
@@ -132,7 +132,7 @@
ext2fs_generic_bitmap *dest)
{
return (ext2fs_make_generic_bitmap(src->magic, src->fs,
- src->start, src->end,
+ src->start, src->end,
src->real_end,
src->description, src->bitmap,
dest));
@@ -209,7 +209,7 @@
ext2_ino_t end, ext2_ino_t *oend)
{
EXT2_CHECK_MAGIC(bitmap, magic);
-
+
if (end > bitmap->real_end)
return neq;
if (oend)
@@ -244,7 +244,7 @@
bmap->end = new_end;
return 0;
}
-
+
size = ((bmap->real_end - bmap->start) / 8) + 1;
new_size = ((new_real_end - bmap->start) / 8) + 1;
@@ -266,7 +266,7 @@
ext2fs_generic_bitmap bm2)
{
blk_t i;
-
+
if (!bm1 || bm1->magic != magic)
return magic;
if (!bm2 || bm2->magic != magic)
@@ -291,8 +291,8 @@
__u32 i, j;
/* Protect loop from wrap-around if map->real_end is maxed */
- for (i=map->end+1, j = i - map->start;
- i <= map->real_end && i > map->end;
+ for (i=map->end+1, j = i - map->start;
+ i <= map->real_end && i > map->end;
i++, j++)
ext2fs_set_bit(j, map->bitmap);
}
@@ -348,7 +348,7 @@
blk_t block, int num)
{
int i;
-
+
if ((block < bitmap->start) || (block+num-1 > bitmap->end)) {
ext2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_MARK, block,
bitmap->description);
@@ -362,13 +362,13 @@
blk_t block, int num)
{
int i;
-
+
if ((block < bitmap->start) || (block+num-1 > bitmap->end)) {
ext2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_UNMARK, block,
bitmap->description);
return;
}
for (i=0; i < num; i++)
- ext2fs_fast_clear_bit(block + i - bitmap->start,
+ ext2fs_fast_clear_bit(block + i - bitmap->start,
bitmap->bitmap);
}
diff --git a/lib/ext2fs/get_pathname.c b/lib/ext2fs/get_pathname.c
index 23f593f..c46b3a0 100644
--- a/lib/ext2fs/get_pathname.c
+++ b/lib/ext2fs/get_pathname.c
@@ -1,6 +1,6 @@
/*
* get_pathname.c --- do directry/inode -> name translation
- *
+ *
* Copyright (C) 1993, 1994, 1995 Theodore Ts'o.
*
* %Begin-Header%
@@ -15,7 +15,7 @@
* directory inode, and <ino> is the inode number itself. If
* <ino> is zero, then ext2fs_get_pathname will return pathname
* of the the directory <dir>.
- *
+ *
*/
#include <stdio.h>
@@ -65,8 +65,8 @@
return 0;
}
-static errcode_t ext2fs_get_pathname_int(ext2_filsys fs, ext2_ino_t dir,
- ext2_ino_t ino, int maxdepth,
+static errcode_t ext2fs_get_pathname_int(ext2_filsys fs, ext2_ino_t dir,
+ ext2_ino_t ino, int maxdepth,
char *buf, char **name)
{
struct get_pathname_struct gp;
@@ -93,7 +93,7 @@
gp.parent = 0;
gp.name = 0;
gp.errcode = 0;
-
+
retval = ext2fs_dir_iterate(fs, dir, 0, buf, get_pathname_proc, &gp);
if (retval)
goto cleanup;
@@ -110,15 +110,15 @@
*name = parent_name;
return 0;
}
-
- if (gp.name)
+
+ if (gp.name)
retval = ext2fs_get_mem(strlen(parent_name)+strlen(gp.name)+2,
&ret);
else
retval = ext2fs_get_mem(strlen(parent_name)+5, &ret);
if (retval)
goto cleanup;
-
+
ret[0] = 0;
if (parent_name[1])
strcat(ret, parent_name);
@@ -130,7 +130,7 @@
*name = ret;
ext2fs_free_mem(&parent_name);
retval = 0;
-
+
cleanup:
if (gp.name)
ext2fs_free_mem(&gp.name);
@@ -153,5 +153,5 @@
retval = ext2fs_get_pathname_int(fs, dir, ino, 32, buf, name);
ext2fs_free_mem(&buf);
return retval;
-
+
}
diff --git a/lib/ext2fs/getsectsize.c b/lib/ext2fs/getsectsize.c
index e749d39..ae9139d 100644
--- a/lib/ext2fs/getsectsize.c
+++ b/lib/ext2fs/getsectsize.c
@@ -1,6 +1,6 @@
/*
* getsectsize.c --- get the sector size of a device.
- *
+ *
* Copyright (C) 1995, 1995 Theodore Ts'o.
* Copyright (C) 2003 VMware, Inc.
*
diff --git a/lib/ext2fs/getsize.c b/lib/ext2fs/getsize.c
index 7f6ef71..b45e285 100644
--- a/lib/ext2fs/getsize.c
+++ b/lib/ext2fs/getsize.c
@@ -1,11 +1,11 @@
/*
* getsize.c --- get the size of a partition.
- *
+ *
* Copyright (C) 1995, 1995 Theodore Ts'o.
* Copyright (C) 2003 VMware, Inc.
*
* Windows version of ext2fs_get_device_size by Chris Li, VMware.
- *
+ *
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
@@ -82,10 +82,10 @@
DWORD filesize;
#endif /* HAVE_GET_FILE_SIZE_EX */
- dev = CreateFile(file, GENERIC_READ,
+ dev = CreateFile(file, GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE ,
- NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-
+ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+
if (dev == INVALID_HANDLE_VALUE)
return EBADF;
if (DeviceIoControl(dev, IOCTL_DISK_GET_PARTITION_INFO,
@@ -94,7 +94,7 @@
&retbytes, NULL)) {
*retblocks = pi.PartitionLength.QuadPart / blocksize;
-
+
} else if (DeviceIoControl(dev, IOCTL_DISK_GET_DRIVE_GEOMETRY,
&gi, sizeof(DISK_GEOMETRY),
&gi, sizeof(DISK_GEOMETRY),
@@ -300,7 +300,7 @@
{
blk_t blocks;
int retval;
-
+
if (argc < 2) {
fprintf(stderr, "Usage: %s device\n", argv[0]);
exit(1);
diff --git a/lib/ext2fs/imager.c b/lib/ext2fs/imager.c
index 9f7534a..0154333 100644
--- a/lib/ext2fs/imager.c
+++ b/lib/ext2fs/imager.c
@@ -5,7 +5,7 @@
* Copyright (C) 2000 Theodore Ts'o.
*
* Note: this uses the POSIX IO interfaces, unlike most of the other
- * functions in this library. So sue me.
+ * functions in this library. So sue me.
*
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
@@ -69,7 +69,7 @@
buf = malloc(fs->blocksize * BUF_BLOCKS);
if (!buf)
return ENOMEM;
-
+
for (group = 0; group < fs->group_desc_count; group++) {
blk = fs->group_desc[(unsigned)group].bg_inode_table;
if (!blk) {
@@ -131,7 +131,7 @@
/*
* Read in the inode table and stuff it into place
*/
-errcode_t ext2fs_image_inode_read(ext2_filsys fs, int fd,
+errcode_t ext2fs_image_inode_read(ext2_filsys fs, int fd,
int flags EXT2FS_ATTR((unused)))
{
unsigned int group, c, left;
@@ -143,7 +143,7 @@
buf = malloc(fs->blocksize * BUF_BLOCKS);
if (!buf)
return ENOMEM;
-
+
for (group = 0; group < fs->group_desc_count; group++) {
blk = fs->group_desc[(unsigned)group].bg_inode_table;
if (!blk) {
@@ -167,7 +167,7 @@
retval = io_channel_write_blk(fs->io, blk, c, buf);
if (retval)
goto errout;
-
+
blk += c;
left -= c;
}
@@ -182,7 +182,7 @@
/*
* Write out superblock and group descriptors
*/
-errcode_t ext2fs_image_super_write(ext2_filsys fs, int fd,
+errcode_t ext2fs_image_super_write(ext2_filsys fs, int fd,
int flags EXT2FS_ATTR((unused)))
{
char *buf, *cp;
@@ -221,7 +221,7 @@
retval = EXT2_ET_SHORT_WRITE;
goto errout;
}
-
+
retval = 0;
errout:
@@ -232,7 +232,7 @@
/*
* Read the superblock and group descriptors and overwrite them.
*/
-errcode_t ext2fs_image_super_read(ext2_filsys fs, int fd,
+errcode_t ext2fs_image_super_read(ext2_filsys fs, int fd,
int flags EXT2FS_ATTR((unused)))
{
char *buf;
@@ -314,7 +314,7 @@
if (size > (cnt >> 3))
size = (cnt >> 3);
- retval = ext2fs_get_generic_bitmap_range(bmap,
+ retval = ext2fs_get_generic_bitmap_range(bmap,
err, itr, size << 3, buf);
if (retval)
return retval;
@@ -324,7 +324,7 @@
return errno;
if (actual != (int) size)
return EXT2_ET_SHORT_READ;
-
+
itr += size << 3;
cnt -= size << 3;
}
@@ -396,7 +396,7 @@
if (actual != (int) size)
return EXT2_ET_SHORT_READ;
- retval = ext2fs_set_generic_bitmap_range(bmap,
+ retval = ext2fs_set_generic_bitmap_range(bmap,
err, itr, size << 3, buf);
if (retval)
return retval;
diff --git a/lib/ext2fs/ind_block.c b/lib/ext2fs/ind_block.c
index efd7fb1..09c0432 100644
--- a/lib/ext2fs/ind_block.c
+++ b/lib/ext2fs/ind_block.c
@@ -1,7 +1,7 @@
/*
* ind_block.c --- indirect block I/O routines
- *
- * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ *
+ * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
* 2001, 2002, 2003, 2004, 2005 by Theodore Ts'o.
*
* %Begin-Header%
diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c
index aa4f424..22d1899 100644
--- a/lib/ext2fs/initialize.c
+++ b/lib/ext2fs/initialize.c
@@ -1,9 +1,9 @@
/*
* initialize.c --- initialize a filesystem handle given superblock
* parameters. Used by mke2fs when initializing a filesystem.
- *
+ *
* Copyright (C) 1994, 1995, 1996 Theodore Ts'o.
- *
+ *
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
@@ -44,13 +44,13 @@
#endif /* defined(__FreeBSD__) && defined(EXT2_OS_FREEBSD) */
#endif /* defined(__GNU__) && defined(EXT2_OS_HURD) */
#endif /* defined(__linux__) && defined(EXT2_OS_LINUX) */
-
+
/*
* Note we override the kernel include file's idea of what the default
* check interval (never) should be. It's a good idea to check at
* least *occasionally*, specially since servers will never rarely get
* to reboot, since Linux is so robust these days. :-)
- *
+ *
* 180 days (six months) seems like a good value.
*/
#ifdef EXT2_DFL_CHECKINTERVAL
@@ -110,11 +110,11 @@
if (!param || !param->s_blocks_count)
return EXT2_ET_INVALID_ARGUMENT;
-
+
retval = ext2fs_get_mem(sizeof(struct struct_ext2_filsys), &fs);
if (retval)
return retval;
-
+
memset(fs, 0, sizeof(struct struct_ext2_filsys));
fs->magic = EXT2_ET_MAGIC_EXT2FS_FILSYS;
fs->flags = flags | EXT2_FLAG_RW;
@@ -199,7 +199,7 @@
if (super->s_blocks_per_group > EXT2_MAX_BLOCKS_PER_GROUP(super))
super->s_blocks_per_group = EXT2_MAX_BLOCKS_PER_GROUP(super);
super->s_frags_per_group = super->s_blocks_per_group * frags_per_block;
-
+
super->s_blocks_count = param->s_blocks_count;
super->s_r_blocks_count = param->s_r_blocks_count;
if (super->s_r_blocks_count >= param->s_blocks_count) {
@@ -238,7 +238,7 @@
*/
if (super->s_inodes_count < EXT2_FIRST_INODE(super)+1)
super->s_inodes_count = EXT2_FIRST_INODE(super)+1;
-
+
/*
* There should be at least as many inodes as the user
* requested. Figure out how many inodes per group that
@@ -358,13 +358,13 @@
retval = ext2fs_get_mem(strlen(fs->device_name) + 80, &buf);
if (retval)
goto cleanup;
-
+
strcpy(buf, "block bitmap for ");
strcat(buf, fs->device_name);
retval = ext2fs_allocate_block_bitmap(fs, buf, &fs->block_map);
if (retval)
goto cleanup;
-
+
strcpy(buf, "inode bitmap for ");
strcat(buf, fs->device_name);
retval = ext2fs_allocate_inode_bitmap(fs, buf, &fs->inode_map);
@@ -420,7 +420,7 @@
fs->group_desc[i].bg_used_dirs_count = 0;
ext2fs_group_desc_csum_set(fs, i);
}
-
+
c = (char) 255;
if (((int) c) == -1) {
super->s_flags |= EXT2_FLAGS_SIGNED_HASH;
@@ -431,7 +431,7 @@
ext2fs_mark_super_dirty(fs);
ext2fs_mark_bb_dirty(fs);
ext2fs_mark_ib_dirty(fs);
-
+
io_channel_set_blksize(fs->io, fs->blocksize);
*ret_fs = fs;
diff --git a/lib/ext2fs/inline.c b/lib/ext2fs/inline.c
index 5833b1d..13e2f83 100644
--- a/lib/ext2fs/inline.c
+++ b/lib/ext2fs/inline.c
@@ -2,7 +2,7 @@
* inline.c --- Includes the inlined functions defined in the header
* files as standalone functions, in case the application program
* is compiled with inlining turned off.
- *
+ *
* Copyright (C) 1993, 1994 Theodore Ts'o.
*
* %Begin-Header%
diff --git a/lib/ext2fs/inode.c b/lib/ext2fs/inode.c
index b45de87..b75cb77 100644
--- a/lib/ext2fs/inode.c
+++ b/lib/ext2fs/inode.c
@@ -1,6 +1,6 @@
/*
* inode.c --- utility routines to read and write inodes
- *
+ *
* Copyright (C) 1993, 1994, 1995, 1996, 1997 Theodore Ts'o.
*
* %Begin-Header%
@@ -59,7 +59,7 @@
errcode_t ext2fs_flush_icache(ext2_filsys fs)
{
int i;
-
+
if (!fs->icache)
return 0;
@@ -73,7 +73,7 @@
static errcode_t create_icache(ext2_filsys fs)
{
errcode_t retval;
-
+
if (fs->icache)
return 0;
retval = ext2fs_get_mem(sizeof(struct ext2_inode_cache), &fs->icache);
@@ -184,7 +184,7 @@
{
if (!scan || (scan->magic != EXT2_ET_MAGIC_INODE_SCAN))
return;
-
+
ext2fs_free_mem(&scan->inode_buffer);
scan->inode_buffer = NULL;
ext2fs_free_mem(&scan->temp_buffer);
@@ -202,7 +202,7 @@
{
if (!scan || (scan->magic != EXT2_ET_MAGIC_INODE_SCAN))
return;
-
+
scan->done_group = done_group;
scan->done_group_data = done_group_data;
}
@@ -358,7 +358,7 @@
if (retval)
return retval;
}
-
+
if ((scan->scan_flags & EXT2_SF_BAD_INODE_BLK) ||
(scan->current_block == 0)) {
memset(scan->inode_buffer, 0,
@@ -390,7 +390,7 @@
static inline int is_empty_scan(ext2_inode_scan scan)
{
int i;
-
+
if (scan->bytes_left == 0)
return 0;
@@ -406,7 +406,7 @@
{
errcode_t retval;
int extra_bytes = 0;
-
+
EXT2_CHECK_MAGIC(scan, EXT2_ET_MAGIC_INODE_SCAN);
/*
@@ -430,7 +430,7 @@
return retval;
}
/*
- * These checks are done outside the above if statement so
+ * These checks are done outside the above if statement so
* they can be done for block group #0.
*/
if ((scan->scan_flags & EXT2_SF_DO_LAZY) &&
@@ -445,7 +445,7 @@
} else
return EXT2_ET_MISSING_INODE_TABLE;
}
-
+
/*
* Have we run out of space in the inode buffer? If so, we
@@ -477,9 +477,9 @@
#ifdef WORDS_BIGENDIAN
memset(inode, 0, bufsize);
- ext2fs_swap_inode_full(scan->fs,
+ ext2fs_swap_inode_full(scan->fs,
(struct ext2_inode_large *) inode,
- (struct ext2_inode_large *) scan->temp_buffer,
+ (struct ext2_inode_large *) scan->temp_buffer,
0, bufsize);
#else
*inode = *((struct ext2_inode *) scan->temp_buffer);
@@ -490,7 +490,7 @@
} else {
#ifdef WORDS_BIGENDIAN
memset(inode, 0, bufsize);
- ext2fs_swap_inode_full(scan->fs,
+ ext2fs_swap_inode_full(scan->fs,
(struct ext2_inode_large *) inode,
(struct ext2_inode_large *) scan->ptr,
0, bufsize);
@@ -568,7 +568,7 @@
block = offset >> EXT2_BLOCK_SIZE_BITS(fs->super);
if (!fs->group_desc[(unsigned)group].bg_inode_table)
return EXT2_ET_MISSING_INODE_TABLE;
- block_nr = fs->group_desc[(unsigned)group].bg_inode_table +
+ block_nr = fs->group_desc[(unsigned)group].bg_inode_table +
block;
io = fs->io;
}
@@ -602,8 +602,8 @@
}
#ifdef WORDS_BIGENDIAN
- ext2fs_swap_inode_full(fs, (struct ext2_inode_large *) inode,
- (struct ext2_inode_large *) inode,
+ ext2fs_swap_inode_full(fs, (struct ext2_inode_large *) inode,
+ (struct ext2_inode_large *) inode,
0, bufsize);
#endif
@@ -612,7 +612,7 @@
fs->icache->cache_size;
fs->icache->cache[fs->icache->cache_last].ino = ino;
fs->icache->cache[fs->icache->cache_last].inode = *inode;
-
+
return 0;
}
@@ -654,7 +654,7 @@
if (retval)
return retval;
}
-
+
if (!(fs->flags & EXT2_FLAG_RW))
return EXT2_ET_RO_FILSYS;
@@ -674,8 +674,8 @@
memset(w_inode, 0, length);
#ifdef WORDS_BIGENDIAN
- ext2fs_swap_inode_full(fs, w_inode,
- (struct ext2_inode_large *) inode,
+ ext2fs_swap_inode_full(fs, w_inode,
+ (struct ext2_inode_large *) inode,
1, bufsize);
#else
memcpy(w_inode, inode, bufsize);
@@ -712,11 +712,11 @@
fs->icache->buffer_blk = block_nr;
}
-
- memcpy((char *) fs->icache->buffer + (unsigned) offset,
+
+ memcpy((char *) fs->icache->buffer + (unsigned) offset,
ptr, clen);
- retval = io_channel_write_blk(fs->io, block_nr, 1,
+ retval = io_channel_write_blk(fs->io, block_nr, 1,
fs->icache->buffer);
if (retval)
goto errout;
@@ -726,7 +726,7 @@
length -= clen;
block_nr++;
}
-
+
fs->flags |= EXT2_FLAG_CHANGED;
errout:
if (w_inode && w_inode != &temp_inode)
@@ -741,7 +741,7 @@
sizeof(struct ext2_inode));
}
-/*
+/*
* This function should be called when writing a new inode. It makes
* sure that extra part of large inodes is initialized properly.
*/
@@ -773,7 +773,7 @@
*buf = *inode;
large_inode = (struct ext2_inode_large *) buf;
- large_inode->i_extra_isize = sizeof(struct ext2_inode_large) -
+ large_inode->i_extra_isize = sizeof(struct ext2_inode_large) -
EXT2_GOOD_OLD_INODE_SIZE;
if (!large_inode->i_crtime)
large_inode->i_crtime = t;
@@ -783,13 +783,13 @@
return retval;
}
-
+
errcode_t ext2fs_get_blocks(ext2_filsys fs, ext2_ino_t ino, blk_t *blocks)
{
struct ext2_inode inode;
int i;
errcode_t retval;
-
+
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
if (ino > fs->super->s_inodes_count)
@@ -811,7 +811,7 @@
{
struct ext2_inode inode;
errcode_t retval;
-
+
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
if (ino > fs->super->s_inodes_count)
diff --git a/lib/ext2fs/inode_io.c b/lib/ext2fs/inode_io.c
index 0e23494..4d29a9f 100644
--- a/lib/ext2fs/inode_io.c
+++ b/lib/ext2fs/inode_io.c
@@ -56,11 +56,11 @@
static errcode_t inode_flush(io_channel channel);
static errcode_t inode_write_byte(io_channel channel, unsigned long offset,
int size, const void *data);
-static errcode_t inode_read_blk64(io_channel channel,
+static errcode_t inode_read_blk64(io_channel channel,
unsigned long long block, int count, void *data);
-static errcode_t inode_write_blk64(io_channel channel,
+static errcode_t inode_write_blk64(io_channel channel,
unsigned long long block, int count, const void *data);
-
+
static struct struct_io_manager struct_inode_manager = {
EXT2_ET_MAGIC_IO_MANAGER,
"Inode I/O Manager",
@@ -158,7 +158,7 @@
&data->file);
if (retval)
goto cleanup;
-
+
*channel = io;
return 0;
@@ -184,7 +184,7 @@
return 0;
retval = ext2fs_file_close(data->file);
-
+
ext2fs_free_mem(&channel->private_data);
if (channel->name)
ext2fs_free_mem(&channel->name);
@@ -251,7 +251,7 @@
return ext2fs_file_write(data->file, buf, count, 0);
}
-static errcode_t inode_write_blk(io_channel channel, unsigned long block,
+static errcode_t inode_write_blk(io_channel channel, unsigned long block,
int count, const void *buf)
{
return inode_write_blk64(channel, block, count, buf);
@@ -275,12 +275,12 @@
}
/*
- * Flush data buffers to disk.
+ * Flush data buffers to disk.
*/
static errcode_t inode_flush(io_channel channel)
{
struct inode_private_data *data;
-
+
EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);
data = (struct inode_private_data *) channel->private_data;
EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_INODE_IO_CHANNEL);
diff --git a/lib/ext2fs/io_manager.c b/lib/ext2fs/io_manager.c
index 8d73253..6d0e234 100644
--- a/lib/ext2fs/io_manager.c
+++ b/lib/ext2fs/io_manager.c
@@ -61,8 +61,8 @@
{
EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);
- if (channel->manager->write_byte)
- return channel->manager->write_byte(channel, offset,
+ if (channel->manager->write_byte)
+ return channel->manager->write_byte(channel, offset,
count, data);
return EXT2_ET_UNIMPLEMENTED;
diff --git a/lib/ext2fs/irel.h b/lib/ext2fs/irel.h
index 9b943ce..45e031b 100644
--- a/lib/ext2fs/irel.h
+++ b/lib/ext2fs/irel.h
@@ -1,6 +1,6 @@
/*
* irel.h
- *
+ *
* Copyright (C) 1996, 1997 Theodore Ts'o.
*
* %Begin-Header%
diff --git a/lib/ext2fs/irel_ma.c b/lib/ext2fs/irel_ma.c
index c6fa828..f565939 100644
--- a/lib/ext2fs/irel_ma.c
+++ b/lib/ext2fs/irel_ma.c
@@ -1,6 +1,6 @@
/*
* irel_ma.c
- *
+ *
* Copyright (C) 1996, 1997 Theodore Ts'o.
*
* %Begin-Header%
@@ -77,18 +77,18 @@
if (retval)
goto errout;
memset(irel, 0, sizeof(struct ext2_inode_relocation_table));
-
+
retval = ext2fs_get_mem(strlen(name)+1, &irel->name);
if (retval)
goto errout;
strcpy(irel->name, name);
-
+
retval = ext2fs_get_mem(sizeof(struct irel_ma), &ma);
if (retval)
goto errout;
memset(ma, 0, sizeof(struct irel_ma));
irel->priv_data = ma;
-
+
size = (size_t) (sizeof(ext2_ino_t) * (max_inode+1));
retval = ext2fs_get_array(max_inode+1, sizeof(ext2_ino_t),
&ma->orig_map);
@@ -127,7 +127,7 @@
irel->move = ima_move;
irel->delete = ima_delete;
irel->free = ima_free;
-
+
*new_irel = irel;
return 0;
@@ -156,7 +156,7 @@
ent->orig = old;
else
ent->orig = ma->entries[(unsigned) old].orig;
-
+
/*
* If max_refs has changed, reallocate the refs array
*/
@@ -245,12 +245,12 @@
ref_ent = ma->ref_entries + (unsigned) ino;
ent = ma->entries + (unsigned) ino;
-
+
/*
* If the inode reference array doesn't exist, create it.
*/
if (ref_ent->refs == 0) {
- size = (size_t) ((sizeof(struct ext2_inode_reference) *
+ size = (size_t) ((sizeof(struct ext2_inode_reference) *
ent->max_refs));
retval = ext2fs_get_array(ent->max_refs,
sizeof(struct ext2_inode_reference), &ref_ent->refs);
@@ -288,7 +288,7 @@
struct inode_reference_entry *ref_ent;
ma = irel->priv_data;
-
+
ref_ent = ma->ref_entries + ma->ref_current;
if ((ref_ent->refs == NULL) ||
@@ -311,12 +311,12 @@
return EXT2_ET_INVALID_ARGUMENT;
if (ma->entries[(unsigned) old].new == 0)
return ENOENT;
-
+
ma->entries[(unsigned) new] = ma->entries[(unsigned) old];
if (ma->ref_entries[(unsigned) new].refs)
ext2fs_free_mem(&ma->ref_entries[(unsigned) new].refs);
ma->ref_entries[(unsigned) new] = ma->ref_entries[(unsigned) old];
-
+
ma->entries[(unsigned) old].new = 0;
ma->ref_entries[(unsigned) old].num = 0;
ma->ref_entries[(unsigned) old].refs = 0;
@@ -334,12 +334,12 @@
return EXT2_ET_INVALID_ARGUMENT;
if (ma->entries[(unsigned) old].new == 0)
return ENOENT;
-
+
ma->entries[old].new = 0;
if (ma->ref_entries[(unsigned) old].refs)
ext2fs_free_mem(&ma->ref_entries[(unsigned) old].refs);
ma->orig_map[ma->entries[(unsigned) old].orig] = 0;
-
+
ma->ref_entries[(unsigned) old].num = 0;
ma->ref_entries[(unsigned) old].refs = 0;
return 0;
diff --git a/lib/ext2fs/ismounted.c b/lib/ext2fs/ismounted.c
index d6573ad..4a7c8c6 100644
--- a/lib/ext2fs/ismounted.c
+++ b/lib/ext2fs/ismounted.c
@@ -1,6 +1,6 @@
/*
* ismounted.c --- Check to see if the filesystem was mounted
- *
+ *
* Copyright (C) 1995,1996,1997,1998,1999,2000 Theodore Ts'o.
*
* %Begin-Header%
@@ -38,9 +38,9 @@
/*
* Helper function which checks a file in /etc/mtab format to see if a
* filesystem is mounted. Returns an error if the file doesn't exist
- * or can't be opened.
+ * or can't be opened.
*/
-static errcode_t check_mntent_file(const char *mtab_file, const char *file,
+static errcode_t check_mntent_file(const char *mtab_file, const char *file,
int *mount_flags, char *mtpt, int mtlen)
{
struct mntent *mnt;
@@ -103,7 +103,7 @@
}
#ifndef __GNU__ /* The GNU hurd is deficient; what else is new? */
/* Validate the entry in case /etc/mtab is out of date */
- /*
+ /*
* We need to be paranoid, because some broken distributions
* (read: Slackware) don't initialize /etc/mtab before checking
* all of the non-root filesystems on the disk.
@@ -128,7 +128,7 @@
}
#endif /* __GNU__ */
*mount_flags = EXT2_MF_MOUNTED;
-
+
#ifdef MNTOPT_RO
/* Check to see if the ro option is set */
if (hasmntopt(mnt, MNTOPT_RO))
@@ -145,7 +145,7 @@
*/
if (!strcmp(mnt->mnt_dir, "/")) {
is_root:
-#define TEST_FILE "/.ismount-test-file"
+#define TEST_FILE "/.ismount-test-file"
*mount_flags |= EXT2_MF_ISROOT;
fd = open(TEST_FILE, O_RDWR|O_CREAT, 0600);
if (fd < 0) {
@@ -184,7 +184,7 @@
#endif /* MOUNTED */
retval = check_mntent_file(MOUNTED, file, mount_flags, mtpt, mtlen);
return retval;
-#else
+#else
*mount_flags = 0;
return 0;
#endif /* defined(MOUNTED) || defined(_PATH_MOUNTED) */
@@ -209,7 +209,7 @@
s1 = file;
if (strncmp(_PATH_DEV, s1, len) == 0)
s1 += len;
-
+
*mount_flags = 0;
while (--n >= 0) {
s2 = mp->f_mntfromname;
@@ -299,7 +299,7 @@
} else {
#ifdef HAVE_MNTENT_H
retval = check_mntent(device, mount_flags, mtpt, mtlen);
-#else
+#else
#ifdef HAVE_GETMNTINFO
retval = check_getmntinfo(device, mount_flags, mtpt, mtlen);
#else
@@ -331,7 +331,7 @@
/*
* ext2fs_check_if_mounted() sets the mount_flags EXT2_MF_MOUNTED,
* EXT2_MF_READONLY, and EXT2_MF_ROOT
- *
+ *
*/
errcode_t ext2fs_check_if_mounted(const char *file, int *mount_flags)
{
@@ -343,7 +343,7 @@
{
int retval, mount_flags;
char mntpt[80];
-
+
if (argc < 2) {
fprintf(stderr, "Usage: %s device\n", argv[0]);
exit(1);
diff --git a/lib/ext2fs/jfs_dat.h b/lib/ext2fs/jfs_dat.h
index d6ad9c4..62778c6 100644
--- a/lib/ext2fs/jfs_dat.h
+++ b/lib/ext2fs/jfs_dat.h
@@ -9,7 +9,7 @@
* On-disk structures
*/
-/*
+/*
* Descriptor block types:
*/
@@ -28,8 +28,8 @@
} journal_header_t;
-/*
- * The block tag: used to describe a single buffer in the journal
+/*
+ * The block tag: used to describe a single buffer in the journal
*/
typedef struct journal_block_tag_s
{
@@ -55,10 +55,10 @@
__u32 s_blocksize; /* journal device blocksize */
__u32 s_maxlen; /* total blocks in journal file */
__u32 s_first; /* first block of log information */
-
+
/* Dynamic information describing the current state of the log */
__u32 s_sequence; /* first commit ID expected in log */
__u32 s_start; /* blocknr of start of log */
-
+
} journal_superblock_t;
diff --git a/lib/ext2fs/kernel-jbd.h b/lib/ext2fs/kernel-jbd.h
index 158d764..331b0e4 100644
--- a/lib/ext2fs/kernel-jbd.h
+++ b/lib/ext2fs/kernel-jbd.h
@@ -1,6 +1,6 @@
/*
* linux/include/linux/jbd.h
- *
+ *
* Written by Stephen C. Tweedie <sct@redhat.com>
*
* Copyright 1998-2000 Red Hat, Inc --- All Rights Reserved
@@ -59,7 +59,7 @@
#define jbd_debug(f, a...) /**/
#else
#define jbd_debug(f, ...) /**/
-#endif
+#endif
#endif
#else
#define jbd_debug(x) /* AIX doesn't do STDC */
@@ -88,7 +88,7 @@
* On-disk structures
*/
-/*
+/*
* Descriptor block types:
*/
@@ -133,8 +133,8 @@
__u32 h_commit_nsec;
};
-/*
- * The block tag: used to describe a single buffer in the journal
+/*
+ * The block tag: used to describe a single buffer in the journal
*/
typedef struct journal_block_tag_s
{
@@ -146,9 +146,9 @@
#define JBD_TAG_SIZE64 (sizeof(journal_block_tag_t))
#define JBD_TAG_SIZE32 (8)
-/*
+/*
* The revoke descriptor: used on disk to describe a series of blocks to
- * be revoked from the log
+ * be revoked from the log
*/
typedef struct journal_revoke_header_s
{
@@ -177,7 +177,7 @@
__u32 s_blocksize; /* journal device blocksize */
__u32 s_maxlen; /* total blocks in journal file */
__u32 s_first; /* first block of log information */
-
+
/* 0x0018 */
/* Dynamic information describing the current state of the log */
__u32 s_sequence; /* first commit ID expected in log */
@@ -197,9 +197,9 @@
/* 0x0040 */
__u32 s_nr_users; /* Nr of filesystems sharing log */
-
+
__u32 s_dynsuper; /* Blocknr of dynamic superblock copy*/
-
+
/* 0x0048 */
__u32 s_max_transaction; /* Limit of journal blocks per trans.*/
__u32 s_max_trans_data; /* Limit of data blocks per trans. */
@@ -311,7 +311,7 @@
* the transaction, so that at all times we know how many buffers the
* outstanding updates on a transaction might possibly touch. */
-struct handle_s
+struct handle_s
{
/* Which compound transaction is this update a part of? */
transaction_t * h_transaction;
@@ -349,14 +349,14 @@
* flushed to home for finished transactions.
*/
-struct transaction_s
+struct transaction_s
{
/* Pointer to the journal for this transaction. */
journal_t * t_journal;
-
+
/* Sequence number for this transaction */
tid_t t_tid;
-
+
/* Transaction's current state */
enum {
T_RUNNING,
@@ -364,74 +364,74 @@
T_RUNDOWN,
T_FLUSH,
T_COMMIT,
- T_FINISHED
+ T_FINISHED
} t_state;
/* Where in the log does this transaction's commit start? */
unsigned long t_log_start;
-
+
/* Doubly-linked circular list of all inodes owned by this
transaction */ /* AKPM: unused */
struct inode * t_ilist;
-
+
/* Number of buffers on the t_buffers list */
int t_nr_buffers;
-
+
/* Doubly-linked circular list of all buffers reserved but not
yet modified by this transaction */
struct journal_head * t_reserved_list;
-
+
/* Doubly-linked circular list of all metadata buffers owned by this
transaction */
struct journal_head * t_buffers;
-
+
/*
* Doubly-linked circular list of all data buffers still to be
* flushed before this transaction can be committed.
* Protected by journal_datalist_lock.
*/
struct journal_head * t_sync_datalist;
-
+
/*
* Doubly-linked circular list of all writepage data buffers
* still to be written before this transaction can be committed.
* Protected by journal_datalist_lock.
*/
struct journal_head * t_async_datalist;
-
+
/* Doubly-linked circular list of all forget buffers (superceded
buffers which we can un-checkpoint once this transaction
commits) */
struct journal_head * t_forget;
-
+
/*
* Doubly-linked circular list of all buffers still to be
* flushed before this transaction can be checkpointed.
*/
/* Protected by journal_datalist_lock */
struct journal_head * t_checkpoint_list;
-
+
/* Doubly-linked circular list of temporary buffers currently
undergoing IO in the log */
struct journal_head * t_iobuf_list;
-
+
/* Doubly-linked circular list of metadata buffers being
shadowed by log IO. The IO buffers on the iobuf list and the
shadow buffers on this list match each other one for one at
all times. */
struct journal_head * t_shadow_list;
-
+
/* Doubly-linked circular list of control buffers being written
to the log. */
struct journal_head * t_log_list;
-
+
/* Number of outstanding updates running on this transaction */
int t_updates;
/* Number of buffers reserved for use by all handles in this
* transaction handle but not yet modified. */
int t_outstanding_credits;
-
+
/*
* Forward and backward links for the circular list of all
* transactions awaiting checkpoint.
@@ -450,7 +450,7 @@
/* The journal_t maintains all of the journaling state information for a
* single filesystem. It is linked to from the fs superblock structure.
- *
+ *
* We use the journal_t to keep track of all outstanding transaction
* activity on the filesystem, and to manage the state of the log
* writing process. */
@@ -463,7 +463,7 @@
/* Is there an outstanding uncleared error on the journal (from
* a prior abort)? */
int j_errno;
-
+
/* The superblock buffer */
struct buffer_head * j_sb_buffer;
journal_superblock_t * j_superblock;
@@ -473,16 +473,16 @@
/* Number of processes waiting to create a barrier lock */
int j_barrier_count;
-
+
/* The barrier lock itself */
struct semaphore j_barrier;
-
+
/* Transactions: The current running transaction... */
transaction_t * j_running_transaction;
-
+
/* ... the transaction we are pushing to disk ... */
transaction_t * j_committing_transaction;
-
+
/* ... and a linked circular list of all transactions waiting
* for checkpointing. */
/* Protected by journal_datalist_lock */
@@ -491,19 +491,19 @@
/* Wait queue for waiting for a locked transaction to start
committing, or for a barrier lock to be released */
wait_queue_head_t j_wait_transaction_locked;
-
+
/* Wait queue for waiting for checkpointing to complete */
wait_queue_head_t j_wait_logspace;
-
+
/* Wait queue for waiting for commit to complete */
wait_queue_head_t j_wait_done_commit;
-
+
/* Wait queue to trigger checkpointing */
wait_queue_head_t j_wait_checkpoint;
-
+
/* Wait queue to trigger commit */
wait_queue_head_t j_wait_commit;
-
+
/* Wait queue to wait for updates to complete */
wait_queue_head_t j_wait_updates;
@@ -512,10 +512,10 @@
/* The main journal lock, used by lock_journal() */
struct semaphore j_sem;
-
+
/* Journal head: identifies the first unused block in the journal. */
unsigned long j_head;
-
+
/* Journal tail: identifies the oldest still-used block in the
* journal. */
unsigned long j_tail;
@@ -588,8 +588,8 @@
unsigned int j_failed_commit;
};
-/*
- * Journal flag definitions
+/*
+ * Journal flag definitions
*/
#define JFS_UNMOUNT 0x001 /* Journal thread is being destroyed */
#define JFS_ABORT 0x002 /* Journaling has been aborted for errors. */
@@ -597,7 +597,7 @@
#define JFS_FLUSHED 0x008 /* The journal superblock has been flushed */
#define JFS_LOADED 0x010 /* The journal superblock has been loaded */
-/*
+/*
* Function declarations for the journaling transaction and buffer
* management
*/
@@ -627,7 +627,7 @@
extern void __journal_insert_checkpoint(struct journal_head *,transaction_t *);
/* Buffer IO */
-extern int
+extern int
journal_write_metadata_buffer(transaction_t *transaction,
struct journal_head *jh_in,
struct journal_head **jh_out,
@@ -641,7 +641,7 @@
*
* We need to lock the journal during transaction state changes so that
* nobody ever tries to take a handle on the running transaction while
- * we are in the middle of moving it to the commit phase.
+ * we are in the middle of moving it to the commit phase.
*
* Note that the locking is completely interrupt unsafe. We never touch
* journal structures from interrupts.
@@ -675,7 +675,7 @@
/* The journaling code user interface:
*
* Create and destroy handles
- * Register buffer modifications against the current transaction.
+ * Register buffer modifications against the current transaction.
*/
extern handle_t *journal_start(journal_t *, int nblocks);
@@ -703,11 +703,11 @@
int start, int len, int bsize);
extern journal_t * journal_init_inode (struct inode *);
extern int journal_update_format (journal_t *);
-extern int journal_check_used_features
+extern int journal_check_used_features
(journal_t *, unsigned long, unsigned long, unsigned long);
-extern int journal_check_available_features
+extern int journal_check_available_features
(journal_t *, unsigned long, unsigned long, unsigned long);
-extern int journal_set_features
+extern int journal_set_features
(journal_t *, unsigned long, unsigned long, unsigned long);
extern int journal_create (journal_t *);
extern int journal_load (journal_t *journal);
@@ -785,7 +785,7 @@
* bit, when set, indicates that we have had a fatal error somewhere,
* either inside the journaling layer or indicated to us by the client
* (eg. ext3), and that we and should not commit any further
- * transactions.
+ * transactions.
*/
static inline int is_journal_aborted(journal_t *journal)
@@ -867,7 +867,7 @@
#define BJ_LogCtl 7 /* Buffer contains log descriptors */
#define BJ_Reserved 8 /* Buffer is reserved for access by journal */
#define BJ_Types 9
-
+
extern int jbd_blocks_per_page(struct inode *inode);
#ifdef __KERNEL__
diff --git a/lib/ext2fs/kernel-list.h b/lib/ext2fs/kernel-list.h
index 24e6ab4..e07d06b 100644
--- a/lib/ext2fs/kernel-list.h
+++ b/lib/ext2fs/kernel-list.h
@@ -29,7 +29,7 @@
#endif
/*
- * Insert a new entry between two known consecutive entries.
+ * Insert a new entry between two known consecutive entries.
*
* This is only for internal list manipulation where we know
* the prev/next entries already!
diff --git a/lib/ext2fs/link.c b/lib/ext2fs/link.c
index b283488..5ed6394 100644
--- a/lib/ext2fs/link.c
+++ b/lib/ext2fs/link.c
@@ -1,6 +1,6 @@
/*
* link.c --- create links in a ext2fs directory
- *
+ *
* Copyright (C) 1993, 1994 Theodore Ts'o.
*
* %Begin-Header%
@@ -26,7 +26,7 @@
int done;
unsigned int blocksize;
struct ext2_super_block *sb;
-};
+};
static int link_proc(struct ext2_dir_entry *dirent,
int offset,
@@ -99,7 +99,7 @@
#ifdef __TURBOC__
#pragma argsused
#endif
-errcode_t ext2fs_link(ext2_filsys fs, ext2_ino_t dir, const char *name,
+errcode_t ext2fs_link(ext2_filsys fs, ext2_ino_t dir, const char *name,
ext2_ino_t ino, int flags)
{
errcode_t retval;
diff --git a/lib/ext2fs/llseek.c b/lib/ext2fs/llseek.c
index 5a5e560..073cf91 100644
--- a/lib/ext2fs/llseek.c
+++ b/lib/ext2fs/llseek.c
@@ -74,7 +74,7 @@
#ifndef __i386__
retval = _llseek(fd, ((unsigned long long) offset) >> 32,
-#else
+#else
retval = syscall(__NR__llseek, fd, (unsigned long long) (offset >> 32),
#endif
((unsigned long long) offset) & 0xffffffff,
@@ -100,7 +100,7 @@
errno = EINVAL;
return -1;
}
-
+
result = my_llseek (fd, offset, origin);
if (result == -1 && errno == ENOSYS) {
/*
diff --git a/lib/ext2fs/lookup.c b/lib/ext2fs/lookup.c
index 1745f33..9cb97f1 100644
--- a/lib/ext2fs/lookup.c
+++ b/lib/ext2fs/lookup.c
@@ -1,6 +1,6 @@
/*
* lookup.c --- ext2fs directory lookup operations
- *
+ *
* Copyright (C) 1993, 1994, 1994, 1995 Theodore Ts'o.
*
* %Begin-Header%
@@ -23,7 +23,7 @@
int len;
ext2_ino_t *inode;
int found;
-};
+};
#ifdef __TURBOC__
#pragma argsused
diff --git a/lib/ext2fs/mkdir.c b/lib/ext2fs/mkdir.c
index e769ed5..88bc6fa 100644
--- a/lib/ext2fs/mkdir.c
+++ b/lib/ext2fs/mkdir.c
@@ -1,6 +1,6 @@
/*
* mkdir.c --- make a directory in the filesystem
- *
+ *
* Copyright (C) 1994, 1995 Theodore Ts'o.
*
* %Begin-Header%
@@ -93,7 +93,7 @@
retval = ext2fs_write_dir_block(fs, blk, block);
if (retval)
goto cleanup;
- retval = ext2fs_write_new_inode(fs, ino, &inode);
+ retval = ext2fs_write_new_inode(fs, ino, &inode);
if (retval)
goto cleanup;
@@ -124,7 +124,7 @@
if (retval)
goto cleanup;
}
-
+
/*
* Update accounting....
*/
diff --git a/lib/ext2fs/mkjournal.c b/lib/ext2fs/mkjournal.c
index c112be9..96b574e 100644
--- a/lib/ext2fs/mkjournal.c
+++ b/lib/ext2fs/mkjournal.c
@@ -2,7 +2,7 @@
* mkjournal.c --- make a journal for a filesystem
*
* Copyright (C) 2000 Theodore Ts'o.
- *
+ *
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
@@ -215,7 +215,7 @@
struct mkjournal_struct *es = (struct mkjournal_struct *) priv_data;
blk_t new_blk;
errcode_t retval;
-
+
if (*blocknr) {
es->goal = *blocknr;
return 0;
@@ -265,7 +265,7 @@
return (BLOCK_CHANGED | BLOCK_ABORT);
else
return BLOCK_CHANGED;
-
+
}
/*
@@ -282,7 +282,7 @@
if ((retval = ext2fs_create_journal_superblock(fs, size, flags, &buf)))
return retval;
-
+
if ((retval = ext2fs_read_bitmaps(fs)))
return retval;
@@ -309,7 +309,7 @@
* the filesystem. Pick a group that has the largest number
* of free blocks.
*/
- group = ext2fs_group_of_blk(fs, (fs->super->s_blocks_count -
+ group = ext2fs_group_of_blk(fs, (fs->super->s_blocks_count -
fs->super->s_first_data_block) / 2);
start = (group > 0) ? group-1 : group;
end = ((group+1) < fs->group_desc_count) ? group+1 : group;
@@ -393,7 +393,7 @@
/* Make sure the device exists and is a block device */
if (stat(journal_dev->device_name, &st) < 0)
return errno;
-
+
if (!S_ISBLK(st.st_mode))
return EXT2_ET_JOURNAL_NOT_BLOCK; /* Must be a block device */
@@ -428,7 +428,7 @@
/* Writeback the journal superblock */
if ((retval = io_channel_write_blk(journal_dev->io, start, -1024, buf)))
return retval;
-
+
fs->super->s_journal_inum = 0;
fs->super->s_journal_dev = st.st_rdev;
memcpy(fs->super->s_journal_uuid, jsb->s_uuid,
@@ -460,7 +460,7 @@
strcat(jfile, "/.journal");
/*
- * If .../.journal already exists, make sure any
+ * If .../.journal already exists, make sure any
* immutable or append-only flags are cleared.
*/
#if defined(HAVE_CHFLAGS) && defined(UF_NODUMP)
@@ -482,7 +482,7 @@
if ((retval = write_journal_file(fs, jfile, size, flags)))
goto errout;
-
+
/* Get inode number of the journal file */
if (fstat(fd, &st) < 0)
goto errout;
@@ -497,7 +497,7 @@
#endif
if (retval)
goto errout;
-
+
close(fd);
journal_ino = st.st_ino;
} else {
@@ -511,7 +511,7 @@
size, flags)))
return retval;
}
-
+
fs->super->s_journal_inum = journal_ino;
fs->super->s_journal_dev = 0;
memset(fs->super->s_journal_uuid, 0,
@@ -538,7 +538,7 @@
exit(1);
}
device_name = argv[1];
-
+
retval = ext2fs_open (device_name, EXT2_FLAG_RW, 0, 0,
unix_io_manager, &fs);
if (retval) {
@@ -558,6 +558,6 @@
}
ext2fs_close(fs);
exit(0);
-
+
}
#endif
diff --git a/lib/ext2fs/namei.c b/lib/ext2fs/namei.c
index c380939..2b28a54 100644
--- a/lib/ext2fs/namei.c
+++ b/lib/ext2fs/namei.c
@@ -1,6 +1,6 @@
/*
* namei.c --- ext2fs directory lookup operations
- *
+ *
* Copyright (C) 1993, 1994, 1994, 1995 Theodore Ts'o.
*
* %Begin-Header%
@@ -36,7 +36,7 @@
#ifdef NAMEI_DEBUG
printf("follow_link: root=%lu, dir=%lu, inode=%lu, lc=%d\n",
root, dir, inode, link_count);
-
+
#endif
retval = ext2fs_read_inode (fs, inode, &ei);
if (retval) return retval;
@@ -152,13 +152,13 @@
{
char *buf;
errcode_t retval;
-
+
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
retval = ext2fs_get_mem(fs->blocksize, &buf);
if (retval)
return retval;
-
+
retval = open_namei(fs, root, cwd, name, strlen(name), 0, 0,
buf, inode);
@@ -171,13 +171,13 @@
{
char *buf;
errcode_t retval;
-
+
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
retval = ext2fs_get_mem(fs->blocksize, &buf);
if (retval)
return retval;
-
+
retval = open_namei(fs, root, cwd, name, strlen(name), 1, 0,
buf, inode);
@@ -190,7 +190,7 @@
{
char *buf;
errcode_t retval;
-
+
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
retval = ext2fs_get_mem(fs->blocksize, &buf);
diff --git a/lib/ext2fs/native.c b/lib/ext2fs/native.c
index 85d0989..738c34b 100644
--- a/lib/ext2fs/native.c
+++ b/lib/ext2fs/native.c
@@ -1,8 +1,8 @@
/*
* native.c --- returns the ext2_flag for a native byte order
- *
+ *
* Copyright (C) 1996 Theodore Ts'o.
- *
+ *
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
@@ -23,5 +23,5 @@
#endif
}
-
-
+
+
diff --git a/lib/ext2fs/newdir.c b/lib/ext2fs/newdir.c
index c2ca903..4e7b40d 100644
--- a/lib/ext2fs/newdir.c
+++ b/lib/ext2fs/newdir.c
@@ -1,6 +1,6 @@
/*
* newdir.c --- create a new directory block
- *
+ *
* Copyright (C) 1994, 1995 Theodore Ts'o.
*
* %Begin-Header%
@@ -65,7 +65,7 @@
dir->name_len = 2 | filetype;
dir->name[0] = '.';
dir->name[1] = '.';
-
+
}
*block = buf;
return 0;
diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c
index 525693e..841aa34 100644
--- a/lib/ext2fs/openfs.c
+++ b/lib/ext2fs/openfs.c
@@ -1,8 +1,8 @@
/*
* openfs.c --- open an ext2 filesystem
- *
+ *
* Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
- *
+ *
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
@@ -59,10 +59,10 @@
}
errcode_t ext2fs_open(const char *name, int flags, int superblock,
- unsigned int block_size, io_manager manager,
+ unsigned int block_size, io_manager manager,
ext2_filsys *ret_fs)
{
- return ext2fs_open2(name, 0, flags, superblock, block_size,
+ return ext2fs_open2(name, 0, flags, superblock, block_size,
manager, ret_fs);
}
@@ -71,7 +71,7 @@
* Superblock and block_size can be zero to use the default size.
*
* Valid flags for ext2fs_open()
- *
+ *
* EXT2_FLAG_RW - Open the filesystem for read/write.
* EXT2_FLAG_FORCE - Open the filesystem even if some of the
* features aren't supported.
@@ -79,7 +79,7 @@
*/
errcode_t ext2fs_open2(const char *name, const char *io_options,
int flags, int superblock,
- unsigned int block_size, io_manager manager,
+ unsigned int block_size, io_manager manager,
ext2_filsys *ret_fs)
{
ext2_filsys fs;
@@ -93,13 +93,13 @@
struct ext2_group_desc *gdp;
int j;
#endif
-
+
EXT2_CHECK_MAGIC(manager, EXT2_ET_MAGIC_IO_MANAGER);
retval = ext2fs_get_mem(sizeof(struct struct_ext2_filsys), &fs);
if (retval)
return retval;
-
+
memset(fs, 0, sizeof(struct struct_ext2_filsys));
fs->magic = EXT2_ET_MAGIC_EXT2FS_FILSYS;
fs->flags = flags;
@@ -115,7 +115,7 @@
*cp++ = 0;
io_options = cp;
}
-
+
io_flags = 0;
if (flags & EXT2_FLAG_RW)
io_flags |= IO_FLAG_RW;
@@ -124,7 +124,7 @@
retval = manager->open(fs->device_name, io_flags, &fs->io);
if (retval)
goto cleanup;
- if (io_options &&
+ if (io_options &&
(retval = io_channel_set_options(fs->io, io_options)))
goto cleanup;
fs->image_io = fs->io;
@@ -189,7 +189,7 @@
goto cleanup;
}
#endif
-
+
if (fs->super->s_magic != EXT2_SUPER_MAGIC) {
retval = EXT2_ET_BAD_MAGIC;
goto cleanup;
@@ -231,7 +231,7 @@
goto cleanup;
}
}
-
+
if ((fs->super->s_log_block_size + EXT2_MIN_BLOCK_LOG_SIZE) >
EXT2_MAX_BLOCK_LOG_SIZE) {
retval = EXT2_ET_CORRUPT_SUPERBLOCK;
@@ -268,7 +268,7 @@
*ret_fs = fs;
return 0;
}
-
+
/*
* Read group descriptors
*/
@@ -336,7 +336,7 @@
/*
* Set/get the filesystem data I/O channel.
- *
+ *
* These functions are only valid if EXT2_FLAG_IMAGE_FILE is true.
*/
errcode_t ext2fs_get_data_io(ext2_filsys fs, io_channel *old_io)
@@ -362,7 +362,7 @@
if ((fs->flags & EXT2_FLAG_IMAGE_FILE) == 0)
return EXT2_ET_NOT_IMAGE_FILE;
fs->io = fs->image_io = new_io;
- fs->flags |= EXT2_FLAG_DIRTY | EXT2_FLAG_RW |
+ fs->flags |= EXT2_FLAG_DIRTY | EXT2_FLAG_RW |
EXT2_FLAG_BB_DIRTY | EXT2_FLAG_IB_DIRTY;
fs->flags &= ~EXT2_FLAG_IMAGE_FILE;
return 0;
diff --git a/lib/ext2fs/read_bb.c b/lib/ext2fs/read_bb.c
index 875be9f..112d07f 100644
--- a/lib/ext2fs/read_bb.c
+++ b/lib/ext2fs/read_bb.c
@@ -38,16 +38,16 @@
#pragma argsused
#endif
static int mark_bad_block(ext2_filsys fs, blk_t *block_nr,
- e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)),
+ e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)),
blk_t ref_block EXT2FS_ATTR((unused)),
- int ref_offset EXT2FS_ATTR((unused)),
+ int ref_offset EXT2FS_ATTR((unused)),
void *priv_data)
{
struct read_bb_record *rb = (struct read_bb_record *) priv_data;
-
+
if (blockcnt < 0)
return 0;
-
+
if ((*block_nr < fs->super->s_first_data_block) ||
(*block_nr >= fs->super->s_blocks_count))
return 0; /* Ignore illegal blocks */
diff --git a/lib/ext2fs/read_bb_file.c b/lib/ext2fs/read_bb_file.c
index 2ac71f4..60dec42 100644
--- a/lib/ext2fs/read_bb_file.c
+++ b/lib/ext2fs/read_bb_file.c
@@ -29,7 +29,7 @@
/*
* Reads a list of bad blocks from a FILE *
*/
-errcode_t ext2fs_read_bb_FILE2(ext2_filsys fs, FILE *f,
+errcode_t ext2fs_read_bb_FILE2(ext2_filsys fs, FILE *f,
ext2_badblocks_list *bb_list,
void *priv_data,
void (*invalid)(ext2_filsys fs,
@@ -76,7 +76,7 @@
};
static void call_compat_invalid(ext2_filsys fs, blk_t blk,
- char *badstr EXT2FS_ATTR((unused)),
+ char *badstr EXT2FS_ATTR((unused)),
void *priv_data)
{
struct compat_struct *st;
@@ -90,7 +90,7 @@
/*
* Reads a list of bad blocks from a FILE *
*/
-errcode_t ext2fs_read_bb_FILE(ext2_filsys fs, FILE *f,
+errcode_t ext2fs_read_bb_FILE(ext2_filsys fs, FILE *f,
ext2_badblocks_list *bb_list,
void (*invalid)(ext2_filsys fs, blk_t blk))
{
diff --git a/lib/ext2fs/res_gdt.c b/lib/ext2fs/res_gdt.c
index 848a02a..dda7c2b 100644
--- a/lib/ext2fs/res_gdt.c
+++ b/lib/ext2fs/res_gdt.c
@@ -92,7 +92,7 @@
goto out_inode;
} else {
blk_t goal = sb->s_first_data_block + fs->desc_blocks +
- sb->s_reserved_gdt_blocks + 2 +
+ sb->s_reserved_gdt_blocks + 2 +
fs->inode_blocks_per_group;
retval = ext2fs_alloc_block(fs, goal, 0, &dindir_blk);
diff --git a/lib/ext2fs/rw_bitmaps.c b/lib/ext2fs/rw_bitmaps.c
index d4e94da..341f834 100644
--- a/lib/ext2fs/rw_bitmaps.c
+++ b/lib/ext2fs/rw_bitmaps.c
@@ -58,7 +58,7 @@
memset(block_buf, 0xff, fs->blocksize);
}
if (do_inode) {
- inode_nbytes = (size_t)
+ inode_nbytes = (size_t)
((EXT2_INODES_PER_GROUP(fs->super)+7) / 8);
retval = ext2fs_get_mem(fs->blocksize, &inode_buf);
if (retval)
@@ -71,10 +71,10 @@
goto skip_block_bitmap;
if (csum_flag && fs->group_desc[i].bg_flags &
- EXT2_BG_BLOCK_UNINIT)
+ EXT2_BG_BLOCK_UNINIT)
goto skip_this_block_bitmap;
-
- retval = ext2fs_get_block_bitmap_range(fs->block_map,
+
+ retval = ext2fs_get_block_bitmap_range(fs->block_map,
blk_itr, block_nbytes << 3, block_buf);
if (retval)
return retval;
@@ -103,10 +103,10 @@
continue;
if (csum_flag && fs->group_desc[i].bg_flags &
- EXT2_BG_INODE_UNINIT)
+ EXT2_BG_INODE_UNINIT)
goto skip_this_inode_bitmap;
-
- retval = ext2fs_get_inode_bitmap_range(fs->inode_map,
+
+ retval = ext2fs_get_inode_bitmap_range(fs->inode_map,
ino_itr, inode_nbytes << 3, inode_buf);
if (retval)
return retval;
@@ -169,7 +169,7 @@
retval = ext2fs_allocate_block_bitmap(fs, buf, &fs->block_map);
if (retval)
goto cleanup;
- retval = ext2fs_get_mem(do_image ? fs->blocksize :
+ retval = ext2fs_get_mem(do_image ? fs->blocksize :
(unsigned) block_nbytes, &block_bitmap);
if (retval)
goto cleanup;
@@ -183,7 +183,7 @@
retval = ext2fs_allocate_inode_bitmap(fs, buf, &fs->inode_map);
if (retval)
goto cleanup;
- retval = ext2fs_get_mem(do_image ? fs->blocksize :
+ retval = ext2fs_get_mem(do_image ? fs->blocksize :
(unsigned) inode_nbytes, &inode_bitmap);
if (retval)
goto cleanup;
@@ -202,7 +202,7 @@
cnt = fs->blocksize << 3;
if (cnt > ino_cnt)
cnt = ino_cnt;
- retval = ext2fs_set_inode_bitmap_range(fs->inode_map,
+ retval = ext2fs_set_inode_bitmap_range(fs->inode_map,
ino_itr, cnt, inode_bitmap);
if (retval)
goto cleanup;
@@ -212,7 +212,7 @@
}
blk = (fs->image_header->offset_blockmap /
fs->blocksize);
- blk_cnt = EXT2_BLOCKS_PER_GROUP(fs->super) *
+ blk_cnt = EXT2_BLOCKS_PER_GROUP(fs->super) *
fs->group_desc_count;
while (block_nbytes > 0) {
retval = io_channel_read_blk(fs->image_io, blk++,
@@ -222,7 +222,7 @@
cnt = fs->blocksize << 3;
if (cnt > blk_cnt)
cnt = blk_cnt;
- retval = ext2fs_set_block_bitmap_range(fs->block_map,
+ retval = ext2fs_set_block_bitmap_range(fs->block_map,
blk_itr, cnt, block_bitmap);
if (retval)
goto cleanup;
@@ -250,7 +250,7 @@
} else
memset(block_bitmap, 0xff, block_nbytes);
cnt = block_nbytes << 3;
- retval = ext2fs_set_block_bitmap_range(fs->block_map,
+ retval = ext2fs_set_block_bitmap_range(fs->block_map,
blk_itr, cnt, block_bitmap);
if (retval)
goto cleanup;
@@ -272,7 +272,7 @@
} else
memset(inode_bitmap, 0xff, inode_nbytes);
cnt = inode_nbytes << 3;
- retval = ext2fs_set_inode_bitmap_range(fs->inode_map,
+ retval = ext2fs_set_inode_bitmap_range(fs->inode_map,
ino_itr, cnt, inode_bitmap);
if (retval)
goto cleanup;
@@ -285,7 +285,7 @@
if (block_bitmap)
ext2fs_free_mem(&block_bitmap);
return 0;
-
+
cleanup:
if (do_block) {
ext2fs_free_mem(&fs->block_map);
diff --git a/lib/ext2fs/swapfs.c b/lib/ext2fs/swapfs.c
index 5fe3292..5ccc87f 100644
--- a/lib/ext2fs/swapfs.c
+++ b/lib/ext2fs/swapfs.c
@@ -1,6 +1,6 @@
/*
* swapfs.c --- swap ext2 filesystem data structures
- *
+ *
* Copyright (C) 1995, 1996, 2002 Theodore Ts'o.
*
* %Begin-Header%
@@ -166,11 +166,11 @@
t->i_links_count = ext2fs_swab16(f->i_links_count);
t->i_file_acl = ext2fs_swab32(f->i_file_acl);
if (hostorder)
- has_data_blocks = ext2fs_inode_data_blocks(fs,
+ has_data_blocks = ext2fs_inode_data_blocks(fs,
(struct ext2_inode *) f);
t->i_blocks = ext2fs_swab32(f->i_blocks);
if (!hostorder)
- has_data_blocks = ext2fs_inode_data_blocks(fs,
+ has_data_blocks = ext2fs_inode_data_blocks(fs,
(struct ext2_inode *) t);
if (hostorder && (f->i_flags & EXT4_EXTENTS_FL))
has_extents = 1;
@@ -193,7 +193,7 @@
case EXT2_OS_LINUX:
t->osd1.linux1.l_i_version =
ext2fs_swab32(f->osd1.linux1.l_i_version);
- t->osd2.linux2.l_i_blocks_hi =
+ t->osd2.linux2.l_i_blocks_hi =
ext2fs_swab16(f->osd2.linux2.l_i_blocks_hi);
t->osd2.linux2.l_i_file_acl_high =
ext2fs_swab16(f->osd2.linux2.l_i_file_acl_high);
diff --git a/lib/ext2fs/tdb.c b/lib/ext2fs/tdb.c
index b7cf43d..0c82a24 100644
--- a/lib/ext2fs/tdb.c
+++ b/lib/ext2fs/tdb.c
@@ -3,17 +3,17 @@
Rev: 23590
Last Changed Date: 2007-06-22 13:36:10 -0400 (Fri, 22 Jun 2007)
*/
- /*
+ /*
trivial database library - standalone version
Copyright (C) Andrew Tridgell 1999-2005
Copyright (C) Jeremy Allison 2000-2006
Copyright (C) Paul `Rusty' Russell 2000
-
+
** NOTE! The following LGPL license applies to the tdb
** library. This does NOT imply that all of Samba is released
** under the LGPL
-
+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
@@ -327,11 +327,11 @@
this functions locks/unlocks 1 byte at the specified offset.
On error, errno is also set so that errors are passed back properly
- through tdb_open().
+ through tdb_open().
note that a len of zero means lock to end of file
*/
-int tdb_brlock(struct tdb_context *tdb, tdb_off_t offset,
+int tdb_brlock(struct tdb_context *tdb, tdb_off_t offset,
int rw_type, int lck_type, int probe, size_t len)
{
struct flock fl;
@@ -363,7 +363,7 @@
if (!probe && lck_type != F_SETLK) {
/* Ensure error code is set for log fun to examine. */
tdb->ecode = TDB_ERR_LOCK;
- TDB_LOG((tdb, TDB_DEBUG_TRACE,"tdb_brlock failed (fd=%d) at offset %d rw_type=%d lck_type=%d len=%d\n",
+ TDB_LOG((tdb, TDB_DEBUG_TRACE,"tdb_brlock failed (fd=%d) at offset %d rw_type=%d lck_type=%d len=%d\n",
tdb->fd, offset, rw_type, lck_type, (int)len));
}
return TDB_ERRCODE(TDB_ERR_LOCK, -1);
@@ -376,7 +376,7 @@
upgrade a read lock to a write lock. This needs to be handled in a
special way as some OSes (such as solaris) have too conservative
deadlock detection and claim a deadlock when progress can be
- made. For those OSes we may loop for a while.
+ made. For those OSes we may loop for a while.
*/
int tdb_brlock_upgrade(struct tdb_context *tdb, tdb_off_t offset, size_t len)
{
@@ -409,7 +409,7 @@
ltype &= ~TDB_MARK_LOCK;
/* a global lock allows us to avoid per chain locks */
- if (tdb->global_lock.count &&
+ if (tdb->global_lock.count &&
(ltype == tdb->global_lock.ltype || ltype == F_RDLCK)) {
return 0;
}
@@ -419,7 +419,7 @@
}
if (list < -1 || list >= (int)tdb->header.hash_size) {
- TDB_LOG((tdb, TDB_DEBUG_ERROR,"tdb_lock: invalid list %d for ltype=%d\n",
+ TDB_LOG((tdb, TDB_DEBUG_ERROR,"tdb_lock: invalid list %d for ltype=%d\n",
list, ltype));
return -1;
}
@@ -504,7 +504,7 @@
ltype &= ~TDB_MARK_LOCK;
/* a global lock allows us to avoid per chain locks */
- if (tdb->global_lock.count &&
+ if (tdb->global_lock.count &&
(ltype == tdb->global_lock.ltype || ltype == F_RDLCK)) {
return 0;
}
@@ -574,7 +574,7 @@
}
if (ret)
- TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_unlock: An error occurred unlocking!\n"));
+ TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_unlock: An error occurred unlocking!\n"));
return ret;
}
@@ -586,7 +586,7 @@
if (tdb->have_transaction_lock || tdb->global_lock.count) {
return 0;
}
- if (tdb->methods->tdb_brlock(tdb, TRANSACTION_LOCK, ltype,
+ if (tdb->methods->tdb_brlock(tdb, TRANSACTION_LOCK, ltype,
F_SETLKW, 0, 1) == -1) {
TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_lock: failed to get transaction lock\n"));
tdb->ecode = TDB_ERR_LOCK;
@@ -635,7 +635,7 @@
/* a global lock of a different type exists */
return TDB_ERRCODE(TDB_ERR_LOCK, -1);
}
-
+
if (tdb->num_locks != 0) {
/* can't combine global and chain locks */
return TDB_ERRCODE(TDB_ERR_LOCK, -1);
@@ -680,7 +680,7 @@
}
if (!mark_lock &&
- tdb->methods->tdb_brlock(tdb, FREELIST_TOP, F_UNLCK, F_SETLKW,
+ tdb->methods->tdb_brlock(tdb, FREELIST_TOP, F_UNLCK, F_SETLKW,
0, 4*tdb->header.hash_size)) {
TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_unlockall failed (%s)\n", strerror(errno)));
return -1;
@@ -831,7 +831,7 @@
/* check for an out of bounds access - if it is out of bounds then
see if the database has been expanded by someone else and expand
- if necessary
+ if necessary
note that "len" is the minimum length needed for the db
*/
static int tdb_oob(struct tdb_context *tdb, tdb_off_t len, int probe)
@@ -872,7 +872,7 @@
}
/* write a lump of data at a specified offset */
-static int tdb_write(struct tdb_context *tdb, tdb_off_t off,
+static int tdb_write(struct tdb_context *tdb, tdb_off_t off,
const void *buf, tdb_len_t len)
{
if (len == 0) {
@@ -910,7 +910,7 @@
/* read a lump of data at a specified offset, maybe convert */
-static int tdb_read(struct tdb_context *tdb, tdb_off_t off, void *buf,
+static int tdb_read(struct tdb_context *tdb, tdb_off_t off, void *buf,
tdb_len_t len, int cv)
{
if (tdb->methods->tdb_oob(tdb, off + len, 0) != 0) {
@@ -942,7 +942,7 @@
/*
do an unlocked scan of the hash table heads to find the next non-zero head. The value
will then be confirmed with the lock held
-*/
+*/
static void tdb_next_hash_chain(struct tdb_context *tdb, u32 *chain)
{
u32 h = *chain;
@@ -987,8 +987,8 @@
#ifdef HAVE_MMAP
if (!(tdb->flags & TDB_NOMMAP)) {
- tdb->map_ptr = mmap(NULL, tdb->map_size,
- PROT_READ|(tdb->read_only? 0:PROT_WRITE),
+ tdb->map_ptr = mmap(NULL, tdb->map_size,
+ PROT_READ|(tdb->read_only? 0:PROT_WRITE),
MAP_SHARED|MAP_FILE, tdb->fd, 0);
/*
@@ -997,7 +997,7 @@
if (tdb->map_ptr == MAP_FAILED) {
tdb->map_ptr = NULL;
- TDB_LOG((tdb, TDB_DEBUG_WARNING, "tdb_mmap failed for size %d (%s)\n",
+ TDB_LOG((tdb, TDB_DEBUG_WARNING, "tdb_mmap failed for size %d (%s)\n",
tdb->map_size, strerror(errno)));
}
} else {
@@ -1022,7 +1022,7 @@
if (ftruncate(tdb->fd, size+addition) == -1) {
char b = 0;
if (pwrite(tdb->fd, &b, 1, (size+addition) - 1) != 1) {
- TDB_LOG((tdb, TDB_DEBUG_FATAL, "expand_file to %d failed (%s)\n",
+ TDB_LOG((tdb, TDB_DEBUG_FATAL, "expand_file to %d failed (%s)\n",
size+addition, strerror(errno)));
return -1;
}
@@ -1036,7 +1036,7 @@
int n = addition>sizeof(buf)?sizeof(buf):addition;
int ret = pwrite(tdb->fd, buf, n, size);
if (ret != n) {
- TDB_LOG((tdb, TDB_DEBUG_FATAL, "expand_file write of %d failed (%s)\n",
+ TDB_LOG((tdb, TDB_DEBUG_FATAL, "expand_file write of %d failed (%s)\n",
n, strerror(errno)));
return -1;
}
@@ -1262,7 +1262,7 @@
- allow for nested calls to tdb_transaction_start(), re-using the
existing transaction record. If the inner transaction is cancelled
then a subsequent commit will fail
-
+
- keep a mirrored copy of the tdb hash chain heads to allow for the
fast hash heads scan on traverse, updating the mirrored copy in
the transaction version of tdb_write
@@ -1334,7 +1334,7 @@
read while in a transaction. We need to check first if the data is in our list
of transaction elements, then if not do a real read
*/
-static int transaction_read(struct tdb_context *tdb, tdb_off_t off, void *buf,
+static int transaction_read(struct tdb_context *tdb, tdb_off_t off, void *buf,
tdb_len_t len, int cv)
{
struct tdb_transaction_el *el;
@@ -1373,7 +1373,7 @@
len -= partial;
off += partial;
buf = (void *)(partial + (char *)buf);
-
+
if (len != 0 && transaction_read(tdb, off, buf, len, cv) != 0) {
goto fail;
}
@@ -1395,7 +1395,7 @@
/*
write while in a transaction
*/
-static int transaction_write(struct tdb_context *tdb, tdb_off_t off,
+static int transaction_write(struct tdb_context *tdb, tdb_off_t off,
const void *buf, tdb_len_t len)
{
struct tdb_transaction_el *el, *best_el=NULL;
@@ -1403,7 +1403,7 @@
if (len == 0) {
return 0;
}
-
+
/* if the write is to a hash head, then update the transaction
hash heads */
if (len == sizeof(tdb_off_t) && off >= FREELIST_TOP &&
@@ -1447,7 +1447,7 @@
len -= partial;
off += partial;
buf = (const void *)(partial + (const char *)buf);
-
+
if (len != 0 && transaction_write(tdb, off, buf, len) != 0) {
goto fail;
}
@@ -1456,7 +1456,7 @@
}
/* see if we can append the new entry to an existing entry */
- if (best_el && best_el->offset + best_el->length == off &&
+ if (best_el && best_el->offset + best_el->length == off &&
(off+len < tdb->transaction->old_map_size ||
off > tdb->transaction->old_map_size)) {
unsigned char *data = best_el->data;
@@ -1482,7 +1482,7 @@
el = (struct tdb_transaction_el *)malloc(sizeof(*el));
if (el == NULL) {
tdb->ecode = TDB_ERR_OOM;
- tdb->transaction->transaction_error = 1;
+ tdb->transaction->transaction_error = 1;
return -1;
}
el->next = NULL;
@@ -1493,7 +1493,7 @@
if (el->data == NULL) {
free(el);
tdb->ecode = TDB_ERR_OOM;
- tdb->transaction->transaction_error = 1;
+ tdb->transaction->transaction_error = 1;
return -1;
}
if (buf) {
@@ -1545,7 +1545,7 @@
/*
transaction version of tdb_expand().
*/
-static int transaction_expand_file(struct tdb_context *tdb, tdb_off_t size,
+static int transaction_expand_file(struct tdb_context *tdb, tdb_off_t size,
tdb_off_t addition)
{
/* add a write to the transaction elements, so subsequent
@@ -1560,7 +1560,7 @@
/*
brlock during a transaction - ignore them
*/
-static int transaction_brlock(struct tdb_context *tdb, tdb_off_t offset,
+static int transaction_brlock(struct tdb_context *tdb, tdb_off_t offset,
int rw_type, int lck_type, int probe, size_t len)
{
return 0;
@@ -1592,7 +1592,7 @@
/* cope with nested tdb_transaction_start() calls */
if (tdb->transaction != NULL) {
tdb->transaction->nesting++;
- TDB_LOG((tdb, TDB_DEBUG_TRACE, "tdb_transaction_start: nesting %d\n",
+ TDB_LOG((tdb, TDB_DEBUG_TRACE, "tdb_transaction_start: nesting %d\n",
tdb->transaction->nesting));
return 0;
}
@@ -1629,7 +1629,7 @@
SAFE_FREE(tdb->transaction);
return -1;
}
-
+
/* get a read lock from the freelist to the end of file. This
is upgraded to a write lock during the commit */
if (tdb_brlock(tdb, FREELIST_TOP, F_RDLCK, F_SETLKW, 0, 0) == -1) {
@@ -1665,7 +1665,7 @@
/* by calling this transaction write here, we ensure that we don't grow the
transaction linked list due to hash table updates */
- if (transaction_write(tdb, FREELIST_TOP, tdb->transaction->hash_heads,
+ if (transaction_write(tdb, FREELIST_TOP, tdb->transaction->hash_heads,
TDB_HASHTABLE_SIZE(tdb)) != 0) {
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_start: failed to prime hash table\n"));
tdb->ecode = TDB_ERR_IO;
@@ -1674,7 +1674,7 @@
}
return 0;
-
+
fail:
tdb_brlock(tdb, FREELIST_TOP, F_UNLCK, F_SETLKW, 0, 0);
tdb_transaction_unlock(tdb);
@@ -1688,7 +1688,7 @@
cancel the current transaction
*/
int tdb_transaction_cancel(struct tdb_context *tdb)
-{
+{
if (tdb->transaction == NULL) {
TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_cancel: no transaction\n"));
return -1;
@@ -1698,7 +1698,7 @@
tdb->transaction->transaction_error = 1;
tdb->transaction->nesting--;
return 0;
- }
+ }
tdb->map_size = tdb->transaction->old_map_size;
@@ -1735,7 +1735,7 @@
tdb_transaction_unlock(tdb);
SAFE_FREE(tdb->transaction->hash_heads);
SAFE_FREE(tdb->transaction);
-
+
return 0;
}
@@ -1743,7 +1743,7 @@
sync to disk
*/
static int transaction_sync(struct tdb_context *tdb, tdb_off_t offset, tdb_len_t length)
-{
+{
if (fsync(tdb->fd) != 0) {
tdb->ecode = TDB_ERR_IO;
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction: fsync failed\n"));
@@ -1752,7 +1752,7 @@
#ifdef MS_SYNC
if (tdb->map_ptr) {
tdb_off_t moffset = offset & ~(tdb->page_size-1);
- if (msync(moffset + (char *)tdb->map_ptr,
+ if (msync(moffset + (char *)tdb->map_ptr,
length + (offset - moffset), MS_SYNC) != 0) {
tdb->ecode = TDB_ERR_IO;
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction: msync failed - %s\n",
@@ -1788,7 +1788,7 @@
allocate the recovery area, or use an existing recovery area if it is
large enough
*/
-static int tdb_recovery_allocate(struct tdb_context *tdb,
+static int tdb_recovery_allocate(struct tdb_context *tdb,
tdb_len_t *recovery_size,
tdb_off_t *recovery_offset,
tdb_len_t *recovery_max_size)
@@ -1804,7 +1804,7 @@
rec.rec_len = 0;
- if (recovery_head != 0 &&
+ if (recovery_head != 0 &&
methods->tdb_read(tdb, recovery_head, &rec, sizeof(rec), DOCONV()) == -1) {
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_recovery_allocate: failed to read recovery record\n"));
return -1;
@@ -1839,7 +1839,7 @@
*recovery_offset = tdb->map_size;
recovery_head = *recovery_offset;
- if (methods->tdb_expand_file(tdb, tdb->transaction->old_map_size,
+ if (methods->tdb_expand_file(tdb, tdb->transaction->old_map_size,
(tdb->map_size - tdb->transaction->old_map_size) +
sizeof(rec) + *recovery_max_size) == -1) {
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_recovery_allocate: failed to create recovery area\n"));
@@ -1856,7 +1856,7 @@
/* write the recovery header offset and sync - we can sync without a race here
as the magic ptr in the recovery record has not been set */
CONVERT(recovery_head);
- if (methods->tdb_write(tdb, TDB_RECOVERY_HEAD,
+ if (methods->tdb_write(tdb, TDB_RECOVERY_HEAD,
&recovery_head, sizeof(tdb_off_t)) == -1) {
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_recovery_allocate: failed to write recovery head\n"));
return -1;
@@ -1869,7 +1869,7 @@
/*
setup the recovery data that will be used on a crash during commit
*/
-static int transaction_setup_recovery(struct tdb_context *tdb,
+static int transaction_setup_recovery(struct tdb_context *tdb,
tdb_off_t *magic_offset)
{
struct tdb_transaction_el *el;
@@ -1884,7 +1884,7 @@
/*
check that the recovery area has enough space
*/
- if (tdb_recovery_allocate(tdb, &recovery_size,
+ if (tdb_recovery_allocate(tdb, &recovery_size,
&recovery_offset, &recovery_max_size) == -1) {
return -1;
}
@@ -1979,7 +1979,7 @@
commit the current transaction
*/
int tdb_transaction_commit(struct tdb_context *tdb)
-{
+{
const struct tdb_methods *methods;
tdb_off_t magic_offset = 0;
u32 zero = 0;
@@ -1999,7 +1999,7 @@
if (tdb->transaction->nesting != 0) {
tdb->transaction->nesting--;
return 0;
- }
+ }
/* check for a null transaction */
if (tdb->transaction->elements == NULL) {
@@ -2008,7 +2008,7 @@
}
methods = tdb->transaction->io_methods;
-
+
/* if there are any locks pending then the caller has not
nested their locks properly, so fail the transaction */
if (tdb->num_locks || tdb->global_lock.count) {
@@ -2047,8 +2047,8 @@
/* expand the file to the new size if needed */
if (tdb->map_size != tdb->transaction->old_map_size) {
- if (methods->tdb_expand_file(tdb, tdb->transaction->old_map_size,
- tdb->map_size -
+ if (methods->tdb_expand_file(tdb, tdb->transaction->old_map_size,
+ tdb->map_size -
tdb->transaction->old_map_size) == -1) {
tdb->ecode = TDB_ERR_IO;
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_commit: expansion failed\n"));
@@ -2066,12 +2066,12 @@
if (methods->tdb_write(tdb, el->offset, el->data, el->length) == -1) {
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_commit: write failed during commit\n"));
-
+
/* we've overwritten part of the data and
possibly expanded the file, so we need to
run the crash recovery code */
tdb->methods = methods;
- tdb_transaction_recover(tdb);
+ tdb_transaction_recover(tdb);
tdb_transaction_cancel(tdb);
tdb_brlock(tdb, GLOBAL_LOCK, F_UNLCK, F_SETLKW, 0, 1);
@@ -2080,9 +2080,9 @@
return -1;
}
tdb->transaction->elements = el->next;
- free(el->data);
+ free(el->data);
free(el);
- }
+ }
if (!(tdb->flags & TDB_NOSYNC)) {
/* ensure the new data is on disk */
@@ -2151,9 +2151,9 @@
}
/* read the recovery record */
- if (tdb->methods->tdb_read(tdb, recovery_head, &rec,
+ if (tdb->methods->tdb_read(tdb, recovery_head, &rec,
sizeof(rec), DOCONV()) == -1) {
- TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_recover: failed to read recovery record\n"));
+ TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_recover: failed to read recovery record\n"));
tdb->ecode = TDB_ERR_IO;
return -1;
}
@@ -2173,7 +2173,7 @@
data = (unsigned char *)malloc(rec.data_len);
if (data == NULL) {
- TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_recover: failed to allocate recovery data\n"));
+ TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_recover: failed to allocate recovery data\n"));
tdb->ecode = TDB_ERR_OOM;
return -1;
}
@@ -2181,7 +2181,7 @@
/* read the full recovery data */
if (tdb->methods->tdb_read(tdb, recovery_head + sizeof(rec), data,
rec.data_len, 0) == -1) {
- TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_recover: failed to read recovery data\n"));
+ TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_recover: failed to read recovery data\n"));
tdb->ecode = TDB_ERR_IO;
return -1;
}
@@ -2218,24 +2218,24 @@
if (tdb_ofs_write(tdb, TDB_RECOVERY_HEAD, &zero) == -1) {
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_recover: failed to remove recovery head\n"));
tdb->ecode = TDB_ERR_IO;
- return -1;
+ return -1;
}
}
/* remove the recovery magic */
- if (tdb_ofs_write(tdb, recovery_head + offsetof(struct list_struct, magic),
+ if (tdb_ofs_write(tdb, recovery_head + offsetof(struct list_struct, magic),
&zero) == -1) {
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_recover: failed to remove recovery magic\n"));
tdb->ecode = TDB_ERR_IO;
- return -1;
+ return -1;
}
-
+
/* reduce the file size to the old size */
tdb_munmap(tdb);
if (ftruncate(tdb->fd, recovery_eof) != 0) {
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_recover: failed to reduce to recovery size\n"));
tdb->ecode = TDB_ERR_IO;
- return -1;
+ return -1;
}
tdb->map_size = recovery_eof;
tdb_mmap(tdb);
@@ -2246,7 +2246,7 @@
return -1;
}
- TDB_LOG((tdb, TDB_DEBUG_TRACE, "tdb_transaction_recover: recovered %d byte database\n",
+ TDB_LOG((tdb, TDB_DEBUG_TRACE, "tdb_transaction_recover: recovered %d byte database\n",
recovery_eof));
/* all done */
@@ -2264,7 +2264,7 @@
if (rec->magic == TDB_MAGIC) {
/* this happens when a app is showdown while deleting a record - we should
not completely fail when this happens */
- TDB_LOG((tdb, TDB_DEBUG_WARNING, "tdb_rec_free_read non-free magic 0x%x at offset=%d - fixing\n",
+ TDB_LOG((tdb, TDB_DEBUG_WARNING, "tdb_rec_free_read non-free magic 0x%x at offset=%d - fixing\n",
rec->magic, off));
rec->magic = TDB_FREE_MAGIC;
if (tdb->methods->tdb_write(tdb, off, rec, sizeof(*rec)) == -1)
@@ -2274,7 +2274,7 @@
if (rec->magic != TDB_FREE_MAGIC) {
/* Ensure ecode is set for log fn. */
tdb->ecode = TDB_ERR_CORRUPT;
- TDB_LOG((tdb, TDB_DEBUG_WARNING, "tdb_rec_free_read bad magic 0x%x at offset=%d\n",
+ TDB_LOG((tdb, TDB_DEBUG_WARNING, "tdb_rec_free_read bad magic 0x%x at offset=%d\n",
rec->magic, off));
return TDB_ERRCODE(TDB_ERR_CORRUPT, -1);
}
@@ -2359,7 +2359,7 @@
if (left > TDB_DATA_START(tdb->header.hash_size)) {
struct list_struct l;
tdb_off_t leftsize;
-
+
/* Read in tailer and jump back to header */
if (tdb_ofs_read(tdb, left, &leftsize) == -1) {
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_free: left offset read failed at %u\n", left));
@@ -2417,7 +2417,7 @@
}
-/*
+/*
the core of tdb_allocate - called when we have decided which
free list entry to use
*/
@@ -2433,22 +2433,22 @@
if (rec->rec_len > length + MIN_REC_SIZE) {
/* Length of left piece */
length = TDB_ALIGN(length, TDB_ALIGNMENT);
-
+
/* Right piece to go on free list */
newrec.rec_len = rec->rec_len - (sizeof(*rec) + length);
newrec_ptr = rec_ptr + sizeof(*rec) + length;
-
+
/* And left record is shortened */
rec->rec_len = length;
} else {
newrec_ptr = 0;
}
-
+
/* Remove allocated record from the free list */
if (tdb_ofs_write(tdb, last_ptr, &rec->next) == -1) {
return 0;
}
-
+
/* Update header: do this before we drop alloc
lock, otherwise tdb_free() might try to
merge with us, thinking we're free.
@@ -2457,7 +2457,7 @@
if (tdb_rec_write(tdb, rec_ptr, rec) == -1) {
return 0;
}
-
+
/* Did we create new block? */
if (newrec_ptr) {
/* Update allocated record tailer (we
@@ -2465,13 +2465,13 @@
if (update_tailer(tdb, rec_ptr, rec) == -1) {
return 0;
}
-
+
/* Free new record */
if (tdb_free(tdb, newrec_ptr, &newrec) == -1) {
return 0;
}
}
-
+
/* all done - return the new record offset */
return rec_ptr;
}
@@ -2507,7 +2507,7 @@
bestfit.last_ptr = 0;
bestfit.rec_len = 0;
- /*
+ /*
this is a best fit allocation strategy. Originally we used
a first fit strategy, but it suffered from massive fragmentation
issues when faced with a slowly increasing record size.
@@ -2655,7 +2655,7 @@
common for the use of tdb with ldb, where large
hashes are used. In that case we spend most of our
time in tdb_brlock(), locking empty hash chains.
-
+
To avoid this, we do an unlocked pre-check to see
if the hash chain is empty before starting to look
inside it. If it is empty then we can avoid that
@@ -2663,7 +2663,7 @@
the value we get back, as we read it without a
lock, so instead we get the lock and re-fetch the
value below.
-
+
Notice that not doing this optimisation on the
first hash chain is critical. We must guarantee
that we have done at least one fcntl lock at the
@@ -2673,7 +2673,7 @@
could possibly miss those with this trick, but we
could miss them anyway without this trick, so the
semantics don't change.
-
+
With a non-indexed ldb search this trick gains us a
factor of around 80 in speed on a linux 2.6.x
system (testing using ldbtest).
@@ -2727,7 +2727,7 @@
/* Try to clean dead ones from old traverses */
current = tlock->off;
tlock->off = rec->next;
- if (!(tdb->read_only || tdb->traverse_read) &&
+ if (!(tdb->read_only || tdb->traverse_read) &&
tdb_do_delete(tdb, current, rec) != 0)
goto fail;
}
@@ -2749,7 +2749,7 @@
if fn is NULL then it is not called
a non-zero return value from fn() indicates that the traversal should stop
*/
-static int tdb_traverse_internal(struct tdb_context *tdb,
+static int tdb_traverse_internal(struct tdb_context *tdb,
tdb_traverse_func fn, void *private_data,
struct tdb_traverse_lock *tl)
{
@@ -2769,7 +2769,7 @@
while ((ret = tdb_next_lock(tdb, tl, &rec)) > 0) {
count++;
/* now read the full record */
- key.dptr = tdb_alloc_read(tdb, tl->off + sizeof(rec),
+ key.dptr = tdb_alloc_read(tdb, tl->off + sizeof(rec),
rec.key_len + rec.data_len);
if (!key.dptr) {
ret = -1;
@@ -2813,7 +2813,7 @@
/*
a write style traverse - temporarily marks the db read only
*/
-int tdb_traverse_read(struct tdb_context *tdb,
+int tdb_traverse_read(struct tdb_context *tdb,
tdb_traverse_func fn, void *private_data)
{
struct tdb_traverse_lock tl = { NULL, 0, 0, F_RDLCK };
@@ -2838,7 +2838,7 @@
a write style traverse - needs to get the transaction lock to
prevent deadlocks
*/
-int tdb_traverse(struct tdb_context *tdb,
+int tdb_traverse(struct tdb_context *tdb,
tdb_traverse_func fn, void *private_data)
{
struct tdb_traverse_lock tl = { NULL, 0, 0, F_WRLCK };
@@ -2847,7 +2847,7 @@
if (tdb->read_only || tdb->traverse_read) {
return tdb_traverse_read(tdb, fn, private_data);
}
-
+
if (tdb_transaction_lock(tdb, F_WRLCK)) {
return -1;
}
@@ -2953,7 +2953,7 @@
struct list_struct rec;
tdb_off_t tailer_ofs, tailer;
- if (tdb->methods->tdb_read(tdb, offset, (char *)&rec,
+ if (tdb->methods->tdb_read(tdb, offset, (char *)&rec,
sizeof(rec), DOCONV()) == -1) {
printf("ERROR: failed to read record at %u\n", offset);
return 0;
@@ -3030,7 +3030,7 @@
printf("freelist top=[0x%08x]\n", rec_ptr );
while (rec_ptr) {
- if (tdb->methods->tdb_read(tdb, rec_ptr, (char *)&rec,
+ if (tdb->methods->tdb_read(tdb, rec_ptr, (char *)&rec,
sizeof(rec), DOCONV()) == -1) {
tdb_unlock(tdb, -1, F_WRLCK);
return -1;
@@ -3042,14 +3042,14 @@
return -1;
}
- printf("entry offset=[0x%08x], rec.rec_len = [0x%08x (%d)] (end = 0x%08x)\n",
+ printf("entry offset=[0x%08x], rec.rec_len = [0x%08x (%d)] (end = 0x%08x)\n",
rec_ptr, rec.rec_len, rec.rec_len, rec_ptr + rec.rec_len);
total_free += rec.rec_len;
/* move to the next record */
rec_ptr = rec.next;
}
- printf("total rec_len = [0x%08x (%d)]\n", (int)total_free,
+ printf("total rec_len = [0x%08x (%d)]\n", (int)total_free,
(int)total_free);
return tdb_unlock(tdb, -1, F_WRLCK);
@@ -3066,7 +3066,7 @@
void tdb_increment_seqnum_nonblock(struct tdb_context *tdb)
{
tdb_off_t seqnum=0;
-
+
if (!(tdb->flags & TDB_SEQNUM)) {
return;
}
@@ -3109,7 +3109,7 @@
struct list_struct *r)
{
tdb_off_t rec_ptr;
-
+
/* read in the hash top */
if (tdb_ofs_read(tdb, TDB_HASH_TOP(hash), &rec_ptr) == -1)
return 0;
@@ -3173,7 +3173,7 @@
rec.data_len = dbuf.dsize;
return tdb_rec_write(tdb, rec_ptr, &rec);
}
-
+
return 0;
}
@@ -3243,7 +3243,7 @@
return ret;
}
-/* check if an entry in the database exists
+/* check if an entry in the database exists
note that 1 is returned if the key is found and 0 is returned if not found
this doesn't match the conventions in the rest of this module, but is
@@ -3252,7 +3252,7 @@
static int tdb_exists_hash(struct tdb_context *tdb, TDB_DATA key, u32 hash)
{
struct list_struct rec;
-
+
if (tdb_find_lock_hash(tdb, key, hash, F_RDLCK, &rec) == 0)
return 0;
tdb_unlock(tdb, BUCKET(rec.full_hash), F_RDLCK);
@@ -3305,7 +3305,7 @@
int res = 0;
tdb_off_t rec_ptr;
struct list_struct rec;
-
+
/* read in the hash top */
if (tdb_ofs_read(tdb, TDB_HASH_TOP(hash), &rec_ptr) == -1)
return 0;
@@ -3334,7 +3334,7 @@
if (tdb_lock(tdb, -1, F_WRLCK) == -1) {
return -1;
}
-
+
/* read in the hash top */
if (tdb_ofs_read(tdb, TDB_HASH_TOP(hash), &rec_ptr) == -1)
goto fail;
@@ -3426,7 +3426,7 @@
struct list_struct *r, tdb_len_t length)
{
tdb_off_t rec_ptr;
-
+
/* read in the hash top */
if (tdb_ofs_read(tdb, TDB_HASH_TOP(hash), &rec_ptr) == -1)
return 0;
@@ -3449,7 +3449,7 @@
}
/* store an element in the database, replacing any existing element
- with the same key
+ with the same key
return 0 on success, -1 on failure
*/
@@ -3585,7 +3585,7 @@
tdb_increment_seqnum(tdb);
}
- SAFE_FREE(p);
+ SAFE_FREE(p);
tdb_unlock(tdb, BUCKET(hash), F_WRLCK);
return ret;
}
@@ -3625,7 +3625,7 @@
dbuf.dsize += new_dbuf.dsize;
ret = tdb_store(tdb, key, dbuf, 0);
-
+
failed:
tdb_unlock(tdb, BUCKET(hash), F_WRLCK);
SAFE_FREE(dbuf.dptr);
@@ -3720,7 +3720,7 @@
for (value = 0x238F13AF * key->dsize, i=0; i < key->dsize; i++)
value = (value + (key->dptr[i] << (i*5 % 24)));
- return (1103515243 * value + 12345);
+ return (1103515243 * value + 12345);
}
@@ -3774,7 +3774,7 @@
ino_t ino)
{
struct tdb_context *i;
-
+
for (i = tdbs; i; i = i->next) {
if (i->device == device && i->inode == ino) {
return 1;
@@ -3784,13 +3784,13 @@
return 0;
}
-/* open the database, creating it if necessary
+/* open the database, creating it if necessary
The open_flags and mode are passed straight to the open call on the
database file. A flags value of O_WRONLY is invalid. The hash size
is advisory, use zero for a default value.
- Return is NULL on error, in which case errno is also set. Don't
+ Return is NULL on error, in which case errno is also set. Don't
try to call tdb_error or tdb_errname, just do strerror(errno).
@param name may be NULL for internal databases. */
@@ -3849,7 +3849,7 @@
errno = EINVAL;
goto fail;
}
-
+
if (hash_size == 0)
hash_size = DEFAULT_HASH_SIZE;
if ((open_flags & O_ACCMODE) == O_RDONLY) {
@@ -3983,7 +3983,7 @@
if (!tdb)
return NULL;
-
+
if (tdb->map_ptr) {
if (tdb->flags & TDB_INTERNAL)
SAFE_FREE(tdb->map_ptr);
@@ -4091,7 +4091,7 @@
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_reopen: open failed (%s)\n", strerror(errno)));
goto fail;
}
- if ((tdb->flags & TDB_CLEAR_IF_FIRST) &&
+ if ((tdb->flags & TDB_CLEAR_IF_FIRST) &&
(tdb->methods->tdb_brlock(tdb, ACTIVE_LOCK, F_RDLCK, F_SETLKW, 0, 1) == -1)) {
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_reopen: failed to obtain active lock\n"));
goto fail;
diff --git a/lib/ext2fs/tdb.h b/lib/ext2fs/tdb.h
index 447d6a1..bfcd943 100644
--- a/lib/ext2fs/tdb.h
+++ b/lib/ext2fs/tdb.h
@@ -1,17 +1,17 @@
#ifndef __TDB_H__
#define __TDB_H__
-/*
+/*
Unix SMB/CIFS implementation.
trivial database library
Copyright (C) Andrew Tridgell 1999-2004
-
+
** NOTE! The following LGPL license applies to the tdb
** library. This does NOT imply that all of Samba is released
** under the LGPL
-
+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
@@ -51,12 +51,12 @@
#define TDB_ERRCODE(code, ret) ((tdb->ecode = (code)), ret)
/* error codes */
-enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK,
+enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK,
TDB_ERR_OOM, TDB_ERR_EXISTS, TDB_ERR_NOLOCK, TDB_ERR_LOCK_TIMEOUT,
TDB_ERR_NOEXIST, TDB_ERR_EINVAL, TDB_ERR_RDONLY};
/* debugging uses one of the following levels */
-enum tdb_debug_level {TDB_DEBUG_FATAL = 0, TDB_DEBUG_ERROR,
+enum tdb_debug_level {TDB_DEBUG_FATAL = 0, TDB_DEBUG_ERROR,
TDB_DEBUG_WARNING, TDB_DEBUG_TRACE};
typedef struct TDB_DATA {
diff --git a/lib/ext2fs/tdbtool.c b/lib/ext2fs/tdbtool.c
index 0366cda..130fc58 100644
--- a/lib/ext2fs/tdbtool.c
+++ b/lib/ext2fs/tdbtool.c
@@ -1,4 +1,4 @@
-/*
+/*
Unix SMB/CIFS implementation.
Samba database functions
Copyright (C) Andrew Tridgell 1999-2000
@@ -10,12 +10,12 @@
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -130,7 +130,7 @@
printf("%02X ",(int)buf[i]);
i++;
if (i%8 == 0) printf(" ");
- if (i%16 == 0) {
+ if (i%16 == 0) {
print_asc(&buf[i-16],8); printf(" ");
print_asc(&buf[i-8],8); printf("\n");
if (i<len) printf("[%03X] ",i);
@@ -138,18 +138,18 @@
}
if (i%16) {
int n;
-
+
n = 16 - (i%16);
printf(" ");
if (n>8) printf(" ");
while (n--) printf(" ");
-
+
n = i%16;
if (n > 8) n = 8;
print_asc(&buf[i-(i%16)],n); printf(" ");
n = (i%16) - n;
- if (n>0) print_asc(&buf[i-n],n);
- printf("\n");
+ if (n>0) print_asc(&buf[i-n],n);
+ printf("\n");
}
}
@@ -171,7 +171,7 @@
" delete key : delete a record by key\n"
" list : print the database hash table and freelist\n"
" free : print the database freelist\n"
-" ! command : execute system command\n"
+" ! command : execute system command\n"
" 1 | first : print the first record\n"
" n | next : print the next record\n"
" q | quit : terminate\n"
@@ -266,11 +266,11 @@
terror("fetch failed");
return;
}
-
+
print_rec(tdb, key, dbuf, NULL);
-
+
free( dbuf.dptr );
-
+
return;
}
@@ -314,23 +314,23 @@
terror("fetch failed");
return;
}
-
+
print_rec(tdb, key, dbuf, NULL);
-
+
dst_tdb = tdb_open(tdbname, 0, 0, O_RDWR, 0600);
if ( !dst_tdb ) {
terror("unable to open destination tdb");
return;
}
-
+
if ( tdb_store( dst_tdb, key, dbuf, TDB_REPLACE ) == -1 ) {
terror("failed to move record");
}
else
printf("record moved\n");
-
+
tdb_close( dst_tdb );
-
+
return;
}
@@ -399,7 +399,7 @@
{
TDB_DATA dbuf;
*pkey = tdb_firstkey(the_tdb);
-
+
dbuf = tdb_fetch(the_tdb, *pkey);
if (!dbuf.dptr) terror("fetch failed");
else {
@@ -411,9 +411,9 @@
{
TDB_DATA dbuf;
*pkey = tdb_nextkey(the_tdb, *pkey);
-
+
dbuf = tdb_fetch(the_tdb, *pkey);
- if (!dbuf.dptr)
+ if (!dbuf.dptr)
terror("fetch failed");
else
print_rec(the_tdb, *pkey, dbuf, NULL);
@@ -536,7 +536,7 @@
size_t length = 0;
char *outp, *inp;
char temp[3];
-
+
outp = inp = instring;
diff --git a/lib/ext2fs/test_io.c b/lib/ext2fs/test_io.c
index c2f5449..39b39bf 100644
--- a/lib/ext2fs/test_io.c
+++ b/lib/ext2fs/test_io.c
@@ -40,7 +40,7 @@
#define EXT2_CHECK_MAGIC(struct, code) \
if ((struct)->magic != (code)) return (code)
-
+
struct test_private_data {
int magic;
io_channel real;
@@ -70,7 +70,7 @@
static errcode_t test_flush(io_channel channel);
static errcode_t test_write_byte(io_channel channel, unsigned long offset,
int count, const void *buf);
-static errcode_t test_set_option(io_channel channel, const char *option,
+static errcode_t test_set_option(io_channel channel, const char *option,
const char *arg);
static errcode_t test_get_stats(io_channel channel, io_stats *stats);
@@ -232,7 +232,7 @@
data->flags = 0;
if ((value = safe_getenv("TEST_IO_FLAGS")) != NULL)
data->flags = strtoul(value, NULL, 0);
-
+
data->block = 0;
if ((value = safe_getenv("TEST_IO_BLOCK")) != NULL)
data->block = strtoul(value, NULL, 0);
@@ -244,7 +244,7 @@
data->write_abort_count = 0;
if ((value = safe_getenv("TEST_IO_WRITE_ABORT")) != NULL)
data->write_abort_count = strtoul(value, NULL, 0);
-
+
*channel = io;
return 0;
@@ -267,13 +267,13 @@
if (--channel->refcount > 0)
return 0;
-
+
if (data->real)
retval = io_channel_close(data->real);
if (data->outfile && data->outfile != stderr)
fclose(data->outfile);
-
+
ext2fs_free_mem(&channel->private_data);
if (channel->name)
ext2fs_free_mem(&channel->name);
@@ -326,7 +326,7 @@
test_dump_block(channel, data, block, buf);
if (--data->read_abort_count == 0)
test_abort(channel, block);
- }
+ }
return retval;
}
@@ -380,7 +380,7 @@
test_dump_block(channel, data, block, buf);
if (--data->read_abort_count == 0)
test_abort(channel, block);
- }
+ }
return retval;
}
@@ -439,22 +439,22 @@
{
struct test_private_data *data;
errcode_t retval = 0;
-
+
EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);
data = (struct test_private_data *) channel->private_data;
EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_TEST_IO_CHANNEL);
if (data->real)
retval = io_channel_flush(data->real);
-
+
if (data->flags & TEST_FLAG_FLUSH)
fprintf(data->outfile, "Test_io: flush() returned %s\n",
retval ? error_message(retval) : "OK");
-
+
return retval;
}
-static errcode_t test_set_option(io_channel channel, const char *option,
+static errcode_t test_set_option(io_channel channel, const char *option,
const char *arg)
{
struct test_private_data *data;
@@ -466,10 +466,10 @@
if (data->flags & TEST_FLAG_SET_OPTION)
- fprintf(data->outfile, "Test_io: set_option(%s, %s) ",
+ fprintf(data->outfile, "Test_io: set_option(%s, %s) ",
option, arg);
if (data->real && data->real->manager->set_option) {
- retval = (data->real->manager->set_option)(data->real,
+ retval = (data->real->manager->set_option)(data->real,
option, arg);
if (data->flags & TEST_FLAG_SET_OPTION)
fprintf(data->outfile, "returned %s\n",
diff --git a/lib/ext2fs/tst_badblocks.c b/lib/ext2fs/tst_badblocks.c
index 2453f47..358da20 100644
--- a/lib/ext2fs/tst_badblocks.c
+++ b/lib/ext2fs/tst_badblocks.c
@@ -2,7 +2,7 @@
* This testing program makes sure the badblocks implementation works.
*
* Copyright (C) 1996 by Theodore Ts'o.
- *
+ *
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
@@ -42,7 +42,7 @@
11, 0,
12, 1,
13, 1,
- 14, 0,
+ 14, 0,
80, 0,
45, 0,
66, 1,
@@ -60,7 +60,7 @@
1, DEL_BLK,
0
};
-
+
static int test_fail = 0;
static int test_expected_fail = 0;
@@ -70,7 +70,7 @@
errcode_t retval;
badblocks_list bb;
int i;
-
+
retval = ext2fs_badblocks_list_create(&bb, 5);
if (retval) {
com_err("create_test_list", retval, "while creating list");
@@ -95,7 +95,7 @@
badblocks_iterate iter;
blk_t blk;
int i, ok;
-
+
retval = ext2fs_badblocks_list_iterate_begin(bb, &iter);
if (retval) {
com_err("print_list", retval, "while setting up iterator");
@@ -156,7 +156,7 @@
ext2fs_badblocks_list_del(bb, vec[i]);
match = ext2fs_badblocks_list_test(bb, vec[i]);
printf("Removing block %u --- now %s\n", vec[i],
- ext2fs_badblocks_list_test(bb, vec[i]) ?
+ ext2fs_badblocks_list_test(bb, vec[i]) ?
"present" : "absent");
if (match) {
printf("FAILURE!\n");
@@ -254,7 +254,7 @@
printf("Expected test failure didn't happen!\n");
test_fail++;
}
-
+
if (ext2fs_badblocks_equal(bb, new_bb)) {
printf("Block bitmap matched after reading and writing.\n");
@@ -278,7 +278,7 @@
if (retval == 0)
print_list(bb1, 1);
printf("\n");
-
+
printf("test2: ");
retval = create_test_list(test2, &bb2);
if (retval == 0)
@@ -290,7 +290,7 @@
if (retval == 0)
print_list(bb3, 1);
printf("\n");
-
+
printf("test4: ");
retval = create_test_list(test4, &bb4);
if (retval == 0) {
@@ -315,31 +315,31 @@
if (bb1 && bb2 && bb3 && bb4 && bb5) {
printf("Comparison tests:\n");
equal = ext2fs_badblocks_equal(bb1, bb2);
- printf("bb1 and bb2 are %sequal.\n", equal ? "" : "NOT ");
+ printf("bb1 and bb2 are %sequal.\n", equal ? "" : "NOT ");
if (equal)
test_fail++;
equal = ext2fs_badblocks_equal(bb1, bb3);
- printf("bb1 and bb3 are %sequal.\n", equal ? "" : "NOT ");
+ printf("bb1 and bb3 are %sequal.\n", equal ? "" : "NOT ");
if (!equal)
test_fail++;
-
+
equal = ext2fs_badblocks_equal(bb1, bb4);
- printf("bb1 and bb4 are %sequal.\n", equal ? "" : "NOT ");
+ printf("bb1 and bb4 are %sequal.\n", equal ? "" : "NOT ");
if (equal)
test_fail++;
equal = ext2fs_badblocks_equal(bb4, bb5);
- printf("bb4 and bb5 are %sequal.\n", equal ? "" : "NOT ");
+ printf("bb4 and bb5 are %sequal.\n", equal ? "" : "NOT ");
if (!equal)
test_fail++;
printf("\n");
}
-
+
file_test(bb4);
file_test_invalid(bb4);
-
+
if (test_fail == 0)
printf("ext2fs library badblocks tests checks out OK!\n");
diff --git a/lib/ext2fs/tst_bitops.c b/lib/ext2fs/tst_bitops.c
index eede295..6febe68 100644
--- a/lib/ext2fs/tst_bitops.c
+++ b/lib/ext2fs/tst_bitops.c
@@ -2,7 +2,7 @@
* This testing program makes sure the bitops functions work
*
* Copyright (C) 2001 by Theodore Ts'o.
- *
+ *
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
@@ -97,7 +97,7 @@
}
}
printf("ext2fs_clear_bit test succeed.\n");
-
+
/* Do bigarray test */
bigarray = malloc(1 << 29);
@@ -150,7 +150,7 @@
}
}
printf("ext2fs_clear_bit test succeed.\n");
-
+
bigarray[BIG_TEST_BIT >> 3] = 0;
diff --git a/lib/ext2fs/tst_byteswap.c b/lib/ext2fs/tst_byteswap.c
index d73fb41..ba79c7c 100644
--- a/lib/ext2fs/tst_byteswap.c
+++ b/lib/ext2fs/tst_byteswap.c
@@ -2,7 +2,7 @@
* This testing program makes sure the byteswap functions work
*
* Copyright (C) 2000 by Theodore Ts'o.
- *
+ *
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
@@ -66,7 +66,7 @@
}
i += 2;
} while (test1[i] != 0);
-
+
printf("Testing ext2fs_swab32\n");
i = 0;
do {
@@ -87,6 +87,6 @@
if (!errors)
printf("No errors found in the byteswap implementation!\n");
-
+
return errors;
}
diff --git a/lib/ext2fs/tst_getsectsize.c b/lib/ext2fs/tst_getsectsize.c
index 9967b61..cb1b8c6 100644
--- a/lib/ext2fs/tst_getsectsize.c
+++ b/lib/ext2fs/tst_getsectsize.c
@@ -1,8 +1,8 @@
/*
* tst_getsize.c --- this function tests the getsize function
- *
+ *
* Copyright (C) 1997 by Theodore Ts'o.
- *
+ *
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
@@ -29,7 +29,7 @@
{
int sectsize;
int retval;
-
+
if (argc < 2) {
fprintf(stderr, "Usage: %s device\n", argv[0]);
exit(1);
diff --git a/lib/ext2fs/tst_getsize.c b/lib/ext2fs/tst_getsize.c
index 17f900c..f9fc9d7 100644
--- a/lib/ext2fs/tst_getsize.c
+++ b/lib/ext2fs/tst_getsize.c
@@ -1,8 +1,8 @@
/*
* tst_getsize.c --- this function tests the getsize function
- *
+ *
* Copyright (C) 1997 by Theodore Ts'o.
- *
+ *
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
diff --git a/lib/ext2fs/tst_iscan.c b/lib/ext2fs/tst_iscan.c
index d7fdc12..b0c7fc3 100644
--- a/lib/ext2fs/tst_iscan.c
+++ b/lib/ext2fs/tst_iscan.c
@@ -1,8 +1,8 @@
/*
* tst_inode.c --- this function tests the inode scan function
- *
+ *
* Copyright (C) 1996 by Theodore Ts'o.
- *
+ *
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
@@ -75,7 +75,7 @@
test_io_cb_read_blk = test_read_blk;
-
+
retval = ext2fs_initialize("test fs", 0, ¶m,
test_io_manager, &test_fs);
if (retval) {
@@ -110,7 +110,7 @@
"While allocating bad inode bitmap");
exit(1);
}
-
+
retval = ext2fs_badblocks_list_create(&test_badblocks, 5);
if (retval) {
com_err("setup", retval, "while creating badblocks list");
diff --git a/lib/ext2fs/tst_super_size.c b/lib/ext2fs/tst_super_size.c
index 476b1a6..47fa5ba 100644
--- a/lib/ext2fs/tst_super_size.c
+++ b/lib/ext2fs/tst_super_size.c
@@ -2,7 +2,7 @@
* This testing program makes sure superblock size is 1024 bytes long
*
* Copyright (C) 2007 by Theodore Ts'o.
- *
+ *
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
@@ -25,4 +25,4 @@
}
exit(0);
}
-
+
diff --git a/lib/ext2fs/tst_types.c b/lib/ext2fs/tst_types.c
index 78de7bc..fbe35dc 100644
--- a/lib/ext2fs/tst_types.c
+++ b/lib/ext2fs/tst_types.c
@@ -2,7 +2,7 @@
* This testing program makes sure the ext2_types header file
*
* Copyright (C) 2006 by Theodore Ts'o.
- *
+ *
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c
index eedbcdb..d77e59d 100644
--- a/lib/ext2fs/unix_io.c
+++ b/lib/ext2fs/unix_io.c
@@ -4,7 +4,7 @@
*
* Implements a one-block write-through cache.
*
- * Includes support for Windows NT support under Cygwin.
+ * Includes support for Windows NT support under Cygwin.
*
* Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
* 2002 by Theodore Ts'o.
@@ -83,7 +83,7 @@
static errcode_t unix_flush(io_channel channel);
static errcode_t unix_write_byte(io_channel channel, unsigned long offset,
int size, const void *data);
-static errcode_t unix_set_option(io_channel channel, const char *option,
+static errcode_t unix_set_option(io_channel channel, const char *option,
const char *arg);
static errcode_t unix_get_stats(io_channel channel, io_stats *stats)
;
@@ -169,7 +169,7 @@
goto error_out;
}
return 0;
-
+
error_out:
memset((char *) buf+actual, 0, size-actual);
if (channel->read_error)
@@ -258,14 +258,14 @@
retval = errno ? errno : EXT2_ET_LLSEEK_FAILED;
goto error_out;
}
-
+
actual = write(data->dev, buf, size);
if (actual != size) {
retval = EXT2_ET_SHORT_WRITE;
goto error_out;
}
return 0;
-
+
error_out:
if (channel->write_error)
retval = (channel->write_error)(channel, block, count, buf,
@@ -285,7 +285,7 @@
errcode_t retval;
struct unix_cache *cache;
int i;
-
+
data->access_time = 0;
for (i=0, cache = data->cache; i < CACHE_SIZE; i++, cache++) {
cache->block = 0;
@@ -304,7 +304,7 @@
{
struct unix_cache *cache;
int i;
-
+
data->access_time = 0;
for (i=0, cache = data->cache; i < CACHE_SIZE; i++, cache++) {
cache->block = 0;
@@ -329,7 +329,7 @@
{
struct unix_cache *cache, *unused_cache, *oldest_cache;
int i;
-
+
unused_cache = oldest_cache = 0;
for (i=0, cache = data->cache; i < CACHE_SIZE; i++, cache++) {
if (!cache->in_use) {
@@ -376,18 +376,18 @@
struct unix_cache *cache;
errcode_t retval, retval2;
int i;
-
+
retval2 = 0;
for (i=0, cache = data->cache; i < CACHE_SIZE; i++, cache++) {
if (!cache->in_use)
continue;
-
+
if (invalidate)
cache->in_use = 0;
-
+
if (!cache->dirty)
continue;
-
+
retval = raw_write_blk(channel, data,
cache->block, 1, cache->buf);
if (retval)
@@ -465,7 +465,7 @@
* block devices are wrongly getting hit by the filesize
* limit. This workaround isn't perfect, since it won't work
* if glibc wasn't built against 2.2 header files. (Sigh.)
- *
+ *
*/
if ((flags & IO_FLAG_RW) &&
(uname(&ut) == 0) &&
@@ -476,7 +476,7 @@
(fstat(data->dev, &st) == 0) &&
(S_ISBLK(st.st_mode))) {
struct rlimit rlim;
-
+
rlim.rlim_cur = rlim.rlim_max = (unsigned long) RLIM_INFINITY;
setrlimit(RLIMIT_FSIZE, &rlim);
getrlimit(RLIMIT_FSIZE, &rlim);
@@ -541,7 +541,7 @@
if ((retval = flush_cached_blocks(channel, data, 0)))
return retval;
#endif
-
+
channel->block_size = blksize;
free_cache(data);
if ((retval = alloc_cache(channel, data)))
@@ -602,7 +602,7 @@
#endif
if ((retval = raw_read_blk(channel, data, block, i, cp)))
return retval;
-
+
/* Save the results in the cache */
for (j=0; j < i; j++) {
count--;
@@ -637,7 +637,7 @@
#ifdef NO_IO_CACHE
return raw_write_blk(channel, data, block, count, buf);
-#else
+#else
/*
* If we're doing an odd-sized write or a very large write,
* flush out the cache completely and then do a direct write.
@@ -656,7 +656,7 @@
writethrough = channel->flags & CHANNEL_FLAGS_WRITETHROUGH;
if (writethrough)
retval = raw_write_blk(channel, data, block, count, buf);
-
+
cp = buf;
while (count > 0) {
cache = find_cached_block(data, block, &reuse);
@@ -701,7 +701,7 @@
if (lseek(data->dev, offset + data->offset, SEEK_SET) < 0)
return errno;
-
+
actual = write(data->dev, buf, size);
if (actual != size)
return EXT2_ET_SHORT_WRITE;
@@ -710,13 +710,13 @@
}
/*
- * Flush data buffers to disk.
+ * Flush data buffers to disk.
*/
static errcode_t unix_flush(io_channel channel)
{
struct unix_private_data *data;
errcode_t retval = 0;
-
+
EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);
data = (struct unix_private_data *) channel->private_data;
EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_UNIX_IO_CHANNEL);
@@ -728,7 +728,7 @@
return retval;
}
-static errcode_t unix_set_option(io_channel channel, const char *option,
+static errcode_t unix_set_option(io_channel channel, const char *option,
const char *arg)
{
struct unix_private_data *data;
diff --git a/lib/ext2fs/unlink.c b/lib/ext2fs/unlink.c
index a48b877..ffe8dbe 100644
--- a/lib/ext2fs/unlink.c
+++ b/lib/ext2fs/unlink.c
@@ -1,6 +1,6 @@
/*
* unlink.c --- delete links in a ext2fs directory
- *
+ *
* Copyright (C) 1993, 1994, 1997 Theodore Ts'o.
*
* %Begin-Header%
@@ -25,7 +25,7 @@
int flags;
struct ext2_dir_entry *prev;
int done;
-};
+};
#ifdef __TURBOC__
#pragma argsused
@@ -89,7 +89,7 @@
ls.done = 0;
ls.prev = 0;
- retval = ext2fs_dir_iterate(fs, dir, DIRENT_FLAG_INCLUDE_EMPTY,
+ retval = ext2fs_dir_iterate(fs, dir, DIRENT_FLAG_INCLUDE_EMPTY,
0, unlink_proc, &ls);
if (retval)
return retval;
diff --git a/lib/ext2fs/valid_blk.c b/lib/ext2fs/valid_blk.c
index 29ff27a..d0367e7 100644
--- a/lib/ext2fs/valid_blk.c
+++ b/lib/ext2fs/valid_blk.c
@@ -2,12 +2,12 @@
* valid_blk.c --- does the inode have valid blocks?
*
* Copyright 1997 by Theodore Ts'o
- *
+ *
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
* %End-Header%
- *
+ *
*/
#include <stdio.h>
@@ -33,7 +33,7 @@
if (!LINUX_S_ISDIR(inode->i_mode) && !LINUX_S_ISREG(inode->i_mode) &&
!LINUX_S_ISLNK(inode->i_mode))
return 0;
-
+
/*
* If the symbolic link is a "fast symlink", then the symlink
* target is stored in the block entries.