dlmalloc seems to work more efficient with this chunk size.
Copying a bigger file (3MB) takes 271ms vs. 125ms on a i.MX27
board. Even bigger chunk sizes do not further improve performance.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
cramfs does not compile since we updated zlib to the kernel
version. Fix this by using the kernel version of uncompress.c
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
For disk like devices attached to MCI, ATA or USB it depends on the order they
will be recognized. So an unique number for all disk like devices is required.
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
fat_stat in fs/fat.c declares finfo but doesn't initialize it.
When get_fileinfo is called, fno->lfname and fno->lfsize are
tested but haven't been zeroed...This can lead to a wrong
behavior.
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Mount without argument always print a "none" as device name mounted
because entry->parent_device is always NULL.
The problem is the mount function in fs/fs.c. parent_device is
initialized to NULL and never updated. With this patch,
parent_device is set with the mounted device name.
Moreover, the mount function has been modified to print the device
name plus device id using the dev_name function.
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Some ops do not handle read with count = 0 correctly. They do
not have to if this is catched in the upper layer.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This fixes a bug introduced with:
commit 74c36329c3
Author: Antony Pavlov <antonynpavlov@gmail.com>
Date: Tue Oct 18 13:48:44 2011 +0400
fs: fix path_check_prereq()
This patch makes impossible the situations than path_check_prereq() can make
'return 0' without changing errno.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
path_check_prereq is supposed to return 0 when a file does
not exist and S_UB_DOES_NOT_EXIST is given. stat() changes
errno, so we have to set errno back to 0 before returning.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch makes impossible the situations than path_check_prereq() can make
'return 0' without changing errno.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This code is based on:
http://elm-chan.org/fsw/ff/00index_e.html
FatFs Generic FAT File System Module
This patch offers a read/write implementation for barebox. The code
does not exaclty match barebox coding style, but works nicely and
should be ready to give it a try.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
If we register a device we have to unregister it later when
the driver did not accept the device. Also, do not forget to
free the backingstore string.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This makes it possible to compile without devfs. devfs_create/devfs_remove
is used by drivers and thus must still be present even without devfs support.
Also, this patch adds cdev_open/cdev_close/cdev_flush/cdev_ioctl calls to
work with devices without using the file api.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Otherwise we end up with errno not being set correctly
if a filesystem driver uses the standard open/close/read/write
functions to access its backing store.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We need to assign a new device id if we want to register
a fs with the same type of an already registered fstype.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch adds some basic file descriptor sanity checks to the file access
routines. Check whether the given file descriptor is in the files array range,
and whether the file entry is valid.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Strip /dev/ part of backing store before passing cdev_by_name, as
cramfs_probe() will otherwise always fail.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Add an open counter for device files so that we cannot accidently
remove an opened device. This happened with bb devices.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We can't truncate device files. Make sure that if we want to
write beyond the device that the bytes that still fit into the
device get written.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>