summaryrefslogtreecommitdiff
path: root/mkfs/rootdir.h
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2017-10-19 13:41:37 +0800
committerDavid Sterba <dsterba@suse.com>2018-01-08 18:11:24 +0100
commit075580471e0f7435c52df486eb4354031337a7d3 (patch)
treec0fb97c0a724f5dc1c7dd09f23da637a6608a46b /mkfs/rootdir.h
parent4de1e5cd4902d588ef673f17e6ba5130aab62bf7 (diff)
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 <wqu@suse.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'mkfs/rootdir.h')
-rw-r--r--mkfs/rootdir.h34
1 files changed, 34 insertions, 0 deletions
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