LCOV - code coverage report
Current view: top level - fs/btrfs - fs.c (source / functions) Hit Total Coverage
Test: fstests of 6.5.0-rc3-acha @ Mon Jul 31 20:08:06 PDT 2023 Lines: 0 60 0.0 %
Date: 2023-07-31 20:08:07 Functions: 0 4 0.0 %

          Line data    Source code
       1             : // SPDX-License-Identifier: GPL-2.0
       2             : 
       3             : #include "messages.h"
       4             : #include "ctree.h"
       5             : #include "fs.h"
       6             : #include "accessors.h"
       7             : 
       8           0 : void __btrfs_set_fs_incompat(struct btrfs_fs_info *fs_info, u64 flag,
       9             :                              const char *name)
      10             : {
      11           0 :         struct btrfs_super_block *disk_super;
      12           0 :         u64 features;
      13             : 
      14           0 :         disk_super = fs_info->super_copy;
      15           0 :         features = btrfs_super_incompat_flags(disk_super);
      16           0 :         if (!(features & flag)) {
      17           0 :                 spin_lock(&fs_info->super_lock);
      18           0 :                 features = btrfs_super_incompat_flags(disk_super);
      19           0 :                 if (!(features & flag)) {
      20           0 :                         features |= flag;
      21           0 :                         btrfs_set_super_incompat_flags(disk_super, features);
      22           0 :                         btrfs_info(fs_info,
      23             :                                 "setting incompat feature flag for %s (0x%llx)",
      24             :                                 name, flag);
      25             :                 }
      26           0 :                 spin_unlock(&fs_info->super_lock);
      27           0 :                 set_bit(BTRFS_FS_FEATURE_CHANGED, &fs_info->flags);
      28             :         }
      29           0 : }
      30             : 
      31           0 : void __btrfs_clear_fs_incompat(struct btrfs_fs_info *fs_info, u64 flag,
      32             :                                const char *name)
      33             : {
      34           0 :         struct btrfs_super_block *disk_super;
      35           0 :         u64 features;
      36             : 
      37           0 :         disk_super = fs_info->super_copy;
      38           0 :         features = btrfs_super_incompat_flags(disk_super);
      39           0 :         if (features & flag) {
      40           0 :                 spin_lock(&fs_info->super_lock);
      41           0 :                 features = btrfs_super_incompat_flags(disk_super);
      42           0 :                 if (features & flag) {
      43           0 :                         features &= ~flag;
      44           0 :                         btrfs_set_super_incompat_flags(disk_super, features);
      45           0 :                         btrfs_info(fs_info,
      46             :                                 "clearing incompat feature flag for %s (0x%llx)",
      47             :                                 name, flag);
      48             :                 }
      49           0 :                 spin_unlock(&fs_info->super_lock);
      50           0 :                 set_bit(BTRFS_FS_FEATURE_CHANGED, &fs_info->flags);
      51             :         }
      52           0 : }
      53             : 
      54           0 : void __btrfs_set_fs_compat_ro(struct btrfs_fs_info *fs_info, u64 flag,
      55             :                               const char *name)
      56             : {
      57           0 :         struct btrfs_super_block *disk_super;
      58           0 :         u64 features;
      59             : 
      60           0 :         disk_super = fs_info->super_copy;
      61           0 :         features = btrfs_super_compat_ro_flags(disk_super);
      62           0 :         if (!(features & flag)) {
      63           0 :                 spin_lock(&fs_info->super_lock);
      64           0 :                 features = btrfs_super_compat_ro_flags(disk_super);
      65           0 :                 if (!(features & flag)) {
      66           0 :                         features |= flag;
      67           0 :                         btrfs_set_super_compat_ro_flags(disk_super, features);
      68           0 :                         btrfs_info(fs_info,
      69             :                                 "setting compat-ro feature flag for %s (0x%llx)",
      70             :                                 name, flag);
      71             :                 }
      72           0 :                 spin_unlock(&fs_info->super_lock);
      73           0 :                 set_bit(BTRFS_FS_FEATURE_CHANGED, &fs_info->flags);
      74             :         }
      75           0 : }
      76             : 
      77           0 : void __btrfs_clear_fs_compat_ro(struct btrfs_fs_info *fs_info, u64 flag,
      78             :                                 const char *name)
      79             : {
      80           0 :         struct btrfs_super_block *disk_super;
      81           0 :         u64 features;
      82             : 
      83           0 :         disk_super = fs_info->super_copy;
      84           0 :         features = btrfs_super_compat_ro_flags(disk_super);
      85           0 :         if (features & flag) {
      86           0 :                 spin_lock(&fs_info->super_lock);
      87           0 :                 features = btrfs_super_compat_ro_flags(disk_super);
      88           0 :                 if (features & flag) {
      89           0 :                         features &= ~flag;
      90           0 :                         btrfs_set_super_compat_ro_flags(disk_super, features);
      91           0 :                         btrfs_info(fs_info,
      92             :                                 "clearing compat-ro feature flag for %s (0x%llx)",
      93             :                                 name, flag);
      94             :                 }
      95           0 :                 spin_unlock(&fs_info->super_lock);
      96           0 :                 set_bit(BTRFS_FS_FEATURE_CHANGED, &fs_info->flags);
      97             :         }
      98           0 : }

Generated by: LCOV version 1.14