Addition of btrfs file-system to U-boot
Subsystems (4)
PATCH v8 1/1 Addition of btrfs file-system to U-boot
Adnan Ali (1):
Introduced btrfs file-system with btrload command
Makefile | 1 + common/Makefile | 1 + common/cmd_btr.c | 65 +++ fs/btrfs/Makefile | 51 ++ fs/btrfs/btrfs.c | 1352 ++++++++++++++++++++++++++++++++++++++++++++ fs/fs.c | 10 + include/btrfs.h | 416 ++++++++++++++ include/config_fallbacks.h | 4 + include/crc.h | 8 + include/fs.h | 1 + lib/Makefile | 1 + lib/crc32_c.c | 40 ++ 12 files changed, 1950 insertions(+) create mode 100644 common/cmd_btr.c create mode 100644 fs/btrfs/Makefile create mode 100644 fs/btrfs/btrfs.c create mode 100644 include/btrfs.h create mode 100644 lib/crc32_c.c
Signature · 1 line
1.7.9.5
PATCH v8 1/1 Introduced btrfs file-system with btrload command
Introduces btrfs file-system to read file from volume/sub-volumes with btrload command. This implementation has read-only support.
This btrfs implementation is based on syslinux btrfs code, commit 269ebc845ebc8b46ef4b0be7fa0005c7fdb95b8d.
v8: patch re-formated. v7: patch re-formated. v6: patch re-formated. v5: merged with master. v4: btrls command added.
--- Makefile | 1 + common/Makefile | 1 + common/cmd_btr.c | 65 +++ fs/btrfs/Makefile | 51 ++ fs/btrfs/btrfs.c | 1352 ++++++++++++++++++++++++++++++++++++++++++++ fs/fs.c | 10 + include/btrfs.h | 416 ++++++++++++++ include/config_fallbacks.h | 4 + include/crc.h | 8 + include/fs.h | 1 + lib/Makefile | 1 + lib/crc32_c.c | 40 ++ 12 files changed, 1950 insertions(+) create mode 100644 common/cmd_btr.c create mode 100644 fs/btrfs/Makefile create mode 100644 fs/btrfs/btrfs.c create mode 100644 include/btrfs.h create mode 100644 lib/crc32_c.c
Makefile +1 -0
@@ -257,6 +257,7 @@ endif LIBS-$(CONFIG_OF_EMBED) += dts/libdts.o LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o LIBS-y += fs/libfs.o \ + fs/btrfs/libbtrfs.o \ fs/cbfs/libcbfs.o \ fs/cramfs/libcramfs.o \ fs/ext4/libext4fs.o \
common/Makefile +1 -0
@@ -73,6 +73,7 @@ COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o COBJS-$(CONFIG_CMD_BOOTSTAGE) += cmd_bootstage.o +COBJS-$(CONFIG_CMD_BTR) += cmd_btr.o COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o COBJS-$(CONFIG_CMD_CBFS) += cmd_cbfs.o COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
common/cmd_btr.c new file +65 -0
65 lines not on this page · raw message
fs/btrfs/Makefile new file +51 -0
51 lines not on this page · raw message
fs/btrfs/btrfs.c new file +1352 -0
1,352 lines not on this page · raw message
fs/fs.c +10 -0
@@ -17,6 +17,7 @@#include <config.h> #include <common.h> #include <part.h> +#include <btrfs.h> #include <ext4fs.h> #include <fat.h> #include <fs.h>
@@ -88,6 +89,15 @@ static struct fstype_info fstypes[] = { .read = fs_read_sandbox, },#endif +#ifdef CONFIG_FS_BTR + { + .fstype = FS_TYPE_BTR, + .probe = btrfs_probe, + .close = btrfs_close, + .ls = btrfs_ls, + .read = btrfs_read_file, + }, +#endif { .fstype = FS_TYPE_ANY, .probe = fs_probe_unsupported,
include/btrfs.h new file +416 -0
416 lines not on this page · raw message
include/config_fallbacks.h +4 -0
@@ -26,4 +26,8 @@#define CONFIG_EXT4_WRITE #endif +#if defined(CONFIG_CMD_BTR ) && !defined(CONFIG_FS_BTR ) +#define CONFIG_FS_BTR +#endif +#endif /* __CONFIG_FALLBACKS_H */
include/crc.h +8 -0
@@ -97,4 +97,12 @@ cyg_ether_crc32_accumulate(uint32_t crc, unsigned char *s, int len);extern uint16_t cyg_crc16 (unsigned char *s,int len); +/* CRC init for btrfs file-system*/ + +void crc32c_init (u32 *crc32c_table,u32 pol); + +/* CRC calculate for btrfs file-system*/ + +u32 crc32c_cal (u32 crc,const char *data,size_t length,u32 *crc32c_table); +#endif /* _SERVICES_CRC_CRC_H_ */
include/fs.h +1 -0
@@ -22,6 +22,7 @@#define FS_TYPE_FAT 1#define FS_TYPE_EXT 2#define FS_TYPE_SANDBOX 3 +#define FS_TYPE_BTR 4/* * Tell the fs layer which block device an partition to use for future
lib/Makefile +1 -0
@@ -67,6 +67,7 @@ COBJS-$(CONFIG_SPL_NET_SUPPORT) += hashtable.o COBJS-$(CONFIG_SPL_NET_SUPPORT) += net_utils.o endif COBJS-y += crc32.o +COBJS-y += crc32_c.o COBJS-y += ctype.o COBJS-y += div64.o COBJS-y += linux_string.o
lib/crc32_c.c new file +40 -0
@@ -0,0 +1,40 @@ +/* +* Copied from Linux kernel crypto/crc32c.c +* Copyright (c) 2004 Cisco Systems, Inc. +* Copyright (c) 2008 Herbert Xu <[email protected]> +* +* 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. +* +*/ +#include <linux/stat.h> +#include <command.h> +#include <asm/byteorder.h> +#include <linux/compiler.h> +#include <common.h> +#include <config.h> + +u32 crc32c_cal (u32 crc,const char *data,size_t length,u32 *crc32c_table) +{ +while (length--) + crc = crc32c_table[(u8)(crc ^ *data++)] ^ (crc >>8 ); + +return crc; +} + +void crc32c_init (u32 *crc32c_table,u32 pol) +{ +int i, j; +u32 v; +const u32 poly = pol;/* Bit-reflected CRC32C polynomial */ + +for (i =0 ; i <256 ; i++) { + v = i; +for (j =0 ; j <8 ; j++) + v = (v >>1 ) ^ ((v &1 ) ? poly :0 ); + + crc32c_table[i] = v; + } +}
Signature · 1 line
1.7.9.5
PATCH v8 1/1 Introduced btrfs file-system with btrload command
Quoted 6 lines · Adnan Ali
Introduces btrfs file-system to read file from volume/sub-volumes with btrload command. This implementation has read-only support.
This btrfs implementation is based on syslinux btrfs code, commit269ebc845ebc8b46ef4b0be7fa0005c7fdb95b8d.
Quoted 7 lines
v8: patch re-formated. v7: patch re-formated. v6: patch re-formated. v5: merged with master. v4: btrls command added.Signed-off-by Adnan Ali <[email protected]>
I'm sorry, but there's still some pretty severe checkpatch warnings introduced here over syslinux such as:
ERROR: do not use assignment in if condition
#525: FILE: btrfs/btrfs.c:525:
+ if (status = btrfs_comp_keys_type(&search_key,
Please use "./tools/checkpatch.pl -f fs/btrfs/btrfs.c" and -f /path/to/syslinux/core/fs/btrfs/btrfs.c and fix the things that are being introduced and quite possibly bugs like the above.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130319/cd1e67f8/attachment.pgp>
PATCH v8 1/1 Introduced btrfs file-system with btrload command
Hi
Quoted 21 lines · Tom Rini
Quoted 6 lines · Adnan Ali
Introduces btrfs file-system to read file from volume/sub-volumes with btrload command. This implementation has read-only support.
This btrfs implementation is based on syslinux btrfs code, commit269ebc845ebc8b46ef4b0be7fa0005c7fdb95b8d.Quoted 7 lines
v8: patch re-formated. v7: patch re-formated. v6: patch re-formated. v5: merged with master. v4: btrls command added.Signed-off-by Adnan Ali <[email protected]>I'm sorry, but there's still some pretty severe checkpatch warnings introduced here over syslinux such as:
ERROR: do not use assignment in if condition
#525: FILE:btrfs/btrfs.c:525:
+ if (status = btrfs_comp_keys_type(&search_key,
Quoted 4 lines
Please use "
./tools/checkpatch.pl-ffs/btrfs/btrfs.c" and -f /path/to/syslinux/core/fs/btrfs/btrfs.c and fix the things that are being introduced and quite possibly bugs like the above.
Thanks, I am going to remove all the errors. Do you want me to
remove all
warnings as well or you are fine with it. This has taken quite a while now.
Thanks
Adnan Ali
PATCH v8 1/1 Introduced btrfs file-system with btrload command
Quoted 24 lines · Adnan Ali
Hi
Quoted 21 lines · Tom Rini
Quoted 6 lines · Adnan Ali
Introduces btrfs file-system to read file from volume/sub-volumes with btrload command. This implementation has read-only support.
This btrfs implementation is based on syslinux btrfs code, commit269ebc845ebc8b46ef4b0be7fa0005c7fdb95b8d.Quoted 7 lines
v8: patch re-formated. v7: patch re-formated. v6: patch re-formated. v5: merged with master. v4: btrls command added.Signed-off-by Adnan Ali <[email protected]>I'm sorry, but there's still some pretty severe checkpatch warnings introduced here over syslinux such as:
ERROR: do not use assignment in if condition
#525: FILE:btrfs/btrfs.c:525:
+ if (status = btrfs_comp_keys_type(&search_key,
Quoted 7 lines
Quoted 4 lines
Please use "
./tools/checkpatch.pl-ffs/btrfs/btrfs.c" and -f /path/to/syslinux/core/fs/btrfs/btrfs.c and fix the things that are being introduced and quite possibly bugs like the above.Thanks, I am going to remove all the errors. Do you want me to
remove all
warnings as well or you are fine with it. This has taken quite a while now.
Yes please fix all of the new warnings and errors that are not found in syslinux sources. Thanks.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130319/47e9918b/attachment.pgp>