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

0001 /*
0002     SPDX-FileCopyrightText: 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: 2019 Yuri Chornoivan <yurchor@ukr.net>
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_ZFS_H
0013 #define KPMCORE_ZFS_H
0014 
0015 #include "util/libpartitionmanagerexport.h"
0016 
0017 #include "fs/filesystem.h"
0018 
0019 #include <QtGlobal>
0020 
0021 class Report;
0022 
0023 class QString;
0024 
0025 namespace FS
0026 {
0027 /** A zfs file system.
0028     @author Andrius Štikonas <andrius@stikonas.eu>
0029 */
0030 class LIBKPMCORE_EXPORT zfs : public FileSystem
0031 {
0032 public:
0033     zfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
0034 
0035 public:
0036     void init() override;
0037 
0038     bool writeLabel(Report& report, const QString& deviceNode, const QString& newLabel) override;
0039     QString posixPermissions() const override { return implPosixPermissions();  };
0040     void setPosixPermissions(const QString& permissions) override { implSetPosixPermissions(permissions); };
0041 
0042     CommandSupportType supportGetUsed() const override {
0043         return m_GetUsed;
0044     }
0045     CommandSupportType supportGetLabel() const override {
0046         return m_GetLabel;
0047     }
0048     CommandSupportType supportCreate() const override {
0049         return m_Create;
0050     }
0051     CommandSupportType supportGrow() const override {
0052         return m_Grow;
0053     }
0054     CommandSupportType supportShrink() const override {
0055         return m_Shrink;
0056     }
0057     CommandSupportType supportMove() const override {
0058         return m_Move;
0059     }
0060     CommandSupportType supportCheck() const override {
0061         return m_Check;
0062     }
0063     CommandSupportType supportCopy() const override {
0064         return m_Copy;
0065     }
0066     CommandSupportType supportBackup() const override {
0067         return m_Backup;
0068     }
0069     CommandSupportType supportSetLabel() const override {
0070         return m_SetLabel;
0071     }
0072     CommandSupportType supportUpdateUUID() const override {
0073         return m_UpdateUUID;
0074     }
0075     CommandSupportType supportGetUUID() const override {
0076         return m_GetUUID;
0077     }
0078 
0079     qint64 minCapacity() const override;
0080     qint64 maxCapacity() const override;
0081     SupportTool supportToolName() const override;
0082     bool supportToolFound() const override;
0083 
0084 public:
0085     static CommandSupportType m_GetUsed;
0086     static CommandSupportType m_GetLabel;
0087     static CommandSupportType m_Create;
0088     static CommandSupportType m_Grow;
0089     static CommandSupportType m_Shrink;
0090     static CommandSupportType m_Move;
0091     static CommandSupportType m_Check;
0092     static CommandSupportType m_Copy;
0093     static CommandSupportType m_Backup;
0094     static CommandSupportType m_SetLabel;
0095     static CommandSupportType m_UpdateUUID;
0096     static CommandSupportType m_GetUUID;
0097 };
0098 }
0099 
0100 #endif