File indexing completed on 2024-05-05 05:48:47

0001 /*
0002     SPDX-FileCopyrightText: 2008-2010 Volker Lanz <vl@fidra.de>
0003     SPDX-FileCopyrightText: 2012-2016 Andrius Štikonas <andrius@stikonas.eu>
0004     SPDX-FileCopyrightText: 2015 Chris Campbell <c.j.campbell@ed.ac.uk>
0005     SPDX-FileCopyrightText: 2020 Arnaud Ferraris <arnaud.ferraris@collabora.com>
0006     SPDX-FileCopyrightText: 2020 Gaël PORTAY <gael.portay@collabora.com>
0007 
0008     SPDX-License-Identifier: GPL-3.0-or-later
0009 */
0010 
0011 #ifndef KPMCORE_OCFS2_H
0012 #define KPMCORE_OCFS2_H
0013 
0014 #include "util/libpartitionmanagerexport.h"
0015 
0016 #include "fs/filesystem.h"
0017 
0018 #include <QtGlobal>
0019 
0020 class Report;
0021 
0022 class QString;
0023 
0024 namespace FS
0025 {
0026 /** A ocfs2 file system.
0027     @author Volker Lanz <vl@fidra.de>
0028 */
0029 class LIBKPMCORE_EXPORT ocfs2 : public FileSystem
0030 {
0031 public:
0032     ocfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
0033 
0034 public:
0035     void init() override;
0036 
0037     qint64 readUsedCapacity(const QString& deviceNode) const override;
0038     bool check(Report& report, const QString& deviceNode) const override;
0039     bool create(Report& report, const QString& deviceNode) override;
0040     bool resize(Report& report, const QString& deviceNode, qint64 length) const override;
0041     bool writeLabel(Report& report, const QString& deviceNode, const QString& newLabel) override;
0042     bool updateUUID(Report& report, const QString& deviceNode) const override;
0043     QString posixPermissions() const override { return implPosixPermissions();  };
0044     void setPosixPermissions(const QString& permissions) override { implSetPosixPermissions(permissions); };
0045 
0046     CommandSupportType supportGetUsed() const override {
0047         return m_GetUsed;
0048     }
0049     CommandSupportType supportGetLabel() const override {
0050         return m_GetLabel;
0051     }
0052     CommandSupportType supportCreate() const override {
0053         return m_Create;
0054     }
0055     CommandSupportType supportGrow() const override {
0056         return m_Grow;
0057     }
0058     CommandSupportType supportShrink() const override {
0059         return m_Shrink;
0060     }
0061     CommandSupportType supportMove() const override {
0062         return m_Move;
0063     }
0064     CommandSupportType supportCheck() const override {
0065         return m_Check;
0066     }
0067     CommandSupportType supportCopy() const override {
0068         return m_Copy;
0069     }
0070     CommandSupportType supportBackup() const override {
0071         return m_Backup;
0072     }
0073     CommandSupportType supportSetLabel() const override {
0074         return m_SetLabel;
0075     }
0076     CommandSupportType supportUpdateUUID() const override {
0077         return m_UpdateUUID;
0078     }
0079     CommandSupportType supportGetUUID() const override {
0080         return m_GetUUID;
0081     }
0082 
0083     qint64 minCapacity() const override;
0084     qint64 maxCapacity() 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