Skip to content

Commit

Permalink
Kernel/Ext2: Allow checking for the presence of extended attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
implicitfield authored and alimpfard committed Jan 5, 2024
1 parent bef9699 commit 280d5fe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Kernel/FileSystem/Ext2FS/FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ u8 Ext2FS::internal_file_type_to_directory_entry_type(DirectoryEntryView const&
}
}

Ext2FS::FeaturesOptional Ext2FS::get_features_optional() const
{
if (m_super_block.s_rev_level > 0)
return static_cast<Ext2FS::FeaturesOptional>(m_super_block.s_feature_compat);
return Ext2FS::FeaturesOptional::None;
}

Ext2FS::FeaturesReadOnly Ext2FS::get_features_readonly() const
{
if (m_super_block.s_rev_level > 0)
Expand Down
8 changes: 8 additions & 0 deletions Kernel/FileSystem/Ext2FS/FileSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ class Ext2FS final : public BlockBasedFileSystem {
friend class Ext2FSInode;

public:
// s_feature_compat
enum class FeaturesOptional : u32 {
None = 0,
ExtendedAttributes = EXT2_FEATURE_COMPAT_EXT_ATTR,
};
AK_ENUM_BITWISE_FRIEND_OPERATORS(FeaturesOptional);

// s_feature_ro_compat
enum class FeaturesReadOnly : u32 {
None = 0,
Expand All @@ -43,6 +50,7 @@ class Ext2FS final : public BlockBasedFileSystem {

virtual u8 internal_file_type_to_directory_entry_type(DirectoryEntryView const& entry) const override;

FeaturesOptional get_features_optional() const;
FeaturesReadOnly get_features_readonly() const;

virtual StringView class_name() const override { return "Ext2FS"sv; }
Expand Down

0 comments on commit 280d5fe

Please sign in to comment.