Skip to contentSkip to conversation

fsfreeze: remove unnecessary functions

PATCH In review Sami Kerola 2 participants 3 messages Dec 18, 2016 – Dec 22, 2016 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 fsfreeze: remove unnecessary functions

---
 sys-utils/fsfreeze.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
sys-utils/fsfreeze.c +2 -12
index d4d5bd3df..a9b32aa66 100644
@@ -33,16 +33,6 @@ enum fs_operation {
 	UNFREEZE
 };
 
-static int freeze_f(int fd)
-{
-	return ioctl(fd, FIFREEZE, 0);
-}
-
-static int unfreeze_f(int fd)
-{
-	return ioctl(fd, FITHAW, 0);
-}
-
 static void __attribute__((__noreturn__)) usage(FILE *out)
 {
 	fprintf(out, USAGE_HEADER);
@@ -139,13 +129,13 @@ int main(int argc, char **argv)
 
 	switch (action) {
 	case FREEZE:
-		if (freeze_f(fd)) {
+		if (ioctl(fd, FIFREEZE, 0)) {
 			warn(_("%s: freeze failed"), path);
 			goto done;
 		}
 		break;
 	case UNFREEZE:
-		if (unfreeze_f(fd)) {
+		if (ioctl(fd, FITHAW, 0)) {
 			warn(_("%s: unfreeze failed"), path);
 			goto done;
 		}
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/2 fsfreeze: move filesystem support info to manual page

Include btrfs, f2fs, and nilfs to list of supported filesystems, with note the list can be incomplete.

---
 sys-utils/fsfreeze.8 | 14 ++++++++++++++
 sys-utils/fsfreeze.c |  2 +-
 2 files changed, 15 insertions(+), 1 deletion(-)
sys-utils/fsfreeze.8 +14 -0
index c5bac7334..c5d812dff 100644
@@ -61,6 +61,20 @@ Display version information and exit.
 .TP
 .BR \-h , " \-\-help"
 Display help text and exit.
+.SH FILESYSTEM SUPPORT
+This command will work only if filesystem supports has support for freezing.
+List of these filesystems include (2016-12-18)
+.BR btrfs ,
+.BR ext2/3/4 ,
+.BR f2fs ,
+.BR jfs ,
+.BR nilfs2 ,
+.BR reiserfs ,
+and
+.BR xfs .
+Previous list may be incomplete, as more filesystems get support.  If in
+doubt easiest way to know if a filesystem has support is create a small
+loopback mount and test freezing it.
 .SH AUTHOR
 .PP
 Written by Hajime Taira.
sys-utils/fsfreeze.c +1 -1
index a9b32aa66..41a33659e 100644
@@ -40,7 +40,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
 	      _(" %s [options] <mountpoint>\n"), program_invocation_short_name);
 
 	fputs(USAGE_SEPARATOR, out);
-	fputs(_("Suspend access to a filesystem (ext3/4, ReiserFS, JFS, XFS).\n"), out);
+	fputs(_("Suspend access to a filesystem.\n"), out);
 
 	fputs(USAGE_OPTIONS, out);
 	fputs(_(" -f, --freeze      freeze the filesystem\n"), out);
Signature · 1 line
2.11.0
maintainer
#2 lore raw
In reply to Sami Kerola

sys-utils/fsfreeze.c

Quoted 4 lines · Sami Kerola
sys-utils/fsfreeze.c +0 -0
index d4d5bd3df..a9b32aa66 100644

All applied. Thanks.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com