]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/gfs2/ops_super.c
filesystem freeze: add error handling of write_super_lockfs/unlockfs
[linux-2.6-omap-h63xx.git] / fs / gfs2 / ops_super.c
index 777783deddcb8aba814988212d34d4996dfec7e6..320323d0347933bd45d644a153a0435cdf96daf7 100644 (file)
@@ -211,18 +211,18 @@ static int gfs2_sync_fs(struct super_block *sb, int wait)
 }
 
 /**
- * gfs2_write_super_lockfs - prevent further writes to the filesystem
+ * gfs2_freeze - prevent further writes to the filesystem
  * @sb: the VFS structure for the filesystem
  *
  */
 
-static void gfs2_write_super_lockfs(struct super_block *sb)
+static int gfs2_freeze(struct super_block *sb)
 {
        struct gfs2_sbd *sdp = sb->s_fs_info;
        int error;
 
        if (test_bit(SDF_SHUTDOWN, &sdp->sd_flags))
-               return;
+               return -EINVAL;
 
        for (;;) {
                error = gfs2_freeze_fs(sdp);
@@ -242,17 +242,19 @@ static void gfs2_write_super_lockfs(struct super_block *sb)
                fs_err(sdp, "retrying...\n");
                msleep(1000);
        }
+       return 0;
 }
 
 /**
- * gfs2_unlockfs - reallow writes to the filesystem
+ * gfs2_unfreeze - reallow writes to the filesystem
  * @sb: the VFS structure for the filesystem
  *
  */
 
-static void gfs2_unlockfs(struct super_block *sb)
+static int gfs2_unfreeze(struct super_block *sb)
 {
        gfs2_unfreeze_fs(sb->s_fs_info);
+       return 0;
 }
 
 /**
@@ -688,8 +690,8 @@ const struct super_operations gfs2_super_ops = {
        .put_super              = gfs2_put_super,
        .write_super            = gfs2_write_super,
        .sync_fs                = gfs2_sync_fs,
-       .write_super_lockfs     = gfs2_write_super_lockfs,
-       .unlockfs               = gfs2_unlockfs,
+       .freeze_fs              = gfs2_freeze,
+       .unfreeze_fs            = gfs2_unfreeze,
        .statfs                 = gfs2_statfs,
        .remount_fs             = gfs2_remount_fs,
        .clear_inode            = gfs2_clear_inode,