File indexing completed on 2024-05-05 05:48:43
0001 /* 0002 SPDX-FileCopyrightText: 2016-2018 Andrius Štikonas <andrius@stikonas.eu> 0003 SPDX-FileCopyrightText: 2020 Arnaud Ferraris <arnaud.ferraris@collabora.com> 0004 SPDX-FileCopyrightText: 2020 Gaël PORTAY <gael.portay@collabora.com> 0005 0006 SPDX-License-Identifier: GPL-3.0-or-later 0007 */ 0008 0009 #ifndef KPMCORE_F2FS_H 0010 #define KPMCORE_F2FS_H 0011 0012 #include "util/libpartitionmanagerexport.h" 0013 0014 #include "fs/filesystem.h" 0015 0016 #include <QtGlobal> 0017 0018 class Report; 0019 0020 class QString; 0021 0022 namespace FS 0023 { 0024 /** A f2fs file system. 0025 @author Andrius Štikonas <andrius@stikonas.eu> 0026 */ 0027 class LIBKPMCORE_EXPORT f2fs : public FileSystem 0028 { 0029 public: 0030 f2fs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {}); 0031 0032 public: 0033 void init() override; 0034 0035 // qint64 readUsedCapacity(const QString& deviceNode) const override; 0036 bool check(Report& report, const QString& deviceNode) const override; 0037 bool create(Report& report, const QString& deviceNode) override; 0038 // qint64 readUsedCapacity(const QString& deviceNode) const override; 0039 bool resize(Report& report, const QString& deviceNode, qint64 length) const override; 0040 bool writeLabel(Report& report, const QString& deviceNode, const QString& newLabel) override; 0041 // bool updateUUID(Report& report, const QString& deviceNode) const override; 0042 QString posixPermissions() const override { return implPosixPermissions(); }; 0043 void setPosixPermissions(const QString& permissions) override { implSetPosixPermissions(permissions); }; 0044 0045 CommandSupportType supportGetUsed() const override { 0046 return m_GetUsed; 0047 } 0048 CommandSupportType supportGetLabel() const override { 0049 return m_GetLabel; 0050 } 0051 CommandSupportType supportCreate() const override { 0052 return m_Create; 0053 } 0054 CommandSupportType supportGrow() const override { 0055 return m_Grow; 0056 } 0057 CommandSupportType supportShrink() const override { 0058 return m_Shrink; 0059 } 0060 CommandSupportType supportMove() const override { 0061 return m_Move; 0062 } 0063 CommandSupportType supportCheck() const override { 0064 return m_Check; 0065 } 0066 CommandSupportType supportCopy() const override { 0067 return m_Copy; 0068 } 0069 CommandSupportType supportBackup() const override { 0070 return m_Backup; 0071 } 0072 CommandSupportType supportSetLabel() const override { 0073 return m_SetLabel; 0074 } 0075 CommandSupportType supportUpdateUUID() const override { 0076 return m_UpdateUUID; 0077 } 0078 CommandSupportType supportGetUUID() const override { 0079 return m_GetUUID; 0080 } 0081 0082 qint64 minCapacity() const override; 0083 qint64 maxCapacity() const override; 0084 int maxLabelLength() const override; 0085 SupportTool supportToolName() const override; 0086 bool supportToolFound() const override; 0087 0088 public: 0089 static CommandSupportType m_GetUsed; 0090 static CommandSupportType m_GetLabel; 0091 static CommandSupportType m_Create; 0092 static CommandSupportType m_Grow; 0093 static CommandSupportType m_Shrink; 0094 static CommandSupportType m_Move; 0095 static CommandSupportType m_Check; 0096 static CommandSupportType m_Copy; 0097 static CommandSupportType m_Backup; 0098 static CommandSupportType m_SetLabel; 0099 static CommandSupportType m_UpdateUUID; 0100 static CommandSupportType m_GetUUID; 0101 }; 0102 } 0103 0104 #endif