From 075580471e0f7435c52df486eb4354031337a7d3 Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Thu, 19 Oct 2017 13:41:37 +0800 Subject: btrfs-progs: mkfs: move image creation of rootdir to its own files In fact, --rootdir option is getting more and more independent from normal mkfs code. So move image creation function, make_image() and its related code to mkfs/rootdir.[ch], and rename the function to btrfs_mkfs_fill_dir(). Signed-off-by: Qu Wenruo Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba --- mkfs/rootdir.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 mkfs/rootdir.h (limited to 'mkfs/rootdir.h') diff --git a/mkfs/rootdir.h b/mkfs/rootdir.h new file mode 100644 index 00000000..015e5add --- /dev/null +++ b/mkfs/rootdir.h @@ -0,0 +1,34 @@ +/* + * 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. + */ + +/* + * Defines and functions declarations for mkfs --rootdir + */ + +#ifndef __BTRFS_MKFS_ROOTDIR_H__ +#define __BTRFS_MKFS_ROOTDIR_H__ + +#include "kernel-lib/list.h" + +struct directory_name_entry { + const char *dir_name; + const char *path; + ino_t inum; + struct list_head list; +}; + +int btrfs_mkfs_fill_dir(const char *source_dir, struct btrfs_root *root, + bool verbose); + +#endif -- cgit v1.2.3