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

0001 /*
0002     SPDX-FileCopyrightText: 2012-2017 Andrius Štikonas <andrius@stikonas.eu>
0003     SPDX-FileCopyrightText: 2015 Chris Campbell <c.j.campbell@ed.ac.uk>
0004     SPDX-FileCopyrightText: 2020 Arnaud Ferraris <arnaud.ferraris@collabora.com>
0005     SPDX-FileCopyrightText: 2020 Gaël PORTAY <gael.portay@collabora.com>
0006 
0007     SPDX-License-Identifier: GPL-3.0-or-later
0008 */
0009 
0010 #ifndef KPMCORE_NILFS2_H
0011 #define KPMCORE_NILFS2_H
0012 
0013 #include "util/libpartitionmanagerexport.h"
0014 
0015 #include "fs/filesystem.h"
0016 
0017 #include <QtGlobal>
0018 
0019 class Report;
0020 
0021 class QString;
0022 
0023 namespace FS
0024 {
0025 /** A nilfs2 file system.
0026     @author Andrius Štikonas <andrius@stikonas.eu>
0027 */
0028 class LIBKPMCORE_EXPORT nilfs2 : public FileSystem
0029 {
0030 public:
0031     nilfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
0032 
0033 public:
0034     void init() override;
0035 
0036 //          qint64 readUsedCapacity(const QString& deviceNode) const override;
0037     bool check(Report& report, const QString& deviceNode) const override;
0038     bool create(Report& report, const QString& deviceNode) override;
0039     qint64 readUsedCapacity(const QString& deviceNode) const override;
0040     bool resize(Report& report, const QString& deviceNode, qint64 length) const override;
0041     bool resizeOnline(Report& report, const QString& deviceNode, const QString& mountPoint, qint64 length) const override;
0042     bool writeLabel(Report& report, const QString& deviceNode, const QString& newLabel) override;
0043     bool updateUUID(Report& report, const QString& deviceNode) const override;
0044     QString posixPermissions() const override { return implPosixPermissions();  };
0045     void setPosixPermissions(const QString& permissions) override { implSetPosixPermissions(permissions); };
0046 
0047     CommandSupportType supportGetUsed() const override {
0048         return m_GetUsed;
0049     }
0050     CommandSupportType supportGetLabel() const override {
0051         return m_GetLabel;
0052     }
0053     CommandSupportType supportCreate() const override {
0054         return m_Create;
0055     }
0056     CommandSupportType supportGrow() const override {
0057         return m_Grow;
0058     }
0059     CommandSupportType supportGrowOnline() const override {
0060         return m_Grow;
0061     }
0062     CommandSupportType supportShrink() const override {
0063         return m_Shrink;
0064     }
0065     CommandSupportType supportShrinkOnline() 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