]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - io/freeze.c
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2001-2005 Silicon Graphics, Inc.
12 static cmdinfo_t freeze_cmd
;
13 static cmdinfo_t thaw_cmd
;
22 if (xfsctl(file
->name
, file
->fd
, XFS_IOC_FREEZE
, &level
) < 0) {
24 _("%s: cannot freeze filesystem at %s: %s\n"),
25 progname
, file
->name
, strerror(errno
));
39 if (xfsctl(file
->name
, file
->fd
, XFS_IOC_THAW
, &level
) < 0) {
41 _("%s: cannot unfreeze filesystem mounted at %s: %s\n"),
42 progname
, file
->name
, strerror(errno
));
52 freeze_cmd
.name
= "freeze";
53 freeze_cmd
.cfunc
= freeze_f
;
54 freeze_cmd
.argmin
= 0;
55 freeze_cmd
.argmax
= 0;
56 freeze_cmd
.flags
= CMD_NOMAP_OK
| CMD_FOREIGN_OK
| CMD_FLAG_ONESHOT
;
57 freeze_cmd
.oneline
= _("freeze filesystem of current file");
59 thaw_cmd
.name
= "thaw";
60 thaw_cmd
.cfunc
= thaw_f
;
63 thaw_cmd
.flags
= CMD_NOMAP_OK
| CMD_FOREIGN_OK
| CMD_FLAG_ONESHOT
;
64 thaw_cmd
.oneline
= _("unfreeze filesystem of current file");
67 add_command(&freeze_cmd
);
68 add_command(&thaw_cmd
);