| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are no FS drivers that do not implement .lseek callback in the
codebase, so there doesn't seem to exist a use-case where lseek()
would return -ENOSYS due to fsdrv->lseek being NULL. At the same time
a large number of FS drivers implement only the most basic "always
succeeds" custom .lseek() hook.
Change the code of lseek() to treat absense of .lseek() to mean that
no special actions needs to be taken by FS driver and seek is always
successful and drop all of the trivial .lseek() implementations.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
Instead on relying on driver callbacks to update 'pos' in FILE, do it
as a part of lseek() code. This allows us to drop a bit of repeating
code as well as making lseek() implementation consistent with write()
and read().
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds the Linux dentry cache implementation to barebox.
Until now every filesystem driver resolves the full path to a file for
itself. This leads to code duplication and is error prone since
resolving paths is a complicated task. Also it can narrow down the
lookup performance since barebox only knows ASCII paths and has no way
of caching lookups.
With this patch we get the Linux dcache implementation. The path
resolving code from fs/namei.c is nearly taken as-is, minus the RCU
and locking code. Dcaching is made simple as of now: We simply cache
everything and never release any dentries. Although we do reference
counting for inodes and dentries it is effectively not used yet.
We never free anything until a fs is unmounted in which case we free
everything no matter if references are taken or not.
This patch also contains a wrapper in fs/legacy.c to support
filesystems with the old API.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is an adoption of the U-Boot commit
| commit f798b1dda1c5de818b806189e523d1b75db7e72d
| Author: Stefan Brüns <stefan.bruens@rwth-aachen.de>
| Date: Sat Sep 17 02:10:09 2016 +0200
|
| ext4: Use correct descriptor size when reading the block group descriptor
|
| The correct descriptor size must be used when calculating offsets, and
| also to read the correct amount of data.
|
| Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is an adoption of the U-Boot commits
| commit fc214ef90910159f33fbe92a6cb77839a27fa8a6
| Author: Stefan Brüns <stefan.bruens@rwth-aachen.de>
| Date: Sat Sep 17 02:10:07 2016 +0200
|
| ext4: determine group descriptor size for 64bit feature
|
| If EXT4_FEATURE_INCOMPAT_64BIT is set, the descriptor can be read from
| the superblocks, otherwise it defaults to 32.
|
| Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
| commit 3cc5bbb8e68dc67b7c3d2fdebef69408e5271469
| Author: Stefan Brüns <stefan.bruens@rwth-aachen.de>
| Date: Tue Dec 27 02:35:08 2016 +0100
|
| fs/ext4: Initialize group descriptor size for revision level 0 filesystems
|
| genext2fs creates revision level 0 filesystems, which are not readable
| by u-boot due to the initialized group descriptor size field.
| f798b1dda1c5de818b806189e523d1b75db7e72d
|
| Reported-by: Kever Yang <kever.yang@rock-chips.com>
| Reported-by: FrostyBytes@protonmail.com
| Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
| Tested-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is an adoption of the U-Boot commit
| commit 3ee2f977f3649bcc1d0de86356145e8e6999575a
| Author: Stefan Brüns <stefan.bruens@rwth-aachen.de>
| Date: Sat Sep 17 02:10:06 2016 +0200
|
| ext4: Update ext2/3/4 superblock, group descriptor and inode structures
|
| Most importantly, the superblock provides the used group descriptor size,
| which is required for the EXT4_FEATURE_INCOMPAT_64BIT.
|
| Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is an adoption of the U-Boot commit
| commit 011bc3342a485345f7136eed20e0477b8cd5580f
| Author: Michael Walle <michael@walle.cc>
| Date: Mon Aug 29 10:46:46 2016 +0200
|
| ext4: fix wrong usage of le32_to_cpu()
|
| le32_to_cpu() must only convert the revision_level and not the boolean
| result.
|
| Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
Nota bene sblock.inode_size actually has __le16 type.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is an adoption of the U-Boot commit
| commit 7f101be314da1f6f612a1b84822f791d6569946b
| Author: Michael Walle <michael@walle.cc>
| Date: Mon Aug 29 10:46:44 2016 +0200
|
| ext4: use kernel names for byte swaps
|
| Instead of __{be,le}{16,32}_to_cpu use {be,le}{16,32}_to_cpu.
|
| Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is an adoption of the U-Boot commit
| commit 2a0b7a971aac682112cf676c6583196faafcb2b0
| Author: Michael Walle <michael@walle.cc>
| Date: Mon Aug 29 10:46:43 2016 +0200
|
| ext4: change structure fields to __le/__be types
|
| Change all the types of ext2/4 fields to little endian types and all the
| JBD fields to big endian types. Now we can use sparse (make C=1) to check
| for statements where we need byteswaps.
|
| Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From U-Boot commit:
| commit 37f23885e4905ff500a8524328aa3084ac11cdb4
| Author: Ronald Zachariah <rozachar@cisco.com>
| Date: Thu Apr 28 07:08:34 2016 +0200
|
| fs: ext4: fix symlink read function
|
| The function ext4fs_read_symlink was unable to handle a symlink
| which had target name of exactly 60 characters.
|
| Signed-off-by: Ronald Zachariah <rozachar@cisco.com>
| Signed-off-by: Stefan Roese <sr@denx.de>
| Reviewed-by: Stephen Warren <swarren@nvidia.com>
| Cc: Tom Rini <trini@konsulko.com>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The patch fixes this compiler's warning:
CC fs/ext4/ext4_common.o
fs/ext4/ext4_common.c:130:5: warning: no previous prototype for
'ext4fs_get_indir_block' [-Wmissing-prototypes]
int ext4fs_get_indir_block(struct ext2fs_node *node, struct
ext4fs_indir_block *indir, int blkno)
^
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
include/linux/magic.h provides MAGIC numbers for various
file systems.
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
The compilers stddef.h should not be included. We declare all types
ourselves.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
Because that's what it is. 'inode' will become confusing
once we support real inodes.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From U-Boot commit:
| commit 8b415f703f88d1d3b0466830047affbbf7f24913
| Author: Rommel Custodio <sessyargc+uboot@gmail.com>
| Date: Sun Jul 21 10:53:25 2013 +0200
|
| ext4fs: le32_to_cpu() used on a 16-bit field
|
| Fix reading ext4_extent_header struture on BE machines. Some 16 bit
| fields where converted to 32 bit fields, due to the byte swap on BE
| machines the containing value was corrupted. Therefore reading ext4
| filesystems on BE machines where broken before.
|
| Signed-off-by: Rommel Custodio <sessyargc+uboot@gmail.com>
| [sent via git-send-email; rework commit message]
| Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
| Reviewed-by: Simon Glass <sjg@chromium.org>
| Tested-by: Simon Glass <sjg@chromium.org>
| Tested-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From U-Boot commit:
| commit 470173274d9ceb18a7140ef93e20be6c2236e7d9
| Author: Ionut Nicu <ioan.nicu.ext@nsn.com>
| Date: Mon Jan 13 11:59:24 2014 +0100
|
| ext4fs: use EXT2_BLOCK_SIZE instead of fs->blksz
|
| Using fs->blksz in ext4fs_get_extent_block() is not
| correct since fs->blksz is not initialized on the
| read path. Use EXT2_BLOCK_SIZE() instead which will
| produce the desired output.
|
| Signed-off-by: Ionut Nicu <ioan.nicu.ext@nsn.com>
| Signed-off-by: Mathias Rulf <mathias.rulf@nsn.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From U-Boot commit:
| commit b5bbac1a9b07016602559ff483df265fef6c1f83
| Author: Ionut Nicu <ioan.nicu.ext@nsn.com>
| Date: Mon Jan 13 12:00:08 2014 +0100
|
| ext4fs: fix "invalid extent block" error
|
| For files where we actually have extent indexes following
| an extent header (ext_block->eh_depth != 0), the do/while
| loop from ext4fs_get_extent_block() does not select the
| proper extent index structure.
|
| For example, if we have:
|
| ext_block->eh_depth = 1
| ext_block->eh_entries = 1
| fileblock = 0
| index[0].ei_block = 0
|
| the do/while loop will exit with i set to 0 and the
| ext4fs_get_extent_block() function will return 0, even if
| there was a valid extent index structure following the
| header.
|
| Signed-off-by: Ionut Nicu <ioan.nicu.ext@nsn.com>
| Signed-off-by: Mathias Rulf <mathias.rulf@nsn.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
All filesystem drivers which need a backingstore device do the same
ignoring of '/dev/' in the backingstore followed by a cdev_open. Add a
helper function for it and let the core handle the cdev. As a side
effect this makes sure that fsdev->cdev is also set when a device is
mounted without the leading '/dev/' which was previously ignored
by the mount code.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
The ext4 implementation has been taken from U-Boot with some
changes:
- No global variables to allow for multiple filesystems to
be mounted and multiple files to be open.
- remove fs internal link following and use the barebox link
implementation.
- remove write support. This is incomplete in U-Boot, so I decided
to skip this for now.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|