gparted/include/bcachefs.h

47 lines
1.3 KiB
C
Raw Permalink Normal View History

/* Copyright (C) 2024 Mike Fleetwood
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GPARTED_BCACHEFS_H
#define GPARTED_BCACHEFS_H
#include "FileSystem.h"
#include "OperationDetail.h"
#include "Partition.h"
namespace GParted
{
class bcachefs : public FileSystem
{
public:
FS get_filesystem_support();
void set_used_sectors(Partition& partition);
bool create(const Partition& new_partition, OperationDetail& operationdetail);
void read_label(Partition& partition);
void read_uuid(Partition& partition);
Add bcachefs growing (!123) Shrinking a bcachefs file system is not supported. # truncate -s $((1*1024*1024*1024)) /tmp/disk.img # losetup --find --show /tmp/disk.img /dev/loop0 # bcachefs format /dev/loop0 ... # bcachefs device resize /dev/loop0 $((1*1024*1024*1024 - 512)) Doing offline resize of /dev/loop0 mounting version 1.4: member_seq initializing new filesystem going read-write initializing freespace Shrinking not supported yet # echo $? 1 Growing a bcachefs file system is supported when unmounted. # truncate -s $((2*1024*1024*1024)) /tmp/disk.img # losetup --set-capacity /dev/loop0 # bcachefs device resize /dev/loop0 Doing offline resize of /dev/loop0 mounting version 1.6: btree_subvolume_children recovering from unclean shutdown journal read done, replaying entries 1-1 alloc_read... done stripes_read... done snapshots_read... done going read-write journal_replay... done resume_logged_ops... done delete_dead_inodes... done resizing /dev/loop0 to 16384 buckets # echo $? 0 # bcachefs show-super /dev/loop0 | egrep 'Device:|Size:' Device: 0 Size: 2.00 GiB Growing is also supported when mounted. # mount /dev/loop0 /mnt/0 # truncate -s $((3*1024*1024*1024)) /tmp/disk.img # losetup --set-capacity /dev/loop0 # bcachefs device resize /dev/loop0 Doing online resize of /dev/loop0 resizing /dev/loop0 to 24576 buckets # echo $? 0 # bcachefs show-super /dev/loop0 | egrep 'Device:|Size:' Device: 0 Size: 3.00 GiB Closes !123 - Add support for bcachefs, single device file systems only
2024-03-17 02:03:50 -06:00
bool resize(const Partition& partition_new, OperationDetail& operationdetail, bool fill_partition);
bool check_repair(const Partition& partition, OperationDetail& operationdetail);
};
} //GParted
#endif /* GPARTED_BCACHEFS_H */