Add basic support for F2FS.

This commit is contained in:
Andrius Štikonas 2016-02-25 23:29:33 +00:00
parent d9f87b1031
commit dc75c7a11f
17 changed files with 51 additions and 31 deletions

View File

@ -23,10 +23,10 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
set(QT_MIN_VERSION "5.3.0")
set(VERSION_MAJOR "2")
set(VERSION_MINOR "0")
set(VERSION_RELEASE "2")
set(VERSION_RELEASE "50")
set(VERSION_SUFFIX "")
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE}${VERSION_SUFFIX})
set(SOVERSION "1")
set(SOVERSION "2")
add_definitions(-D'VERSION="${VERSION}"') #"
find_package(ECM 1.0.0 REQUIRED NO_MODULE)

View File

@ -1,31 +1,32 @@
set(FS_SRC
fs/btrfs.cpp
fs/exfat.cpp
fs/ext2.cpp
fs/ext3.cpp
fs/ext4.cpp
fs/extended.cpp
fs/f2fs.cpp
fs/fat16.cpp
fs/fat32.cpp
fs/filesystem.cpp
fs/hfs.cpp
fs/nilfs2.cpp
fs/unknown.cpp
fs/linuxswap.cpp
fs/hfsplus.cpp
fs/ext3.cpp
fs/hpfs.cpp
fs/unformatted.cpp
fs/luks.cpp
fs/btrfs.cpp
fs/ufs.cpp
fs/reiserfs.cpp
fs/exfat.cpp
fs/filesystemfactory.cpp
fs/lvm2_pv.cpp
fs/reiser4.cpp
fs/ext2.cpp
fs/hfs.cpp
fs/hfsplus.cpp
fs/hpfs.cpp
fs/jfs.cpp
fs/linuxswap.cpp
fs/luks.cpp
fs/lvm2_pv.cpp
fs/nilfs2.cpp
fs/ntfs.cpp
fs/fat16.cpp
fs/ext4.cpp
fs/xfs.cpp
fs/extended.cpp
fs/zfs.cpp
fs/ocfs2.cpp
fs/reiser4.cpp
fs/reiserfs.cpp
fs/ufs.cpp
fs/unformatted.cpp
fs/unknown.cpp
fs/xfs.cpp
fs/zfs.cpp
)
set(FS_LIB_HDRS
@ -35,6 +36,7 @@ set(FS_LIB_HDRS
fs/ext3.h
fs/ext4.h
fs/extended.h
fs/f2fs.h
fs/fat16.h
fs/fat32.h
fs/filesystem.h

View File

@ -1,5 +1,6 @@
/*************************************************************************
* Copyright (C) 2012 by Volker Lanz <vl@fidra.de> *
* Copyright (C) 2016 by Andrius Štikonas <andrius@stikonas.eu> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *

View File

@ -1,5 +1,6 @@
/*************************************************************************
* Copyright (C) 2012 by Volker Lanz <vl@fidra.de> *
* Copyright (C) 2016 by Andrius Štikonas <andrius@stikonas.eu> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
@ -32,7 +33,7 @@ class QString;
namespace FS
{
/** A btrfs file system.
@author Volker Lanz <vl@fidra.de>
@author Andrius Štikonas <andrius@stikonas.eu>
*/
class LIBKPMCORE_EXPORT btrfs : public FileSystem
{

View File

@ -1,5 +1,6 @@
/*************************************************************************
* Copyright (C) 2012 by Volker Lanz <vl@fidra.de> *
* Copyright (C) 2016 by Andrius Štikonas <andrius@stikonas.eu> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *

View File

@ -32,7 +32,7 @@ class QString;
namespace FS
{
/** An exfat file system.
@author Volker Lanz <vl@fidra.de>
@author Andrius Štikonas <andrius@stikonas.eu>
*/
class LIBKPMCORE_EXPORT exfat : public FileSystem
{

View File

@ -50,7 +50,8 @@ const std::array< QColor, FileSystem::__lastType > FileSystem::defaultColorCode
QColor( 33,137,108 ),
QColor( 250,230,255 ),
QColor( 242,155,104 ),
QColor( 160,210,180 )
QColor( 160,210,180 ),
QColor( 255,170,0 )
};
@ -318,6 +319,7 @@ static const QString* typeNames()
i18nc("@item filesystem name", "exfat"),
i18nc("@item filesystem name", "nilfs2"),
i18nc("@item filesystem name", "lvm2 pv"),
i18nc("@item filesystem name", "f2fs"),
};
return s;

View File

@ -81,8 +81,9 @@ public:
Exfat = 22,
Nilfs2 = 23,
Lvm2_PV = 24,
F2fs = 25,
__lastType = 25
__lastType = 26
};
/** The type of support for a given FileSystem action */

View File

@ -24,6 +24,7 @@
#include "fs/ext3.h"
#include "fs/ext4.h"
#include "fs/extended.h"
#include "fs/f2fs.h"
#include "fs/fat16.h"
#include "fs/fat32.h"
#include "fs/hfs.h"
@ -61,6 +62,7 @@ void FileSystemFactory::init()
m_FileSystems.insert(FileSystem::Ext3, new FS::ext3(-1, -1, -1, QString()));
m_FileSystems.insert(FileSystem::Ext4, new FS::ext4(-1, -1, -1, QString()));
m_FileSystems.insert(FileSystem::Extended, new FS::extended(-1, -1, -1, QString()));
m_FileSystems.insert(FileSystem::F2fs, new FS::f2fs(-1, -1, -1, QString()));
m_FileSystems.insert(FileSystem::Fat16, new FS::fat16(-1, -1, -1, QString()));
m_FileSystems.insert(FileSystem::Fat32, new FS::fat32(-1, -1, -1, QString()));
m_FileSystems.insert(FileSystem::Hfs, new FS::hfs(-1, -1, -1, QString()));
@ -87,6 +89,7 @@ void FileSystemFactory::init()
FS::ext3::init();
FS::ext4::init();
FS::extended::init();
FS::f2fs::init();
FS::fat16::init();
FS::fat32::init();
FS::hfs::init();
@ -129,6 +132,7 @@ FileSystem* FileSystemFactory::create(FileSystem::Type t, qint64 firstsector, qi
case FileSystem::Ext3: fs = new FS::ext3(firstsector, lastsector, sectorsused, label); break;
case FileSystem::Ext4: fs = new FS::ext4(firstsector, lastsector, sectorsused, label); break;
case FileSystem::Extended: fs = new FS::extended(firstsector, lastsector, sectorsused, label); break;
case FileSystem::F2fs: fs = new FS::f2fs(firstsector, lastsector, sectorsused, label); break;
case FileSystem::Fat16: fs = new FS::fat16(firstsector, lastsector, sectorsused, label); break;
case FileSystem::Fat32: fs = new FS::fat32(firstsector, lastsector, sectorsused, label); break;
case FileSystem::Hfs: fs = new FS::hfs(firstsector, lastsector, sectorsused, label); break;

View File

@ -1,5 +1,6 @@
/*************************************************************************
* Copyright (C) 2012 by Volker Lanz <vl@fidra.de> *
* Copyright (C) 2013 by Andrius Štikonas <andrius@stikonas.eu> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
@ -32,7 +33,7 @@ class QString;
namespace FS
{
/** A LUKS crypto file system.
@author Volker Lanz <vl@fidra.de>
@author Andrius Štikonas <andrius@stikonas.eu>
*/
class LIBKPMCORE_EXPORT luks : public FileSystem
{

View File

@ -1,5 +1,6 @@
/*************************************************************************
* Copyright (C) 2012 by Volker Lanz <vl@fidra.de> *
* Copyright (C) 2016 by Andrius Štikonas <andrius@stikonas.eu> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *

View File

@ -1,5 +1,6 @@
/*************************************************************************
* Copyright (C) 2012 by Volker Lanz <vl@fidra.de> *
* Copyright (C) 2016 by Andrius Štikonas <andrius@stikonas.eu> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
@ -32,7 +33,7 @@ class QString;
namespace FS
{
/** LVM2 physical volume.
@author Andrius Štikonas <stikonas@gmail.com>
@author Andrius Štikonas <andrius@stikonas.eu>
*/
class LIBKPMCORE_EXPORT lvm2_pv : public FileSystem
{

View File

@ -1,5 +1,6 @@
/*************************************************************************
* Copyright (C) 2012 by Volker Lanz <vl@fidra.de> *
* Copyright (C) 2016 by Andrius Štikonas <andrius@stikonas.eu> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *

View File

@ -1,5 +1,6 @@
/*************************************************************************
* Copyright (C) 2012 by Volker Lanz <vl@fidra.de> *
* Copyright (C) 2016 by Andrius Štikonas <andrius@stikonas.eu> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
@ -32,7 +33,7 @@ class QString;
namespace FS
{
/** A nilfs2 file system.
@author Volker Lanz <vl@fidra.de>
@author Andrius Štikonas <andrius@stikonas.eu>
*/
class LIBKPMCORE_EXPORT nilfs2 : public FileSystem
{

View File

@ -1,5 +1,6 @@
/*************************************************************************
* Copyright (C) 2010 by Volker Lanz <vl@fidra.de> *
* Copyright (C) 2016 by Andrius Štikonas <andrius@stikonas.eu> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *

View File

@ -1,5 +1,6 @@
/*************************************************************************
* Copyright (C) 2010 by Volker Lanz <vl@fidra.de> *
* Copyright (C) 2016 by Andrius Štikonas <andrius@stikonas.eu> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
@ -32,7 +33,7 @@ class QString;
namespace FS
{
/** A zfs file system.
@author Volker Lanz <vl@fidra.de>
@author Andrius Štikonas <andrius@stikonas.eu>
*/
class LIBKPMCORE_EXPORT zfs : public FileSystem
{

View File

@ -513,6 +513,7 @@ FileSystem::Type LibPartedBackend::detectFileSystem(PedPartition* pedPartition)
else if (s == QStringLiteral("exfat")) rval = FileSystem::Exfat;
else if (s == QStringLiteral("nilfs2")) rval = FileSystem::Nilfs2;
else if (s == QStringLiteral("LVM2_member")) rval = FileSystem::Lvm2_PV;
else if (s == QStringLiteral("f2fs")) rval = FileSystem::F2fs;
else
qWarning() << "blkid: unknown file system type " << s << " on " << pedPath;
}