aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorTakashi Sato <t-sato@yk.jp.nec.com>2009-01-09 19:40:58 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-09 19:54:42 -0500
commitc4be0c1dc4cdc37b175579be1460f15ac6495e9a (patch)
tree716ea88318211ed27cadcebda0fd85c1f8246edb /Documentation
parent69347a236b22c3962ea812511495e502dedfd50c (diff)
filesystem freeze: add error handling of write_super_lockfs/unlockfs
Currently, ext3 in mainline Linux doesn't have the freeze feature which suspends write requests. So, we cannot take a backup which keeps the filesystem's consistency with the storage device's features (snapshot and replication) while it is mounted. In many case, a commercial filesystem (e.g. VxFS) has the freeze feature and it would be used to get the consistent backup. If Linux's standard filesystem ext3 has the freeze feature, we can do it without a commercial filesystem. So I have implemented the ioctls of the freeze feature. I think we can take the consistent backup with the following steps. 1. Freeze the filesystem with the freeze ioctl. 2. Separate the replication volume or create the snapshot with the storage device's feature. 3. Unfreeze the filesystem with the unfreeze ioctl. 4. Take the backup from the separated replication volume or the snapshot. This patch: VFS: Changed the type of write_super_lockfs and unlockfs from "void" to "int" so that they can return an error. Rename write_super_lockfs and unlockfs of the super block operation freeze_fs and unfreeze_fs to avoid a confusion. ext3, ext4, xfs, gfs2, jfs: Changed the type of write_super_lockfs and unlockfs from "void" to "int" so that write_super_lockfs returns an error if needed, and unlockfs always returns 0. reiserfs: Changed the type of write_super_lockfs and unlockfs from "void" to "int" so that they always return 0 (success) to keep a current behavior. 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 'Documentation')
-rw-r--r--Documentation/filesystems/Locking8
-rw-r--r--Documentation/filesystems/vfs.txt8
2 files changed, 8 insertions, 8 deletions
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index cfbfa15a46ba..ec6a9392a173 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -97,8 +97,8 @@ prototypes:
97 void (*put_super) (struct super_block *); 97 void (*put_super) (struct super_block *);
98 void (*write_super) (struct super_block *); 98 void (*write_super) (struct super_block *);
99 int (*sync_fs)(struct super_block *sb, int wait); 99 int (*sync_fs)(struct super_block *sb, int wait);
100 void (*write_super_lockfs) (struct super_block *); 100 int (*freeze_fs) (struct super_block *);
101 void (*unlockfs) (struct super_block *); 101 int (*unfreeze_fs) (struct super_block *);
102 int (*statfs) (struct dentry *, struct kstatfs *); 102 int (*statfs) (struct dentry *, struct kstatfs *);
103 int (*remount_fs) (struct super_block *, int *, char *); 103 int (*remount_fs) (struct super_block *, int *, char *);
104 void (*clear_inode) (struct inode *); 104 void (*clear_inode) (struct inode *);
@@ -119,8 +119,8 @@ delete_inode: no
119put_super: yes yes no 119put_super: yes yes no
120write_super: no yes read 120write_super: no yes read
121sync_fs: no no read 121sync_fs: no no read
122write_super_lockfs: ? 122freeze_fs: ?
123unlockfs: ? 123unfreeze_fs: ?
124statfs: no no no 124statfs: no no no
125remount_fs: yes yes maybe (see below) 125remount_fs: yes yes maybe (see below)
126clear_inode: no 126clear_inode: no
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index ef19afa186a9..deeeed0faa8f 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -210,8 +210,8 @@ struct super_operations {
210 void (*put_super) (struct super_block *); 210 void (*put_super) (struct super_block *);
211 void (*write_super) (struct super_block *); 211 void (*write_super) (struct super_block *);
212 int (*sync_fs)(struct super_block *sb, int wait); 212 int (*sync_fs)(struct super_block *sb, int wait);
213 void (*write_super_lockfs) (struct super_block *); 213 int (*freeze_fs) (struct super_block *);
214 void (*unlockfs) (struct super_block *); 214 int (*unfreeze_fs) (struct super_block *);
215 int (*statfs) (struct dentry *, struct kstatfs *); 215 int (*statfs) (struct dentry *, struct kstatfs *);
216 int (*remount_fs) (struct super_block *, int *, char *); 216 int (*remount_fs) (struct super_block *, int *, char *);
217 void (*clear_inode) (struct inode *); 217 void (*clear_inode) (struct inode *);
@@ -270,11 +270,11 @@ or bottom half).
270 a superblock. The second parameter indicates whether the method 270 a superblock. The second parameter indicates whether the method
271 should wait until the write out has been completed. Optional. 271 should wait until the write out has been completed. Optional.
272 272
273 write_super_lockfs: called when VFS is locking a filesystem and 273 freeze_fs: called when VFS is locking a filesystem and
274 forcing it into a consistent state. This method is currently 274 forcing it into a consistent state. This method is currently
275 used by the Logical Volume Manager (LVM). 275 used by the Logical Volume Manager (LVM).
276 276
277 unlockfs: called when VFS is unlocking a filesystem and making it writable 277 unfreeze_fs: called when VFS is unlocking a filesystem and making it writable
278 again. 278 again.
279 279
280 statfs: called when the VFS needs to get filesystem statistics. This 280 statfs: called when the VFS needs to get filesystem statistics. This