cifs: release leases for deferred close handles when freezing
[sfrench/cifs-2.6.git] / fs / cifs / cifsfs.c
index 994da4ac0b10e114b8f538e9b8835229b32d6110..d1181d26b437288682f41f9f16214180fc224dc5 100644 (file)
@@ -756,6 +756,20 @@ static void cifs_umount_begin(struct super_block *sb)
        return;
 }
 
+static int cifs_freeze(struct super_block *sb)
+{
+       struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
+       struct cifs_tcon *tcon;
+
+       if (cifs_sb == NULL)
+               return 0;
+
+       tcon = cifs_sb_master_tcon(cifs_sb);
+
+       cifs_close_all_deferred_files(tcon);
+       return 0;
+}
+
 #ifdef CONFIG_CIFS_STATS2
 static int cifs_show_stats(struct seq_file *s, struct dentry *root)
 {
@@ -787,6 +801,7 @@ static const struct super_operations cifs_super_ops = {
        as opens */
        .show_options = cifs_show_options,
        .umount_begin   = cifs_umount_begin,
+       .freeze_fs      = cifs_freeze,
 #ifdef CONFIG_CIFS_STATS2
        .show_stats = cifs_show_stats,
 #endif