fs: add freeze_super/thaw_super fs hooks
[firefly-linux-kernel-4.4.55.git] / fs / ioctl.c
index 8ac3fad36192fb153b93e1be8c5d0e0ee110b463..77c9a7812542e0f7e4abe4cb013f22241988f238 100644 (file)
@@ -518,10 +518,12 @@ static int ioctl_fsfreeze(struct file *filp)
                return -EPERM;
 
        /* If filesystem doesn't support freeze feature, return. */
-       if (sb->s_op->freeze_fs == NULL)
+       if (sb->s_op->freeze_fs == NULL && sb->s_op->freeze_super == NULL)
                return -EOPNOTSUPP;
 
        /* Freeze */
+       if (sb->s_op->freeze_super)
+               return sb->s_op->freeze_super(sb);
        return freeze_super(sb);
 }
 
@@ -533,6 +535,8 @@ static int ioctl_fsthaw(struct file *filp)
                return -EPERM;
 
        /* Thaw */
+       if (sb->s_op->thaw_super)
+               return sb->s_op->thaw_super(sb);
        return thaw_super(sb);
 }