]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - io/freeze.c
2 * Copyright (c) 2001-2005 Silicon Graphics, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #include <xfs/command.h>
21 #include <xfs/input.h>
25 static cmdinfo_t freeze_cmd
;
26 static cmdinfo_t thaw_cmd
;
35 if (xfsctl(file
->name
, file
->fd
, XFS_IOC_FREEZE
, &level
) < 0) {
37 _("%s: cannot freeze filesystem at %s: %s\n"),
38 progname
, file
->name
, strerror(errno
));
52 if (xfsctl(file
->name
, file
->fd
, XFS_IOC_THAW
, &level
) < 0) {
54 _("%s: cannot unfreeze filesystem mounted at %s: %s\n"),
55 progname
, file
->name
, strerror(errno
));
65 freeze_cmd
.name
= _("freeze");
66 freeze_cmd
.cfunc
= freeze_f
;
67 freeze_cmd
.argmin
= 0;
68 freeze_cmd
.argmax
= 0;
69 freeze_cmd
.flags
= CMD_NOMAP_OK
| CMD_FOREIGN_OK
;
70 freeze_cmd
.oneline
= _("freeze filesystem of current file");
72 thaw_cmd
.name
= _("thaw");
73 thaw_cmd
.cfunc
= thaw_f
;
76 thaw_cmd
.flags
= CMD_NOMAP_OK
| CMD_FOREIGN_OK
;
77 thaw_cmd
.oneline
= _("unfreeze filesystem of current file");
80 add_command(&freeze_cmd
);
81 add_command(&thaw_cmd
);