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