Whamcloud - gitweb
git://git.whamcloud.com
/
tools
/
e2fsprogs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
combined
(merge:
abbf95c
c714d02
)
Merge branch 'maint' into next
author
Theodore Ts'o
<tytso@mit.edu>
Fri, 31 Jan 2014 00:05:16 +0000
(19:05 -0500)
committer
Theodore Ts'o
<tytso@mit.edu>
Fri, 31 Jan 2014 00:05:16 +0000
(19:05 -0500)
Conflicts:
lib/ext2fs/alloc.c
misc/mke2fs.c
26 files changed:
1
2
configure.in
patch
|
diff1
|
diff2
|
blob
|
history
debugfs/set_fields.c
patch
|
diff1
|
diff2
|
blob
|
history
e2fsck/pass5.c
patch
|
diff1
|
diff2
|
blob
|
history
lib/config.h.in
patch
|
diff1
|
diff2
|
blob
|
history
lib/e2p/feature.c
patch
|
diff1
|
diff2
|
blob
|
history
lib/e2p/ls.c
patch
|
diff1
|
diff2
|
blob
|
history
lib/ext2fs/Makefile.in
patch
|
diff1
|
diff2
|
blob
|
history
lib/ext2fs/alloc.c
patch
|
diff1
|
diff2
|
blob
|
history
lib/ext2fs/alloc_stats.c
patch
|
diff1
|
diff2
|
blob
|
history
lib/ext2fs/alloc_tables.c
patch
|
diff1
|
diff2
|
blob
|
history
lib/ext2fs/blkmap64_ba.c
patch
|
diff1
|
diff2
|
blob
|
history
lib/ext2fs/blkmap64_rb.c
patch
|
diff1
|
diff2
|
blob
|
history
lib/ext2fs/bmap64.h
patch
|
diff1
|
diff2
|
blob
|
history
lib/ext2fs/closefs.c
patch
|
diff1
|
diff2
|
blob
|
history
lib/ext2fs/ext2_fs.h
patch
|
diff1
|
diff2
|
blob
|
history
lib/ext2fs/ext2fs.h
patch
|
diff1
|
diff2
|
blob
|
history
lib/ext2fs/extent.c
patch
|
diff1
|
diff2
|
blob
|
history
lib/ext2fs/gen_bitmap64.c
patch
|
diff1
|
diff2
|
blob
|
history
lib/ext2fs/initialize.c
patch
|
diff1
|
diff2
|
blob
|
history
lib/ext2fs/openfs.c
patch
|
diff1
|
diff2
|
blob
|
history
lib/ext2fs/rw_bitmaps.c
patch
|
diff1
|
diff2
|
blob
|
history
lib/ext2fs/swapfs.c
patch
|
diff1
|
diff2
|
blob
|
history
lib/ext2fs/tst_super_size.c
patch
|
diff1
|
diff2
|
blob
|
history
misc/mke2fs.c
patch
|
diff1
|
diff2
|
blob
|
history
misc/tune2fs.c
patch
|
diff1
|
diff2
|
blob
|
history
resize/resize2fs.c
patch
|
diff1
|
diff2
|
blob
|
history
diff --cc
configure.in
Simple merge
diff --cc
debugfs/set_fields.c
index
d46ba27
,
ffbda74
..
762e655
---
1
/
debugfs/set_fields.c
---
2
/
debugfs/set_fields.c
+++ b/
debugfs/set_fields.c
@@@
-150,8
-150,9
+150,10
@@@
static struct field_set_info super_fiel
{ "usr_quota_inum", &set_sb.s_usr_quota_inum, NULL, 4, parse_uint },
{ "grp_quota_inum", &set_sb.s_grp_quota_inum, NULL, 4, parse_uint },
{ "overhead_blocks", &set_sb.s_overhead_blocks, NULL, 4, parse_uint },
+ { "backup_bgs", &set_sb.s_backup_bgs[0], NULL, 4, parse_uint,
+ FLAG_ARRAY, 2 },
{ "checksum", &set_sb.s_checksum, NULL, 4, parse_uint },
+ { "checksum_type", &set_sb.s_checksum_type, NULL, 1, parse_uint },
{ 0, 0, 0, 0 }
};
diff --cc
e2fsck/pass5.c
Simple merge
diff --cc
lib/config.h.in
Simple merge
diff --cc
lib/e2p/feature.c
Simple merge
diff --cc
lib/e2p/ls.c
Simple merge
diff --cc
lib/ext2fs/Makefile.in
Simple merge
diff --cc
lib/ext2fs/alloc.c
index
ce72ffe
,
7dcfd3c
..
1be4ecc
---
1
/
lib/ext2fs/alloc.c
---
2
/
lib/ext2fs/alloc.c
+++ b/
lib/ext2fs/alloc.c
@@@
-27,16
-27,12
+27,11
@@@
#include "ext2fs.h"
/*
- * C
heck for uninit block bitmaps and deal with them appropriatel
y
+ * C
lear the uninit block bitmap flag if necessar
y
*/
- static void check_block_uninit(ext2_filsys fs, ext2fs_block_bitmap map,
- dgrp_t group)
+ static void clear_block_uninit(ext2_filsys fs, dgrp_t group)
{
- blk_t i;
- blk64_t blk, super_blk, old_desc_blk, new_desc_blk;
- int old_desc_blocks;
-
- if (!(EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
- EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) ||
+ if (!ext2fs_has_group_desc_csum(fs) ||
!(ext2fs_bg_flags_test(fs, group, EXT2_BG_BLOCK_UNINIT)))
return;
diff --cc
lib/ext2fs/alloc_stats.c
Simple merge
diff --cc
lib/ext2fs/alloc_tables.c
Simple merge
diff --cc
lib/ext2fs/blkmap64_ba.c
Simple merge
diff --cc
lib/ext2fs/blkmap64_rb.c
index
7e28bd0
,
148f856
..
28820cb
---
1
/
lib/ext2fs/blkmap64_rb.c
---
2
/
lib/ext2fs/blkmap64_rb.c
+++ b/
lib/ext2fs/blkmap64_rb.c
@@@
-797,9
-806,97
+804,97
@@@
static void rb_clear_bmap(ext2fs_generi
bp->rcursor = NULL;
bp->rcursor_next = NULL;
bp->wcursor = NULL;
+ check_tree(&bp->root, __func__);
+ }
+
+ static errcode_t rb_find_first_zero(ext2fs_generic_bitmap bitmap,
+ __u64 start, __u64 end, __u64 *out)
+ {
+ struct rb_node *parent = NULL, **n;
+ struct rb_node *node, *next;
+ struct ext2fs_rb_private *bp;
+ struct bmap_rb_extent *ext;
+ int retval = 1;
+
+ bp = (struct ext2fs_rb_private *) bitmap->private;
+ n = &bp->root.rb_node;
+ start -= bitmap->start;
+ end -= bitmap->start;
+
+ if (start > end)
+ return EINVAL;
+
+ if (EXT2FS_RB_EMPTY_ROOT(&bp->root))
+ return ENOENT;
+
+ while (*n) {
+ parent = *n;
+ ext = node_to_extent(parent);
+ if (start < ext->start) {
+ n = &(*n)->rb_left;
+ } else if (start >= (ext->start + ext->count)) {
+ n = &(*n)->rb_right;
+ } else if (ext->start + ext->count <= end) {
+ *out = ext->start + ext->count + bitmap->start;
+ return 0;
+ } else
+ return ENOENT;
+ }
+
+ *out = start + bitmap->start;
+ return 0;
+ }
+
+ static errcode_t rb_find_first_set(ext2fs_generic_bitmap bitmap,
+ __u64 start, __u64 end, __u64 *out)
+ {
+ struct rb_node *parent = NULL, **n;
+ struct rb_node *node, *next;
+ struct ext2fs_rb_private *bp;
+ struct bmap_rb_extent *ext;
+ int retval = 1;
+
+ bp = (struct ext2fs_rb_private *) bitmap->private;
+ n = &bp->root.rb_node;
+ start -= bitmap->start;
+ end -= bitmap->start;
+
+ if (start > end)
+ return EINVAL;
+
+ if (EXT2FS_RB_EMPTY_ROOT(&bp->root))
+ return ENOENT;
+
+ while (*n) {
+ parent = *n;
+ ext = node_to_extent(parent);
+ if (start < ext->start) {
+ n = &(*n)->rb_left;
+ } else if (start >= (ext->start + ext->count)) {
+ n = &(*n)->rb_right;
+ } else {
+ /* The start bit is set */
+ *out = start + bitmap->start;
+ return 0;
+ }
+ }
+
+ node = parent;
+ ext = node_to_extent(node);
+ if (ext->start < start) {
+ node = ext2fs_rb_next(node);
+ if (node == NULL)
+ return ENOENT;
+ ext = node_to_extent(node);
+ }
+ if (ext->start <= end) {
+ *out = ext->start + bitmap->start;
+ return 0;
+ }
+ return ENOENT;
}
-#ifdef BMAP_STATS
+#ifdef
ENABLE_
BMAP_STATS
static void rb_print_stats(ext2fs_generic_bitmap bitmap)
{
struct ext2fs_rb_private *bp;
diff --cc
lib/ext2fs/bmap64.h
Simple merge
diff --cc
lib/ext2fs/closefs.c
Simple merge
diff --cc
lib/ext2fs/ext2_fs.h
Simple merge
diff --cc
lib/ext2fs/ext2fs.h
index
b0c3036
,
1491c62
..
7f7fd1f
---
1
/
lib/ext2fs/ext2fs.h
---
2
/
lib/ext2fs/ext2fs.h
+++ b/
lib/ext2fs/ext2fs.h
@@@
-1254,8
-1180,15
+1257,11
@@@
extern errcode_t ext2fs_set_generic_bit
extern errcode_t ext2fs_find_first_zero_generic_bitmap(ext2fs_generic_bitmap bitmap,
__u32 start, __u32 end,
__u32 *out);
+ extern errcode_t ext2fs_find_first_set_generic_bitmap(ext2fs_generic_bitmap bitmap,
+ __u32 start, __u32 end,
+ __u32 *out);
/* gen_bitmap64.c */
-
-/* Generate and print bitmap usage statistics */
-#define BMAP_STATS
-
void ext2fs_free_generic_bmap(ext2fs_generic_bitmap bmap);
errcode_t ext2fs_alloc_generic_bmap(ext2_filsys fs, errcode_t magic,
int type, __u64 start, __u64 end,
diff --cc
lib/ext2fs/extent.c
Simple merge
diff --cc
lib/ext2fs/gen_bitmap64.c
Simple merge
diff --cc
lib/ext2fs/initialize.c
Simple merge
diff --cc
lib/ext2fs/openfs.c
Simple merge
diff --cc
lib/ext2fs/rw_bitmaps.c
Simple merge
diff --cc
lib/ext2fs/swapfs.c
Simple merge
diff --cc
lib/ext2fs/tst_super_size.c
Simple merge
diff --cc
misc/mke2fs.c
index
527f25b
,
0ed02a5
..
7b69595
---
1
/
misc/mke2fs.c
---
2
/
misc/mke2fs.c
+++ b/
misc/mke2fs.c
@@@
-309,27
-313,40
+313,61
@@@
_("Warning: the backup superblock/grou
ext2fs_badblocks_list_iterate_end(bb_iter);
}
+static void write_reserved_inodes(ext2_filsys fs)
+{
+ errcode_t retval;
+ ext2_ino_t ino;
+ struct ext2_inode *inode;
+
+ retval = ext2fs_get_mem(EXT2_INODE_SIZE(fs->super), &inode);
+ if (retval) {
+ com_err("inode_init", retval,
+ "while allocating memory");
+ exit(1);
+ }
+ bzero(inode, EXT2_INODE_SIZE(fs->super));
+
+ for (ino = 1; ino < EXT2_FIRST_INO(fs->super); ino++)
+ ext2fs_write_inode_full(fs, ino, inode,
+ EXT2_INODE_SIZE(fs->super));
+
+ ext2fs_free_mem(&inode);
+}
+
+ static errcode_t packed_allocate_tables(ext2_filsys fs)
+ {
+ errcode_t retval;
+ dgrp_t i;
+ blk64_t goal = 0;
+
+ for (i = 0; i < fs->group_desc_count; i++) {
+ retval = ext2fs_new_block2(fs, goal, NULL, &goal);
+ if (retval)
+ return retval;
+ ext2fs_block_alloc_stats2(fs, goal, +1);
+ ext2fs_block_bitmap_loc_set(fs, i, goal);
+ }
+ for (i = 0; i < fs->group_desc_count; i++) {
+ retval = ext2fs_new_block2(fs, goal, NULL, &goal);
+ if (retval)
+ return retval;
+ ext2fs_block_alloc_stats2(fs, goal, +1);
+ ext2fs_inode_bitmap_loc_set(fs, i, goal);
+ }
+ for (i = 0; i < fs->group_desc_count; i++) {
+ blk64_t end = ext2fs_blocks_count(fs->super) - 1;
+ retval = ext2fs_get_free_blocks2(fs, goal, end,
+ fs->inode_blocks_per_group,
+ fs->block_map, &goal);
+ if (retval)
+ return retval;
+ ext2fs_block_alloc_stats_range(fs, goal,
+ fs->inode_blocks_per_group, +1);
+ ext2fs_inode_table_loc_set(fs, i, goal);
+ }
+ return 0;
+ }
+
static void write_inode_tables(ext2_filsys fs, int lazy_flag, int itable_zeroed)
{
errcode_t retval;
diff --cc
misc/tune2fs.c
Simple merge
diff --cc
resize/resize2fs.c
Simple merge