Add createWithLabel support for F2FS.

This commit is contained in:
Andrius Štikonas 2017-08-18 15:05:39 +03:00
parent 6a78a74515
commit fd68f9334c
2 changed files with 10 additions and 0 deletions

View File

@ -119,4 +119,10 @@ bool f2fs::create(Report& report, const QString& deviceNode)
return cmd.run(-1) && cmd.exitCode() == 0;
}
bool f2fs::createWithLabel(Report& report, const QString& deviceNode, const QString& label)
{
ExternalCommand cmd(report, QStringLiteral("mkfs.f2fs"), { QStringLiteral("-l"), label, deviceNode });
return cmd.run(-1) && cmd.exitCode() == 0;
}
}

View File

@ -45,6 +45,7 @@ public:
// qint64 readUsedCapacity(const QString& deviceNode) const override;
bool check(Report& report, const QString& deviceNode) const override;
bool create(Report& report, const QString& deviceNode) override;
bool createWithLabel(Report& report, const QString& deviceNode, const QString& label) override;
// qint64 readUsedCapacity(const QString& deviceNode) const override;
// bool resize(Report& report, const QString& deviceNode, qint64 length) const override;
// bool writeLabel(Report& report, const QString& deviceNode, const QString& newLabel) override;
@ -59,6 +60,9 @@ public:
CommandSupportType supportCreate() const override {
return m_Create;
}
CommandSupportType supportCreateWithLabel() const override {
return m_Create;
}
CommandSupportType supportGrow() const override {
return m_Grow;
}