rpms/ntfsprogs/devel ntfsprogs-2.0.0-check_volume.patch, NONE, 1.1 ntfsprogs.spec, 1.12, 1.13
Tom Callaway (spot)
fedora-extras-commits at redhat.com
Thu Mar 27 19:47:52 UTC 2008
- Previous message (by thread): rpms/e16/F-8 e16.spec,NONE,1.1 .cvsignore,1.1,1.2 sources,1.1,1.2
- Next message (by thread): rpms/systemtap/devel systemtap.spec, 1.38, 1.39 elfutils-configury.patch, 1.1, NONE systemtap-0.6.1-elfi.patch, 1.1, NONE systemtap-0.6.1-gcc43.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: spot
Update of /cvs/pkgs/rpms/ntfsprogs/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11740
Modified Files:
ntfsprogs.spec
Added Files:
ntfsprogs-2.0.0-check_volume.patch
Log Message:
add check option, to see if the volume is ready for resize
ntfsprogs-2.0.0-check_volume.patch:
--- NEW FILE ntfsprogs-2.0.0-check_volume.patch ---
diff -up ntfsprogs-2.0.0/ntfsprogs/ntfsresize.8.in.BAD ntfsprogs-2.0.0/ntfsprogs/ntfsresize.8.in
--- ntfsprogs-2.0.0/ntfsprogs/ntfsresize.8.in.BAD 2008-03-27 14:37:01.000000000 -0400
+++ ntfsprogs-2.0.0/ntfsprogs/ntfsresize.8.in 2008-03-27 14:38:50.000000000 -0400
@@ -116,6 +116,11 @@ is equivalent to
.BR "\-f \-v" .
Long named options can be abbreviated to any unique prefix of their name.
.TP
+\fB\-c\fR, \fB\-\-check\fR
+By using this option ntfsresize will only check the device to ensure that it
+is ready to be resized. If not, it will print any errors detected.
+If the device is fine, nothing will be printed.
+.TP
\fB\-i\fR, \fB\-\-info\fR
By using this option ntfsresize will determine the theoretically smallest
shrunken filesystem size supported. Most of the time the result is the space
diff -up ntfsprogs-2.0.0/ntfsprogs/ntfsresize.c.BAD ntfsprogs-2.0.0/ntfsprogs/ntfsresize.c
--- ntfsprogs-2.0.0/ntfsprogs/ntfsresize.c.BAD 2008-03-27 14:35:44.000000000 -0400
+++ ntfsprogs-2.0.0/ntfsprogs/ntfsresize.c 2008-03-27 14:36:09.000000000 -0400
@@ -135,6 +135,7 @@ static struct {
int infombonly;
int show_progress;
int badsectors;
+ int check;
s64 bytes;
char *volume;
} opt;
@@ -311,6 +312,7 @@ static void usage(void)
printf("\nUsage: %s [OPTIONS] DEVICE\n"
" Resize an NTFS volume non-destructively, safely move any data if needed.\n"
"\n"
+ " -c, --check Check to ensure that the device is ready for resize\n"
" -i, --info Estimate the smallest shrunken size possible\n"
" -m, --info-mb-only Estimate the smallest shrunken size possible, output size in MB only\n"
" -s, --size SIZE Resize volume to SIZE[k|M|G] bytes\n"
@@ -438,9 +440,10 @@ static s64 get_new_volume_size(char *s)
*/
static int parse_options(int argc, char **argv)
{
- static const char *sopt = "-bdfhimnPs:vV";
+ static const char *sopt = "-bcdfhimnPs:vV";
static const struct option lopt[] = {
{ "bad-sectors",no_argument, NULL, 'b' },
+ { "check", no_argument, NULL, 'c' },
#ifdef DEBUG
{ "debug", no_argument, NULL, 'd' },
#endif
@@ -475,6 +478,9 @@ static int parse_options(int argc, char
case 'b':
opt.badsectors++;
break;
+ case 'c':
+ opt.check++;
+ break;
case 'd':
opt.debug++;
break;
@@ -2233,6 +2239,34 @@ static void print_num_of_relocations(ntf
rounded_up_division(relocations, NTFS_MBYTE));
}
+static void check_volume(void)
+{
+ ntfs_volume *vol = NULL;
+
+ /*
+ * Pass NTFS_MNT_FORENSIC so that the mount process does not modify the
+ * volume at all. We will do the logfile emptying and dirty setting
+ * later if needed.
+ */
+ if (!(vol = ntfs_mount(opt.volume, opt.ro_flag | NTFS_MNT_FORENSIC))) {
+ int err = errno;
+
+ perr_printf("Opening '%s' as NTFS failed", opt.volume);
+ if (err == EINVAL)
+ printf(invalid_ntfs_msg, opt.volume);
+ else if (err == EIO)
+ printf("%s", corrupt_volume_msg);
+ else if (err == EPERM)
+ printf("%s", hibernated_volume_msg);
+ else if (err == EOPNOTSUPP)
+ printf("%s", unclean_journal_msg);
+ else if (err == EBUSY)
+ printf("%s", opened_volume_msg);
+ exit(1);
+ }
+}
+
+
/**
* mount_volume
*
@@ -2259,27 +2293,8 @@ static ntfs_volume *mount_volume(void)
err_exit("Device '%s' is mounted. "
"You must 'umount' it first.\n", opt.volume);
}
- /*
- * Pass NTFS_MNT_FORENSIC so that the mount process does not modify the
- * volume at all. We will do the logfile emptying and dirty setting
- * later if needed.
- */
- if (!(vol = ntfs_mount(opt.volume, opt.ro_flag | NTFS_MNT_FORENSIC))) {
- int err = errno;
- perr_printf("Opening '%s' as NTFS failed", opt.volume);
- if (err == EINVAL)
- printf(invalid_ntfs_msg, opt.volume);
- else if (err == EIO)
- printf("%s", corrupt_volume_msg);
- else if (err == EPERM)
- printf("%s", hibernated_volume_msg);
- else if (err == EOPNOTSUPP)
- printf("%s", unclean_journal_msg);
- else if (err == EBUSY)
- printf("%s", opened_volume_msg);
- exit(1);
- }
+ check_volume();
if (NVolWasDirty(vol))
if (opt.force-- <= 0)
@@ -2413,6 +2428,12 @@ int main(int argc, char **argv)
utils_set_locale();
+ /* If we're just checking the device, we'll do it first, and exit out, no matter what we find. */
+ if (opt.check) {
+ check_volume();
+ exit(0);
+ }
+
if (!(vol = mount_volume()))
err_exit("Couldn't open volume '%s'!\n", opt.volume);
Index: ntfsprogs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/ntfsprogs/devel/ntfsprogs.spec,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ntfsprogs.spec 25 Mar 2008 16:40:12 -0000 1.12
+++ ntfsprogs.spec 27 Mar 2008 19:47:13 -0000 1.13
@@ -1,10 +1,11 @@
Name: ntfsprogs
Version: 2.0.0
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: NTFS filesystem libraries and utilities
Source0: http://download.sf.net/linux-ntfs/%{name}-%{version}.tar.bz2
Patch0: ntfsprogs-2.0.0-build-extras-by-default.patch
Patch1: ntfsprogs-2.0.0-mbonly-info.patch
+Patch2: ntfsprogs-2.0.0-check_volume.patch
License: GPLv2+
URL: http://www.linux-ntfs.org/
Group: System Environment/Base
@@ -44,6 +45,7 @@
%setup -q
%patch0 -p1
%patch1 -p1
+%patch2 -p1
%build
# If we need to enable the fuse module, we'd change this.
@@ -114,6 +116,9 @@
%{_libdir}/gnome-vfs-2.0/modules/libntfs-gnomevfs.so
%changelog
+* Thu Mar 27 2008 Tom "spot" Callaway <tcallawa at redhat.com> 2.0.0-6
+- add option to ntfsresize to check the volume to ensure it is ready to be resized
+
* Tue Mar 25 2008 Tom "spot" Callaway <tcallawa at redhat.com> 2.0.0-5
- drop the glibc open patch (bz 438822)
- Previous message (by thread): rpms/e16/F-8 e16.spec,NONE,1.1 .cvsignore,1.1,1.2 sources,1.1,1.2
- Next message (by thread): rpms/systemtap/devel systemtap.spec, 1.38, 1.39 elfutils-configury.patch, 1.1, NONE systemtap-0.6.1-elfi.patch, 1.1, NONE systemtap-0.6.1-gcc43.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list