Skip to contentSkip to conversation

UBIFS: Implement read-only UBIFS support in U-Boot

PATCH New Stefan Roese 2 participants 4 messages Mar 19, 2009 – Mar 23, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 2/3 UBIFS: Implement read-only UBIFS support in U-Boot

The U-Boot UBIFS implementation is largely a direct copy from the current Linux version (2.6.29-rc6). As already done in the UBI version we have an "abstraction layer" to redefine or remove some OS calls (e.g. mutex_lock() ...). This makes it possible to use the original Linux code with very little changes. And by this we can better update to later Linux versions.

I removed some of the Linux features that are not used in the U-Boot version (e.g. garbage-collection, write support).

CC Artem Bityutskiy <[email protected]>
CC Adrian Hunter <[email protected]>
---
 Makefile               |    3 +-
 fs/Makefile            |    1 +
 fs/ubifs/Makefile      |   52 +
 fs/ubifs/budget.c      |  113 ++
 fs/ubifs/crc16.c       |   60 ++
 fs/ubifs/crc16.h       |   30 +
 fs/ubifs/debug.c       |  156 +++
 fs/ubifs/debug.h       |  392 +++++++
 fs/ubifs/io.c          |  316 ++++++
 fs/ubifs/key.h         |  557 ++++++++++
 fs/ubifs/log.c         |  104 ++
 fs/ubifs/lprops.c      |  842 +++++++++++++++
 fs/ubifs/lpt.c         | 1105 +++++++++++++++++++
 fs/ubifs/lpt_commit.c  |  171 +++
 fs/ubifs/master.c      |  341 ++++++
 fs/ubifs/misc.h        |  310 ++++++
 fs/ubifs/orphan.c      |  316 ++++++
 fs/ubifs/recovery.c    | 1249 ++++++++++++++++++++++
 fs/ubifs/replay.c      | 1070 +++++++++++++++++++
 fs/ubifs/sb.c          |  324 ++++++
 fs/ubifs/scan.c        |  362 +++++++
 fs/ubifs/super.c       | 1189 +++++++++++++++++++++
 fs/ubifs/tnc.c         | 2767 ++++++++++++++++++++++++++++++++++++++++++++++++
 fs/ubifs/tnc_commit.c  | 1102 +++++++++++++++++++
 fs/ubifs/tnc_misc.c    |  435 ++++++++
 fs/ubifs/ubifs-media.h |  751 +++++++++++++
 fs/ubifs/ubifs.c       |  684 ++++++++++++
 fs/ubifs/ubifs.h       | 2173 +++++++++++++++++++++++++++++++++++++
 include/linux/math64.h |   85 ++
 include/ubi_uboot.h    |    9 +-
 30 files changed, 17067 insertions(+), 2 deletions(-)
 create mode 100644 fs/ubifs/Makefile
 create mode 100644 fs/ubifs/budget.c
 create mode 100644 fs/ubifs/crc16.c
 create mode 100644 fs/ubifs/crc16.h
 create mode 100644 fs/ubifs/debug.c
 create mode 100644 fs/ubifs/debug.h
 create mode 100644 fs/ubifs/io.c
 create mode 100644 fs/ubifs/key.h
 create mode 100644 fs/ubifs/log.c
 create mode 100644 fs/ubifs/lprops.c
 create mode 100644 fs/ubifs/lpt.c
 create mode 100644 fs/ubifs/lpt_commit.c
 create mode 100644 fs/ubifs/master.c
 create mode 100644 fs/ubifs/misc.h
 create mode 100644 fs/ubifs/orphan.c
 create mode 100644 fs/ubifs/recovery.c
 create mode 100644 fs/ubifs/replay.c
 create mode 100644 fs/ubifs/sb.c
 create mode 100644 fs/ubifs/scan.c
 create mode 100644 fs/ubifs/super.c
 create mode 100644 fs/ubifs/tnc.c
 create mode 100644 fs/ubifs/tnc_commit.c
 create mode 100644 fs/ubifs/tnc_misc.c
 create mode 100644 fs/ubifs/ubifs-media.h
 create mode 100644 fs/ubifs/ubifs.c
 create mode 100644 fs/ubifs/ubifs.h
 create mode 100644 include/linux/math64.h
Makefile +2 -1
index a88f337..8d5ccdd 100644
@@ -222,7 +222,8 @@ LIBS += cpu/ixp/npe/libnpe.a
 endif
 LIBS += lib_$(ARCH)/lib$(ARCH).a
 LIBS += fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a \
-	fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a fs/yaffs2/libyaffs2.a
+	fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a fs/yaffs2/libyaffs2.a \
+	fs/ubifs/libubifs.a
 LIBS += net/libnet.a
 LIBS += disk/libdisk.a
 LIBS += drivers/bios_emulator/libatibiosemu.a
fs/Makefile +1 -0
index 8bbd563..22aad12 100644
@@ -29,6 +29,7 @@ subdirs-$(CONFIG_CMD_FDOS) += fdos
 subdirs-$(CONFIG_CMD_JFFS2) += jffs2
 subdirs-$(CONFIG_CMD_REISER) += reiserfs
 subdirs-$(CONFIG_YAFFS2) += yaffs2
+subdirs-$(CONFIG_CMD_UBIFS) += ubifs
 
 SUBDIRS	:= $(subdirs-y)
 
fs/ubifs/Makefile new file +52 -0

52 lines not on this page · raw message

fs/ubifs/budget.c new file +113 -0

113 lines not on this page · raw message

fs/ubifs/crc16.c new file +60 -0

60 lines not on this page · raw message

fs/ubifs/crc16.h new file +30 -0
new file mode 100644
index 0000000..9443c08
@@ -0,0 +1,30 @@
+/*
+ *	crc16.h - CRC-16 routine
+ *
+ * Implements the standard CRC-16:
+ *   Width 16
+ *   Poly  0x8005 (x^16 + x^15 + x^2 + 1)
+ *   Init  0
+ *
+ * Copyright (c) 2005 Ben Gardner <[email protected]>
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2. See the file COPYING for more details.
+ */
+
+#ifndef __CRC16_H
+#define __CRC16_H
+
+#include <linux/types.h>
+
+extern u16 const crc16_table[256];
+
+extern u16 crc16(u16 crc, const u8 *buffer, size_t len);
+
+static inline u16 crc16_byte(u16 crc, const u8 data)
+{
+	return (crc >> 8) ^ crc16_table[(crc ^ data) & 0xff];
+}
+
+#endif /* __CRC16_H */
+
fs/ubifs/debug.c new file +156 -0

156 lines not on this page · raw message

fs/ubifs/debug.h new file +392 -0

392 lines not on this page · raw message

fs/ubifs/io.c new file +316 -0

316 lines not on this page · raw message

fs/ubifs/key.h new file +557 -0

557 lines not on this page · raw message

fs/ubifs/log.c new file +104 -0

104 lines not on this page · raw message

fs/ubifs/lprops.c new file +842 -0

842 lines not on this page · raw message

fs/ubifs/lpt.c new file +1105 -0

362 lines not on this page · raw message

fs/ubifs/lpt_commit.c new file +171 -0

171 lines not on this page · raw message

fs/ubifs/master.c new file +341 -0

341 lines not on this page · raw message

fs/ubifs/misc.h new file +310 -0

310 lines not on this page · raw message

fs/ubifs/orphan.c new file +316 -0

316 lines not on this page · raw message

fs/ubifs/recovery.c new file +1249 -0

1,249 lines not on this page · raw message

fs/ubifs/replay.c new file +1070 -0

1,070 lines not on this page · raw message

fs/ubifs/sb.c new file +324 -0

324 lines not on this page · raw message

fs/ubifs/scan.c new file +362 -0

362 lines not on this page · raw message

fs/ubifs/super.c new file +1189 -0

1,189 lines not on this page · raw message

fs/ubifs/tnc.c new file +2767 -0

2,767 lines not on this page · raw message

fs/ubifs/tnc_commit.c new file +1102 -0

1,102 lines not on this page · raw message

fs/ubifs/tnc_misc.c new file +435 -0

435 lines not on this page · raw message

fs/ubifs/ubifs-media.h new file +751 -0

751 lines not on this page · raw message

fs/ubifs/ubifs.c new file +684 -0

684 lines not on this page · raw message

fs/ubifs/ubifs.h new file +2173 -0

2,173 lines not on this page · raw message

include/linux/math64.h new file +85 -0

85 lines not on this page · raw message

include/ubi_uboot.h +8 -1
index b415219..74312ab 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.2.1

Part of the diff is not shown here. View the raw message.

#1 lore raw

PATCH v3 2/3 UBIFS: Implement read-only UBIFS support in U-Boot

Quoted 6 lines · Stefan Roese

The U-Boot UBIFS implementation is largely a direct copy from the current Linux version (2.6.29-rc6). As already done in the UBI version we have an "abstraction layer" to redefine or remove some OS calls (e.g. mutex_lock() ...). This makes it possible to use the original Linux code with very little changes. And by this we can better update to later Linux versions.

Quoted 6 lines

I removed some of the Linux features that are not used in the U-Boot version (e.g. garbage-collection, write support).

CC Artem Bityutskiy <[email protected]>
CC Adrian Hunter <[email protected]>

Hi Stefan, your request to help you with removing more stuff is still in my TODO list - I just do not have time for it.

In short - all this LEB categorization and heaps are also needed for R/O FS and you may remove that large piece of code as well.

Signature · 2 lines
Best regards,
Artem Bityutskiy (???????? ?????)
#2 lore raw

PATCH v3 2/3 UBIFS: Implement read-only UBIFS support in U-Boot

Quoted 14 lines · Artem Bityutskiy
Quoted 6 lines · Stefan Roese

The U-Boot UBIFS implementation is largely a direct copy from the current Linux version (2.6.29-rc6). As already done in the UBI version we have an "abstraction layer" to redefine or remove some OS calls (e.g. mutex_lock() ...). This makes it possible to use the original Linux code with very little changes. And by this we can better update to later Linux versions.

Quoted 6 lines

I removed some of the Linux features that are not used in the U-Boot version (e.g. garbage-collection, write support).

CC Artem Bityutskiy <[email protected]>
CC Adrian Hunter <[email protected]>
Quoted 5 lines

Hi Stefan, your request to help you with removing more stuff is still in my TODO list - I just do not have time for it.

In short - all this LEB categorization and heaps are also needed for R/O FS and you may remove that large piece of code as well.

Sorry, I meant "also _NOT_ needed".

Signature · 2 lines
Best regards,
Artem Bityutskiy (???????? ?????)
#3 lore raw

PATCH v3 2/3 UBIFS: Implement read-only UBIFS support in U-Boot

Quoted 2 lines · Artem Bityutskiy
Quoted 2 lines

Hi Stefan, your request to help you with removing more stuff is still in my TODO list - I just do not have time for it.

Thanks.

Quoted 4 lines
Quoted 2 lines

In short - all this LEB categorization and heaps are also needed for R/O FS and you may remove that large piece of code as well.

Sorry, I meant "also _NOT_ needed".

Yeah, I thought so. :)

The latest UBIFS version has just been added to U-Boot. I'll take a look at this LEB/heaps issue in the next days.

Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================