libstorage-ng
Loading...
Searching...
No Matches
BlkFilesystem.h
1/*
2 * Copyright (c) [2014-2015] Novell, Inc.
3 * Copyright (c) [2016-2026] SUSE LLC
4 *
5 * All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of version 2 of the GNU General Public License as published
9 * by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, contact Novell, Inc.
18 *
19 * To contact Novell about this file by physical or electronic mail, you may
20 * find current contact information at www.novell.com.
21 */
22
23
24#ifndef STORAGE_BLK_FILESYSTEM_H
25#define STORAGE_BLK_FILESYSTEM_H
26
27
28#include <vector>
29
30#include "storage/Filesystems/Filesystem.h"
31
32
33namespace storage
34{
35
36 class BlkDevice;
37 class ContentInfo;
38
39
40 // abstract class
41
42 class BlkFilesystem : public Filesystem
43 {
44 public:
45
49 static std::vector<BlkFilesystem*> get_all(Devicegraph* devicegraph);
50
54 static std::vector<const BlkFilesystem*> get_all(const Devicegraph* devicegraph);
55
59 bool supports_label() const;
60
64 unsigned int max_labelsize() const;
65
69 const std::string& get_label() const;
70
75 void set_label(const std::string& label);
76
80 bool supports_uuid() const;
81
85 const std::string& get_uuid() const;
86
92 void set_uuid(const std::string& uuid);
93
94 const std::string& get_mkfs_options() const ST_DEPRECATED;
95 void set_mkfs_options(const std::string& mkfs_options) ST_DEPRECATED;
96
100 const std::vector<std::string>& get_mkfs_options_v2() const;
101
107 void set_mkfs_options_v2(const std::vector<std::string>& mkfs_options_v2);
108
113
114 const std::string& get_tune_options() const ST_DEPRECATED;
115 void set_tune_options(const std::string& tune_options) ST_DEPRECATED;
116
120 const std::vector<std::string>& get_tune_options_v2() const;
121
131 void set_tune_options_v2(const std::vector<std::string>& tune_options);
132
136 bool supports_shrink() const;
137
141 bool supports_grow() const;
142
148
154
160
166
170 void set_resize_info(const ResizeInfo& resize_info);
171
178
182 void set_content_info(const ContentInfo& content_info);
183
187 static std::vector<const BlkFilesystem*> find_by_label(const Devicegraph* devicegraph,
188 const std::string& label);
189
193 static std::vector<const BlkFilesystem*> find_by_uuid(const Devicegraph* devicegraph,
194 const std::string& uuid);
195
199 std::vector<BlkDevice*> get_blk_devices();
200
204 std::vector<const BlkDevice*> get_blk_devices() const;
205
206 public:
207
208 class Impl;
209
210 Impl& get_impl();
211 const Impl& get_impl() const;
212
213 protected:
214
215 BlkFilesystem(Impl* impl);
216 ST_NO_SWIG BlkFilesystem(std::unique_ptr<Device::Impl>&& impl);
217
218 };
219
220
226 bool is_blk_filesystem(const Device* device);
227
235
240
241}
242
243#endif
An abstract Block Device.
Definition BlkDevice.h:50
Definition BlkFilesystem.h:43
bool supports_tune_options() const
Checks whether the filesystem supports tune options.
std::vector< BlkDevice * > get_blk_devices()
Get underlying blk devices of the blk filesystem.
ContentInfo detect_content_info() const
Detect the content info of the filesystem.
void set_label(const std::string &label)
Set the filesystem label.
void set_uuid(const std::string &uuid)
Set the filesystem UUID.
const std::vector< std::string > & get_tune_options_v2() const
Get extra options for the filesystem tune command.
static std::vector< BlkFilesystem * > get_all(Devicegraph *devicegraph)
Get all BlkFilesystems.
static std::vector< const BlkFilesystem * > get_all(const Devicegraph *devicegraph)
Get all BlkFilesystems.
bool supports_shrink() const
Checks whether shrinking the filesystem is supported.
bool supports_mounted_grow() const
Checks whether growing the filesystem while being mounted is supported.
bool supports_grow() const
Checks whether growing the filesystem is supported.
bool supports_mounted_shrink() const
Checks whether shrinking the filesystem while being mounted is supported.
bool supports_unmounted_grow() const
Checks whether growing the filesystem while being unmounted is supported.
const std::string & get_label() const
Get the filesystem label.
const std::vector< std::string > & get_mkfs_options_v2() const
Get extra options for the filesystem mkfs command.
void set_content_info(const ContentInfo &content_info)
Set the ResizeInfo.
bool supports_label() const
Return whether the filesystem supports a label.
static std::vector< const BlkFilesystem * > find_by_label(const Devicegraph *devicegraph, const std::string &label)
Find filesystems by label.
unsigned int max_labelsize() const
Return the maximal allowed filesystem label length.
const std::string & get_uuid() const
Get the filesystem UUID.
static std::vector< const BlkFilesystem * > find_by_uuid(const Devicegraph *devicegraph, const std::string &uuid)
Find filesystems by UUID.
bool supports_unmounted_shrink() const
Checks whether shrinking the filesystem while being unmounted is supported.
void set_tune_options_v2(const std::vector< std::string > &tune_options)
Set extra options for the filesystem tune command.
void set_mkfs_options_v2(const std::vector< std::string > &mkfs_options_v2)
Set extra options for the filesystem mkfs command.
bool supports_uuid() const
Return whether the filesystem supports a UUID.
void set_resize_info(const ResizeInfo &resize_info)
Set the ResizeInfo.
Definition FreeInfo.h:309
An abstract base class for storage devices.
Definition Device.h:82
The main container of the libstorage-ng.
Definition Devicegraph.h:170
Definition FreeInfo.h:206
The storage namespace.
Definition Actiongraph.h:40
BlkFilesystem * to_blk_filesystem(Device *device)
Converts pointer to Device to pointer to BlkFilesystem.
bool is_blk_filesystem(const Device *device)
Checks whether device points to a BlkFilesystem.