aboutsummaryrefslogtreecommitdiffstats
path: root/misc/util.h
Commit message (Collapse)AuthorAgeFilesLines
* e2fsprogs: Rework build configurationreplicant-6.0-0004-rc1replicant-6.0-0003replicant-6.0-0002replicant-6.0-0001stable/cm-13.0-ZNH5Ystable/cm-13.0-ZNH2KBstable/cm-13.0-ZNH2Kstable/cm-13.0-ZNH0ESteve Kondik2015-11-101-16/+296
| | | | Change-Id: I8d6137a9c22b165e79e19ab3997cabf182bba363
* Switch back to 1.42.9 now that there is a fixJP Abgrall2014-03-191-1/+2
| | | | | | Revert "Revert changes that moved from 1.41.14 to 1.42.9" This reverts commit 65f0aab98b20b5994a726ab90d355248bcddfffd.
* Revert changes that moved from 1.41.14 to 1.42.9JP Abgrall2014-03-061-2/+1
| | | | | | | | | | | | | | | | Revert "e2fsck: Don't use e2fsck_global_ctx unless HAVE_SIGNAL_H" commit e80e74c41d85ff93f3d212ba6512340f48054a93. Revert "Merge remote-tracking branch 'linaro/linaro-1.42.9' into aosp_master" This reverts commit e97b2b6fc82f840e84dfc631b87f21be44ff2421, reversing changes made to 7e2fb9d09c245eba70ee008b78007315e9c0f1df. Revert "Prepare for upstream 1.42.9" This reverts commit 7e2fb9d09c245eba70ee008b78007315e9c0f1df. Bug: 13340735 Change-Id: If48b153a95ef5f69f7cdccb00e23524abff3c5a8 Signed-off-by: JP Abgrall <jpa@google.com>
* mke2fs: set s_max_mnt_count to -1 by defaultTheodore Ts'o2011-09-281-1/+1
| | | | | | | | | | | | If the enable_periodic_fsck option is false in /etc/mke2fs.conf (which is also the default), s_max_mnt_count needs to be set to -1, instead of 0. Kernels newer than 3.0 will interpret 0 to disable periodic checks, but older kernels will print a warning message on each mount, which will annoy users. Addresses-Debian-Bug: #632637 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* ext2fs: add multi-mount protection (INCOMPAT_MMP)Andreas Dilger2011-09-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Multi-mount protection is feature that allows mke2fs, e2fsck, and others to detect if the filesystem is mounted on a remote node (on SAN disks) and avoid corrupting the filesystem. For e2fsprogs this means that it checks the MMP block to see if the filesystem is in use, and marks the filesystem busy while e2fsck is running on the system. This is useful on SAN disks that are shared between high-availability servers, or accessible by multiple nodes that aren't in HA pairs. MMP isn't intended to serve as a primary HA exclusion mechanism, but as a failsafe to protect against user, software, or hardware errors. There is no requirement that e2fsck updates the MMP block at regular intervals, but e2fsck does this occasionally to provide useful information to the sysadmin in case of a detected conflict. For the kernel (since Linux 3.0) MMP adds a "heartbeat" mechanism to periodically write to disk (every few seconds by default) to notify other nodes that the filesystem is still in use and unsafe to modify. Originally-by: Kalpak Shah <kalpak@clusterfs.com> Signed-off-by: Johann Lombardi <johann@whamcloud.com> Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* mke2fs: Use ext2fs_flush() only onceLukas Czerner2011-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | We are doing ext2fs_flush() twice right now at the end of the mke2fs. First by directly calling ext2fs_flush() which is intended to write superblock and fs accounting information. And then it is invoked again when we are calling ext2fs_close(), only this time, because the fs is not dirty, we are writing out only superblock. I think it is bad to call it twice because even when writing only super block it takes some time on bigger file systems and moreover ext2fs_close() can fail without any reasonable explanation for the user. Also ext2fs_flush() is printing out progress and it is confusing for the users. Fix all this by removing the ext2fs_flush() and leaving it all to ext2fs_close(). However we need to introduce new variables to store check interval and max mount count, because fs structure is freed on ext2fs_close() and we really want to print those information as the last info for the user. [ Fixed type mismatch in a printf format statement -tytso] Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* Remove trailing whitespace for the entire source treeTheodore Ts'o2008-08-271-1/+1
| | | | Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* Fix gcc -Wall warningsTheodore Ts'o2007-08-031-1/+1
| | | | Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* Add check for mkfs.ext3 and create a journal in this case.Andreas Dilger2002-02-251-0/+1
|
* Fix various gcc -Wall nits. Fixed a bug in mke2fs where a bogusTheodore Ts'o2001-12-161-1/+1
| | | | | | | error message could be printed on an malloc() failure, and e2image was optimized to avoid needless system calls by using the stashed inode functions.
* ChangeLog, mke2fs.c, tune2fs.8.in, tune2fs.c, util.c, util.h:Theodore Ts'o2001-06-141-1/+1
| | | | | | | | | | | tune2fs.c, mke2fs.c, util.c, util.h (print_check_message): Move the message which displays how often the filesystem will be checked from mke2fs into a utility subroutine. Then cause tune2fs to call that function to display the message after adding a journal to a filesystem. mke2fs.8.in: Add manual page fixups and explanation for why it's good to check filesystems periodically from Andreas Dilger.
* ChangeLog, mke2fs.8.in, mke2fs.c, tune2fs.8.in, tune2fs.c, util.c, util.h:Theodore Ts'o2001-03-261-1/+2
| | | | | | | | | | | | | | | ke2fs.8.in, tune2fs.8.in: Change man paegs to document that the journal must be bewteen 1024 and 10,240 file system blocks. mke2fs.c, tune2fs.c: Change to use figure_journal_size() util.c, util.h (figure_journal_size): Change journal_default_size into routine which also converts the requested journal size into filesystem blocks and does bounds checking to make sure the journal is sized reasonably. Renamed function to journal_default_size. parse_journal_opts): Remove bounds check for the journal size, since this is now done in figure_journal_size, and based on the number of filesystem blocks, as opposed to using the absolute size of the journal.
* ChangeLog, util.c, util.h:Theodore Ts'o2001-01-181-0/+1
| | | | | | | | | util.h, util.c (journal_default_size): New function from Andreas Dilger to calculate an appropriate default journal size given a filesystem size. util.c (parse_journal_opts): Allow the creation of a journal as small as 1MB.
* ChangeLog, Makefile.in, mke2fs.c, tune2fs.8.in, tune2fs.c, util.c, util.h:Theodore Ts'o2001-01-031-0/+23
tune2fs.c (update_feature_set, add_journal): Moved to separate functions. Added ability to add and remove the journal while the filesystem is live. Added support for setting a time-based UUID. Removed zero-initialized static variables. mke2fs.c, util.c, util.h (strcasecmp, proceed_question, check_plausibility, parse_journal_opts, check_mount): Moved functions to util.c so they can be used by tune2fs. mke2fs.c (main): Change ext2fs_add_journal_fs() to ext2fs_add_journal_inode() to reflect function renaming.