diff options
author | Nicholas D Steeves <nsteeves@gmail.com> | 2016-04-23 00:41:30 +0100 |
---|---|---|
committer | Nicholas D Steeves <nsteeves@gmail.com> | 2016-04-23 00:41:30 +0100 |
commit | cec572daccafa1e912cbed363df6f84687778c6f (patch) | |
tree | 7d99ab9f73d25c1ed8eaf6393f6374edf5316b03 /cmds-fi-usage.h |
btrfs-progs (4.4.1-1.1) unstable; urgency=medium
* Non-maintainer upload.
* New upstream release.
* Rename package to btrfs-progs (Closes: #780081)
* Update standards version to 3.9.7 (no changes needed).
* debian/control: Add "Breaks" per Gianfranco Costamagna's suggestion
* Change lintian override to reflect package rename
* Switch from using postinst and postrm to using triggers
per Christian Seiler's recommendation.
# imported from the archive
Diffstat (limited to 'cmds-fi-usage.h')
-rw-r--r-- | cmds-fi-usage.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/cmds-fi-usage.h b/cmds-fi-usage.h new file mode 100644 index 00000000..adb8ad30 --- /dev/null +++ b/cmds-fi-usage.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2007 Oracle. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License v2 as published by the Free Software Foundation. + * + * 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, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 021110-1307, USA. + */ + +#ifndef __CMDS_FI_USAGE_H__ +#define __CMDS_FI_USAGE_H__ + +#include "kerncompat.h" +#include "ioctl.h" + +extern const char * const cmd_filesystem_usage_usage[]; +int cmd_filesystem_usage(int argc, char **argv); + +struct device_info { + u64 devid; + char path[BTRFS_DEVICE_PATH_NAME_MAX]; + /* Size of the block device */ + u64 device_size; + /* Size that's occupied by the filesystem, can be changed via resize */ + u64 size; +}; + +/* + * To store the size information about the chunks: + * the chunks info are grouped by the tuple (type, devid, num_stripes), + * i.e. if two chunks are of the same type (RAID1, DUP...), are on the + * same disk, have the same stripes then their sizes are grouped + */ +struct chunk_info { + u64 type; + u64 size; + u64 devid; + u64 num_stripes; +}; + +int load_chunk_and_device_info(int fd, struct chunk_info **chunkinfo, + int *chunkcount, struct device_info **devinfo, int *devcount); +void print_device_chunks(int fd, struct device_info *devinfo, + struct chunk_info *chunks_info_ptr, + int chunks_info_count, unsigned unit_mode); +void print_device_sizes(int fd, struct device_info *devinfo, unsigned unit_mode); + +#endif |