summaryrefslogtreecommitdiff
path: root/misc
AgeCommit message (Collapse)AuthorFilesLines
2009-10-25libext2fs: clean up ext2fs_bg_flags_ interfacesEric Sandeen1-1/+1
The ext2fs_bg_flag* functions were confusing. Currently we have this: void ext2fs_bg_flags_set(ext2_filsys fs, dgrp_t group, __u16 bg_flags); void ext2fs_bg_flags_clear(ext2_filsys fs, dgrp_t group,__u16 bg_flags); (_set (unused) sets exactly bg_flags; _clear clears all and ignores bg_flags) and these, which can twiddle individual bits in bg_flags: void ext2fs_bg_flag_set(ext2_filsys fs, dgrp_t group, __u16 bg_flag); void ext2fs_bg_flag_clear(ext2_filsys fs, dgrp_t group, __u16 bg_flag); A better interface, after the patch below, is just: ext2fs_bg_flags_zap(fs, group) /* zeros bg_flags */ ext2fs_bg_flags_set(fs, group, flags) /* adds flags to bg_flags */ ext2fs_bg_flags_clear(fs, group, flags) /* clears flags in bg_flags */ and remove the original ext2fs_bg_flags_set / ext2fs_bg_flags_clear. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-24Merge branch 'maint' into nextTheodore Ts'o2-6/+8
Conflicts: configure configure.in
2009-10-24tune2fs.8: Clarify tune2fs's -i optionTheodore Ts'o1-4/+6
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-24dumpe2fs: Fix usage message for -o superblock=<num> and -o blocksize=<num>Theodore Ts'o1-2/+2
Addresses-Launchpad-Bug: #448099 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-04Merge branch 'maint' into nextTheodore Ts'o4-46/+105
Conflicts: configure configure.in misc/mke2fs.c
2009-10-04mke2fs: get device topology values from blkidEric Sandeen1-0/+55
Handle automatic selection of stride/stripe: mke2fs 1.41.9 (22-Aug-2009) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=16 blocks, Stripe width=32 blocks ... And warn on block device misalignment: mke2fs 1.41.9 (22-Aug-2009) /dev/sdc1 alignment is offset by 32256 bytes. This may result in very poor performance, (re)-partitioning suggested. Proceed anyway? (y,n) Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-10-04Don't use in-tree header files if using system uuid or blkid librariesTheodore Ts'o1-43/+49
This commit forces the use of the system-provided blkid or uuid header files if we are using the system-provided blkid or uuid libraries. This avoids using the in-tree header files with the system libraries. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-03fix fd leak that causes fsck to fail with "too many open files"Cristian Rodríguez1-3/+0
fsck leaks fds when invoked with -R -A -M -a -t noopts=nofail Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-09-08e2undo: Initialize com_err error tables for the ext2fs libraryTheodore Ts'o1-0/+1
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07Convert uses of super->s_*_blocks_count to ext2fs_*_blocks_count()Valerie Aurora Henson7-71/+78
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com> Signed-off-by: Nick Dokos <nicholas.dokos@hp.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07Use ext2fs_file_acl_block() instead of using .i_file_acl directlyValerie Aurora Henson2-6/+7
This provides support for 48-bit file acl blocks. Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07mke2fs.8.in: Clarify flex_bg feature descriptionTheodore Ts'o2-27/+39
Add a more explicit description of how specifying the flex_bg file system feature changes the layout of the per-block group metadata. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07tune2fs.8: Document the flex_bg file system option in the man pageTheodore Ts'o1-7/+11
Addresses-Sourceforge-Bug: #2822186 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-06dumpe2fs: Print more information about the inline journalTheodore Ts'o1-1/+43
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-23libext2fs: create generic numeric progress meters and use themValerie Aurora Henson1-70/+26
With 64-bit file systems, mke2fs can take a long time to do things other than write inode tables. I exported the mke2fs numeric progress meter and used it for allocating group tables and the final file system flush. Signed-off-by: Valerie Aurora (Henson) <vaurora@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07Use accessor functions fields for bg_flags in the block group descriptorsTheodore Ts'o2-2/+2
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07Convert to use io_channel_read_blk64() and io_channel_write_blk64()Valerie Aurora Henson5-16/+16
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07Merge branch 'maint' into nextTheodore Ts'o5-37/+95
2009-09-07e4defrag: fix ppc buildKyle McMartin1-0/+6
ppc glibc seems to be missing sync_file_range, so we fell back to the local define, and there ppc differs as well, so the build was failing. Thanks to Kyle for the patch w/ the tidy solution. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-08-23e4defrag: Link with ext2fs libraryTheodore Ts'o1-4/+4
Since e4defrag uses ext2fs_swab32, it needs to link against the ext2fs library. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-23mke2fs.conf: Use the feature name "extent" instead of "extents"Theodore Ts'o1-2/+2
The feature name "extent" is documented in mke2fs.conf, although both "extent" and "extents" are accepted by e2fsprogs. Addreses-Debian-Bug: #540111 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-22e2freefrag: Update manpage to include e2fsprogs version and release dateTheodore Ts'o1-1/+1
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-22Convert tune2fs, dumpe2fs, and e2image to the new bitmap interfaceValerie Aurora Henson4-26/+26
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-20tune2fs: handle bad blocks when resizing inodesAneesh Kumar K.V1-3/+14
When increasing inode size if we find that the new block that we needed to increase the inode table size is a bad block we fail. This make sure we don't end up with a corrupt file system when doing inode resize on a file system having bad blocks. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-08-20tune2fs: Handle fs meta-data blocks during inode resizeAneesh Kumar K.V1-1/+84
With file system formated for RAID arrays we can have inode bitmap and block bitmap after inode table. Make sure we move them around properly when doing inode resize. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-08-20tune2fs: Make e2fsprogs handle ENOSPC better with inode resizeAneesh Kumar K.V1-89/+32
This removes the metadata block bitmap and makes the error handling simpler. It also check for the enospc with the correct number needed blocks. Also added specific error messages. We need to run e2undo only if we start modiyfing inode, group desc and inode table. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-08-15filefrag: don't print extent header on bmap fallbackEric Sandeen1-5/+8
The extent list header gets printed before we fall back to bmap: # filefrag -v /mnt/test/bar Filesystem type is: 58465342 File size of /mnt/test/bar is 12288 (3 blocks, blocksize 4096) ext logical physical expected length flags <---- HERE Discontinuity: Block 2 is at 17 (was 16) /mnt/test/bar: 2 extents found so delay printing it until we know fiemap is working. (though ideally it'd be nice to have the same verbose output regardless of the interface we used, I think). Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-08-15filefrag: fix frag count in bmap caseEric Sandeen1-0/+2
The fragmentation count in the bmap case seems to be off by one: /mnt/test/bar: 0 extents found Addresses-Debian-Bug: #540376 Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-08-15filefrag: Add option to force use of the FIBMAP ioctlTheodore Ts'o2-4/+13
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09Add V=1 support when linking e2freefrag in misc/Makefile.inTheodore Ts'o1-2/+2
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09e2freefrag: Take into account the last free extent in the file systemTheodore Ts'o1-17/+30
Fix a bug in e2freefrag where if the last free extent is at the very end of the filesystem, it would be disregarded. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09e2freefrag: Fix to work correctly for file systems with 1kb block sizesTheodore Ts'o1-4/+8
If the file system has a non-zero s_first_data_block, as is the case when the block size is 1kb, e2freefrag would incorrectly try to reference invalid data blocks in the block allocation bitmap. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09e2freefrag: Do not print chunk-related information by defaultTheodore Ts'o2-19/+24
Only print information related to chunk sizes if a chunksize is printed. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09e2freefrag: Clarify e2freefrag's messagesTheodore Ts'o2-11/+11
"Free chunks" is confusing since it has nothing to do with the chunksize; use "free extents" instead. Also add a missing newline in an error message. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09e2freefrag: Initialize the ext2 error tableTheodore Ts'o1-0/+1
... so error messages are printed correctly Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-05Convert mke2fs to new bitmap interfaceValerie Aurora Henson1-4/+10
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-22Merge branch 'maint' into nextTheodore Ts'o6-117/+191
2009-08-22Move declaration of FS_IOC_FIEMAP ioctl to fiemap.hTheodore Ts'o2-2/+1
This helps e4defrag compile on systems where the system header files don't yet define FS_IOC_FIEMAP. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-01Merge branch 'maint' into nextTheodore Ts'o4-4/+419
Conflicts: misc/Makefile.in
2009-07-27e4defrag: remove a lot of cruftEric Sandeen1-81/+34
e4defrag.c had a lot of stuff copied into it from other places, redefinitions of existing interfaces, etc. We should be able to remove most of this, as the tool only works on recent kernels anyway, we should just pick up definitions from recent kernel headers whenever possible. I've left the local definitions of fallocate, fadvise (changed to posix_fadvise) and sync_file_range, and wrapped them in #ifdef configure-time tests - though really it seems like only fallocate should be necessary by now, and perhaps the others can be dropped. We still need some Makefile work so that it won't try to build e4defrag if the right pieces aren't there (and if the local definitions won't work...) Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-24e2freefrag: Improve output to include be more like xfs_db's freesp -sAndreas Dilger4-30/+40
Signed-off-by: Andreas Dilger <adilger@sun.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-22e2freefrag: New program which displays how fragmented the free space isTheodore Ts'o4-4/+409
Signed-off-by: Andreas Dilger <adilger@sun.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-18mke2fs: Add strings.h include for strcasecmp() declarationTheodore Ts'o1-0/+1
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-18filefrag: fix it so it works in the bmap fallback case.Eric Sandeen1-2/+0
It looks like some debugging crept in? Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-07-11Fix miscellaneous gcc -Wall warnings in blkid and tune2fsTheodore Ts'o2-2/+1
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-11filefrag: Restore "perfect" number of extents calculation for ext2/ext3Theodore Ts'o1-8/+8
The FIEMAP support added in e2fsprogs 1.41.6 broke the "perfection would be XXX expects" calculation restore it. Also fix some gcc -Wall warnings as well. (Cleaning up gcc -Wall is what caused me to notice this regression). Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-02filefrag: fix fm_start in filefrag_fiemap loopPeng Tao1-2/+2
When used with -v and the targeted file has more than 144 extents(double of the length of fm_extents array provided by buf), filefrag_fiemap loops and calls fiemap ioctl() multiple times to calculate the actual number of extents in a file. Each call to fiemap ioctl() uses fm_start as the starting logical offset. The patch fixes fm_start in each loop( except for the first one) and makes the extent calculation correct for files with more that 144 extents. To produce the problem, first run filefrag -v on a highly fragmented file. Then change the buf size in filefrag_fiemap to make it large enough to have all the extent mapped in a single loop and run filefrag -v after recompiling. The former will produce a much smaller extent count because of the false fm_start used in the loop. And the two will produce different extent output since the 145th extent. Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-02remove bogus "-e" option from filefrag manpagePeng Tao1-1/+1
filefrag doesn't support "-e" option, so clean it up in the manpage. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-07-02Add support for configure --enable-verbose-makecmdsTheodore Ts'o1-151/+151
Some people don't want to see the concise "kernel-style" make output. This configure option allows build engines that want to see the full set of commands executed by the makefile to get what they want. Most people will find this more distracting than useful, unless they need to debug the Makefiles. (It is not necessary to rerun configure to enable this verbose make output temprarily; if a developer wants to do a quick debug of a directory's makefile, he or she can simply edit the definition of the $(E) and $(Q) variables in the Makefile; instructions can be found in the MCONFIG file which is included in at the beginning of every Makefile.) Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-01Fix Makefile dependencies for libcom_errTheodore Ts'o1-6/+7
The e2fsprogs makefiles were using the same Makefile variable LIBCOM_ERR for the link-line arguments as well as the dependencies. Since LIBCOM_ERR can now include non-file arguments such as "-lpthread", we need to use a separate DEPLIBCOM_ERR variable that only has build file dependencies. Do the same thing for STATIC_LIBCOM_ERR and PROFILED_LIBCOM_ERR. Addresses-Sourceforge-Patches: #2813809 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>