2019-04-24 |
fs: ubifs: Add authentication support
...
This adds UBIFS authentication support. For now, we do not do
any authentication even on authenticated UBIFS images. Since
this behaviour is not what the user normally expects when mounting
authenticated images we only do this when the user explicitly allows
it in "global.ubifs.allow_authenticated_unauthenticated". If the
flag is false then we refuse mounting such an image and return -EPERM
instead.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 24 Apr 2019
|
2019-03-04 |
fs: ubifs: Remove unused crc16 functions
...
The crc16 functions in ubifs are unused, so remove them.
(They were only used in the LPT functions which are completely removed
for the barebox readonly implementation)
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Mar 2019
|
2019-01-29 |
fs: Drop trivial .lseek() implementaitons in FS drivers
...
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>
Andrey Smirnov
authored
on 29 Jan 2019
Sascha Hauer
committed
on 29 Jan 2019
|
fs: Update FILE position in lseek()
...
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>
Andrey Smirnov
authored
on 29 Jan 2019
Sascha Hauer
committed
on 29 Jan 2019
|
2018-11-12 |
fs: ubifs: Avoid missing prototype warning
...
Remove unused ubifs_iput() and make locally used functions static.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Nov 2018
|
2018-10-08 |
fs: ubifs: optionally allow to mount UBIFS images with encrypted files
...
Currently we do not support the UBIFS file encryption feature.
Nevertheless we can allow read clear files from UBIFS to be
able to boot an unencrypted kernel. This differs from the Kernel
behaviour, so add a globalvar to make that configurable.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Oct 2018
|
ubifs: Update to v4.18-rc6
...
This syncs the UBIFS code with Linux-4.19-rc6.
There are many functions in the Linux UBIFS codebase that we do not need
for a readonly implementation. These are missing here, but all removed
functions are annotated as such so it should be relatively easy to copy
a newer codebase over the current one and to see which functions shall
be removed from the newer version.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Oct 2018
|
fs: ubifs: remove not needed code
...
This patch aggressively removes stuff that we do not need in a readonly
implementation:
- write buffering support
- lpt/ltab code
- garbage collector
- everything under #ifndef __BAREBOX__
This decreases the binary size by about 5k on ARM, but the main reason
for doing this is the idea that things that are not there don't need to
be synced with upstream ubifs code.
The __BAREBOX__ ifdeffery makes the code very hard to read and is a
maintenance burden by itself, so it is removed here aswell.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Oct 2018
|
fs: implement clear_nlink and set_nlink
...
Implement clear_nlink and set_nlink and remove the private versions
from UBIFS.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Oct 2018
|
fs: implement iget_locked and iget_failed
...
Implement in fs core rather than using a private version in UBIFS.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Oct 2018
|
Add more mutex no-ops
...
Add mutex_lock_nested, mutex_unlock_nested and mutex_is_locked to
include/linux/mutex.h and remove them from UBIFS.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Oct 2018
|
Add kmemdup
...
We have kmemdup as a UBIFS specific variant, put it into the correct
header files. Instead of reimplementing it just use memdup we already
have.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Oct 2018
|
Add linux/slab.h
...
Move stuff we already have in include/linux/barebox-wrapper.h that
really belongs to include/linux/slab.h to there. Also add kmem_cache_*
functions. UBIFS uses them in there own implementation, so we have to
remove it there.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Oct 2018
|
2018-09-28 |
fs: ubifs: Do not free memory not allocated by ubifs
...
Since the switch to dentry cache implementation we no longer allocate
the super block, so we must not free it in the error path.
Fixes: ("4d2b23bcf9 fs: ubifs: Switch to dentry cache implementation")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 28 Sep 2018
|
2018-07-13 |
fs: ubifs: Switch to dentry cache implementation
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 13 Jul 2018
|
2018-07-11 |
fs: dentry cache implementation
...
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>
Sascha Hauer
committed
on 11 Jul 2018
|
2018-04-06 |
fs: Add super_operations
...
Add a struct super_operations we can use later when we get a fs
implementation closer to Linux. Only add the functions we'll likely
need though.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Apr 2018
|
ubifs: remove dead code
...
Remove code that was added to UBIFS for U-Boot but that is not needed
for barebox.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Apr 2018
|
ubifs: Remove Linux struct definitions we already have
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Apr 2018
|
ubifs: remove dead code
...
Remove stuff that was added to UBIFS for U-Boot which we do not need
because we already have it in the Linux header files.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Apr 2018
|
2017-01-09 |
ubifs: restore symlink support
...
In commit a63059d7 of the latest u-boot port, the function that
returns the inode number also resolves symlink. This prevents the
readlink entry point from doing its job and breaks the user command
readlink and the display of symlink with the ls command.
Remove the code following the link to restore original functionality.
Signed-off-by: Renaud Barbier <renaud.barbier@abaco.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Renaud Barbier
authored
on 8 Dec 2016
Sascha Hauer
committed
on 9 Jan 2017
|
2016-07-07 |
ubifs: check return pointer properly
...
ubifs_iget() returns error codes encoded in the pointer,
so the NULL check will never be true.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Lucas Stach
authored
on 6 Jul 2016
Sascha Hauer
committed
on 7 Jul 2016
|
2016-05-09 |
Merge branch 'for-next/misc'
Sascha Hauer
committed
on 9 May 2016
|
2016-04-21 |
whole tree: remove trailing whitespaces
...
Signed-off-by: Du Huanpeng <u74147@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Du Huanpeng
authored
on 21 Apr 2016
Sascha Hauer
committed
on 21 Apr 2016
|
2016-04-15 |
string: Fix (v)asprintf prototypes
...
Our asprintf and vasprintf have different prototypes than the glibc
functions. This causes trouble when we want to share barebox code
with userspace code. Change the prototypes for (v)asprintf to match
the glibc prototypes. Since the current (v)asprintf are convenient
to use change the existing functions to b(v)asprintf.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 Apr 2016
|
include: move crc specific stuff to crc.h
...
We have a crc.h, so move our crc function prototypes there to further
cleanup common.h.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 Apr 2016
|
2016-04-08 |
ubifs: update implementation from u-boot v2016.03
...
This updated code supports recovering from unclean unmounts when write
buffer size is larger than 8. Linux uses takes information into
consideration when checking for writes.
The following list shows the changes for each file done compared to
u-boot v2016.03 code.
Makefile
* Add gc.o, do not include header as in u-boot
budget.c:
* Replace __UBOOT__ with __BAREBOX__
debug.c:
* Replace __UBOOT__ with __BAREBOX__
* Remove #include <linux/compat.h>
* Replace current->pid with 0
debug.h
* Replace __UBOOT__ with __BAREBOX__
* Add "0 &&" to ubifs_assert condition check
U-Boot essentially disabled pr_crit output and dump_stack() is defined
to do { } while (0), so ubifs_assert does nothing despite condition.
gc.c:
* Replace __UBOOT__ with __BAREBOX__
io.c:
* Replace __UBOOT__ with __BAREBOX__
* Remove #include <linux/compat.h>
key.h:
* No changes
log.c:
* No changes
lprops.c:
* Replace __UBOOT__ with __BAREBOX__
lpt.c
* Replace __UBOOT__ with __BAREBOX__
* Remove #include <linux/compat.h>
* Remove #include <ubi_uboot.h>
lpt_commit.c
* Replace __UBOOT__ with __BAREBOX__
* Remove #include <linux/compat.h>
master.c
* Replace __UBOOT__ with __BAREBOX__
* Remove #include <linux/compat.h>
* Remove #include <ubi_uboot.h>
misc.h
* Replace __UBOOT__ with __BAREBOX__
* Add #ifndef __BAREBOX__ around unneeded ubifs_current_time
orphan.c
* No changes
recovery.c
* Replace __UBOOT__ with __BAREBOX__
replay.c
* Replace __UBOOT__ with __BAREBOX__
* Remove #include <linux/compat.h>
sb.c
* Replace __UBOOT__ with __BAREBOX__
* Remove #include <linux/compat.h>
* Remove #include <ubi_uboot.h>
* rp_uid and rp_gid are still uid_t, not kuid_t, so remove .val
scan.c
* Replace __UBOOT__ with __BAREBOX__
super.c:
* Replaced current->pid with 0
* Replaced __UBOOT__ with __BAREBOX__
* Removed #include <ubi_uboot.h>
* Removed #include <memalign.h>
* Added #include <init.h>
* Replaced malloc_cache_aligned with kzalloc
* Replaced I_LOCK with I_SYNC
* i_uid and i_gid are still uid_t, not kuid_t, so remove .val
* Replaced string "U-Boot" with "Barebox"
* Add #ifndef __BAREBOX__ around open_ubi, sb_test, sb_set, ubifs_mount,
kill_ubifs_super, ubifs_fs_type
* Do not call ubi_open_volume or ubi_close_volume in ubifs_fill_super
Those will already be handled in ubifs_probe
* Replaced uboot_ubifs_mount with new ubifs_get_super implementation using
existing functions alloc_super, alloc_ubifs_info
tnc.c
* Replace __UBOOT__ with __BAREBOX__
* Remove #include <linux/compat.h>
tnc_misc.c
* Replace __UBOOT__ with __BAREBOX__
ubifs-media.h
* Replace __UBOOT__ with __BAREBOX__
ubifs.c:
* Replaced __UBOOT__ with __BAREBOX__
* Adjusted header includes
* Removed DECLARE_GLOBAL_DATA_PTR
* Add static struct z_stream_s variable
* Add struct ubifs_priv delcaration
* Replaced zunzip with deflate_decompress call
* Add ifdef for disabling ZLIB and/or LZO support
* Replaced malloc_cache_aligned with kzalloc
* Added #ifndef __BAREBOX__ around filldir, ubifs_printdir,
ubifs_set_blk_dev, ubifs_ls, ubifs_exists, ubifs_size, do_readpage,
ubifs_read, ubifs_close, ubifs_load
* Make parameter filename const char* in ubifs_findfile
* Add UBIFS fs_driver_d implementation
* Add zlib_decomp_init, ubifs_init
ubifs.h:
* Replaced __UBOOT__ with __BAREBOX__
* Adjusted header includes
* Added old #define crc32
* Added helper around kmem*
* Added XATTR_LIST_MAX define
* Added #ifndef __BAREBOX__ around current_fs_time struct inode,
struct super_block, file_system_type, dentry and friends which barebox
already has
* Added #ifndef __BAREBOX__ around write_inode in super_operations to avoid
declaration of writeback_control
* Change rp_uid and rp_gid to uid_t and gui_t
* Added struct device_d to struct ubifs_info
* Added forward declaration of ubifs_get_super
linux/fs.h:
* Make struct inode's i_nlink a union containing a non-const int __i_nlink
while making i_nlink a const int
linux/fs.h:
* Add s_remove_count
linux/fs.h:
* Convert struct super_block.s_instances and
struct file_system_type.fs_supers to hlist_head
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Alexander Stein
authored
on 17 Mar 2016
Sascha Hauer
committed
on 8 Apr 2016
|
2016-02-08 |
Merge branch 'for-next/linux-headers'
Sascha Hauer
committed
on 8 Feb 2016
|
2016-02-04 |
ubifs: Fix reading holes in files
...
When a whole block of 4KiB in an ubifs file is zero then the block is
not stored in the filesystem. read_block() returns -ENOENT in this case,
so this return value must be treated as success.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Feb 2016
|
2016-02-03 |
Introduce include/linux/mutex.h
...
Move mutex related defines to its original place.
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Yegor Yefremov
authored
on 27 Jan 2016
Sascha Hauer
committed
on 3 Feb 2016
|