2012-06-07 |
fs: limit flash erase and protect to the partiton boundary
...
Passing a too large size or offset to erase could
affect flash outside the partition boundary.
Addresses for SPI flash wrap around, thus giving a
count + offset going past the end of the flash would
wrap around and erase flash at offset 0.
Add the same check for protect.
Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Johannes Stezenbach
authored
on 6 Jun 2012
Sascha Hauer
committed
on 7 Jun 2012
|
2012-05-18 |
lseek: return -1 instead of -errno
...
The patch making errno a positive value has another bug:
lseek was switched to return -errno instead of -1. This does not
work since we can lseek we can address the whole 4G address space,
have of which has a negative offset when interpreted as a signed
integer. Let lseek return -1 on failure again instead.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 18 May 2012
|
2012-05-14 |
fs readdir: check for NULL pointer again
...
This got lost in:
commit 6188685
Author: Sascha Hauer <s.hauer@pengutronix.de>
Date: Sun May 13 12:43:58 2012 +0200
Make errno a positive value
Normally errno contains a positive error value. A certain unnamed developer
mixed this up while implementing U-Boot-v2. Also, normally errno is never
set to zero by any library function.
This patch fixes this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 May 2012
|
Make errno a positive value
...
Normally errno contains a positive error value. A certain unnamed developer
mixed this up while implementing U-Boot-v2. Also, normally errno is never
set to zero by any library function.
This patch fixes this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 May 2012
|
2012-04-15 |
automount: remove existing automountpoint
...
Before creating a new mountpoint on an already existing mountpoint
we have to remove it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 Apr 2012
|
automount: Pass automount pass as environment variable
...
This makes it possible to pass a command sequence to the automount
command instead of only a script (a command sequence would get confused
by the additional argument)
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 Apr 2012
|
2012-03-18 |
fs open: pass error from stat
...
We used to simply answer with -ENOENT in open() when the
initial call to stat() failed. Instead, forward the error from
stat().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 18 Mar 2012
|
Add automount support
...
This patch adds an automount command which makes it possible
to execute a script when a certain directory is first accessed.
It's the commands responsibility to make this directory available
(bringing devices up and mounting it). This results in automount
support which makes sure that from the shell every file can
be accessed without having to care for device bringup. Bringing
up devices may be expensive (USB, dhcp). The automount support
makes it easy for the environment to bringup devices when they
are actually needed.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 18 Mar 2012
|
2012-03-17 |
fs: drop struct mtab_entry
...
every struct fs_device_d contains a struct mtab_entry, so they
have a 1:1 relationship. Instead of having to use container_of
to get from a struct mtab_entry to a struct fs_device_d we can
better embed the members of struct mtab_entry into struct fs_device_d
directly.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 17 Mar 2012
|
fs: change get_fs_device_by_path prototype
...
get_fs_device_by_path returns a struct device_d instead of what the
name suggests a struct fs_device_d. Also it returns the rootpath
of the corresponding fs_device. This patch changes the name of
this function to get_fs_device_and_root_path to better reflect what
the function does and changes the return type to struct fs_device_d.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 17 Mar 2012
|
2012-02-25 |
fs: get fs device using container_of
...
This reduces the usage of dev->type_data.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 25 Feb 2012
|
fs: get fs driver using container_of
...
This reduces the usage of dev->type_data.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 25 Feb 2012
|
2012-02-17 |
fs: allow to mount on subdirectories
...
Since get_mtab_entry_by_path() is a bit more flexible now
we no longer have to force the user to mount on the root
directory only. Instead, we can allow to mount on subdirectories
aswell. Nested mounts are still not possible though.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 17 Feb 2012
|
fs: put fs devices on its own bus
...
By putting the fs devices/drivers on a bus on its own we can hook
into the bus remove function to cleanup the fs device. This way
we can unmount a device by simply unregistering the device which
is useful for for example USB mass storage devices. These can now
unregister the assoiated filesystems by unregistering their child
devices.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 17 Feb 2012
|
fs: remove fs devices list
...
We store the fs devices in a list only because we want to
check if the fs driver needs a backingstore or not. The
driver will bail out anyway if it needs a backingstore and
doesn't find one. So we can remove this check and thus remove
the list of fs devices.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 17 Feb 2012
|
fs: remove only once used variable
...
dev is used only once, so make the code a tiny bit simpler by
not using an extra variable but dereference it when needed directly.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 17 Feb 2012
|
fs: simplify get_mtab_entry_by_path
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 17 Feb 2012
|
fs: remove unused function fsdev_get_mountpoint
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 17 Feb 2012
|
fs: Store mtab path in allocated string
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 17 Feb 2012
|
fs: make locally used function get_mtab_entry_by_path static
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 17 Feb 2012
|
fs: Store mtab entries in list
...
To make the code a bit easier to read. Also, do not allow
to umount / when something else is mounted.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 17 Feb 2012
|
2011-11-11 |
mount: Fix the printing of device name
...
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>
Franck Jullien
authored
on 9 Nov 2011
Sascha Hauer
committed
on 11 Nov 2011
|
2011-11-09 |
fs: read: do not call read op when count is 0
...
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>
Sascha Hauer
committed
on 9 Nov 2011
|
2011-10-19 |
fix bug introduced with fixing path_check_prereq()
...
This fixes a bug introduced with:
commit 74c3632
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>
Sascha Hauer
committed
on 19 Oct 2011
|
2011-10-18 |
fs: fix chdir()
...
chdir() allocates memory using mormalise_path(). But if path_check_prereq()
returns error than memory isn't freed.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Antony Pavlov
authored
on 18 Oct 2011
Sascha Hauer
committed
on 18 Oct 2011
|
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>
Antony Pavlov
authored
on 18 Oct 2011
Sascha Hauer
committed
on 18 Oct 2011
|
2011-07-29 |
fs: switch to resource
...
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Jean-Christophe PLAGNIOL-VILLARD
committed
on 29 Jul 2011
|
2011-07-18 |
mem_read/write: use resources
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
authored
on 19 Jul 2011
Jean-Christophe PLAGNIOL-VILLARD
committed
on 18 Jul 2011
|
2011-04-11 |
fs mount: fix error handling
...
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>
Sascha Hauer
committed
on 11 Apr 2011
|
fs: use safe_strncpy instead of sprintf
...
This is safe against string overflows.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Apr 2011
|