diff options
author | Takashi Sato <t-sato@yk.jp.nec.com> | 2009-01-09 19:40:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-09 19:54:42 -0500 |
commit | fcccf502540e3d752d33b2d8e976034dee81f9f7 (patch) | |
tree | 401be4ad2fc3c535a2fc77e413b1be4a736f320c /include/linux/fs.h | |
parent | c4be0c1dc4cdc37b175579be1460f15ac6495e9a (diff) |
filesystem freeze: implement generic freeze feature
The ioctls for the generic freeze feature are below.
o Freeze the filesystem
int ioctl(int fd, int FIFREEZE, arg)
fd: The file descriptor of the mountpoint
FIFREEZE: request code for the freeze
arg: Ignored
Return value: 0 if the operation succeeds. Otherwise, -1
o Unfreeze the filesystem
int ioctl(int fd, int FITHAW, arg)
fd: The file descriptor of the mountpoint
FITHAW: request code for unfreeze
arg: Ignored
Return value: 0 if the operation succeeds. Otherwise, -1
Error number: If the filesystem has already been unfrozen,
errno is set to EINVAL.
[akpm@linux-foundation.org: fix CONFIG_BLOCK=n]
Signed-off-by: Takashi Sato <t-sato@yk.jp.nec.com>
Signed-off-by: Masayuki Hamaguchi <m-hamaguchi@ys.jp.nec.com>
Cc: <xfs-masters@oss.sgi.com>
Cc: <linux-ext4@vger.kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Dave Kleikamp <shaggy@austin.ibm.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Alasdair G Kergon <agk@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 3e59182de9df..6022f44043f2 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -234,6 +234,8 @@ struct inodes_stat_t { | |||
234 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ | 234 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ |
235 | #define FIBMAP _IO(0x00,1) /* bmap access */ | 235 | #define FIBMAP _IO(0x00,1) /* bmap access */ |
236 | #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ | 236 | #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ |
237 | #define FIFREEZE _IOWR('X', 119, int) /* Freeze */ | ||
238 | #define FITHAW _IOWR('X', 120, int) /* Thaw */ | ||
237 | 239 | ||
238 | #define FS_IOC_GETFLAGS _IOR('f', 1, long) | 240 | #define FS_IOC_GETFLAGS _IOR('f', 1, long) |
239 | #define FS_IOC_SETFLAGS _IOW('f', 2, long) | 241 | #define FS_IOC_SETFLAGS _IOW('f', 2, long) |
@@ -591,6 +593,11 @@ struct block_device { | |||
591 | * care to not mess up bd_private for that case. | 593 | * care to not mess up bd_private for that case. |
592 | */ | 594 | */ |
593 | unsigned long bd_private; | 595 | unsigned long bd_private; |
596 | |||
597 | /* The counter of freeze processes */ | ||
598 | int bd_fsfreeze_count; | ||
599 | /* Mutex for freeze */ | ||
600 | struct mutex bd_fsfreeze_mutex; | ||
594 | }; | 601 | }; |
595 | 602 | ||
596 | /* | 603 | /* |