summaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
* Fix lseek on fat filesystems.Fargier Sylvain2013-09-181-0/+1
| | | | | | | | FILE object was not updated properly when seeking. Signed-off-by: Fargier Sylvain <sylvain.fargier@somfy.com> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2013-09-051-1/+1
|\
| * fs: tftp: don't duplicate timeout informationBaruch Siach2013-08-121-1/+1
| | | | | | | | | | Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs: Add ubifs supportSascha Hauer2013-08-0728-0/+15531
|/ | | | | | | | This adds ubifs support from u-boot-2013.07. This is taken mostly as-is, only the necessary adjustments to attach to the barebox fs layer have been made. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cdev: add device_find_partitionSascha Hauer2013-07-151-0/+27
| | | | | | | device_find_partition allows to find a partition of a device with a particular name. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cdev: allow to open a struct cdevSascha Hauer2013-07-151-5/+11
| | | | | | | cdev_open() opens a cdev by name. This introduces cdev_do_open which allows to open a cdev when the cdev is already found by other means. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cdev: introduce partition namesSascha Hauer2013-07-151-0/+3
| | | | | | | | currently most partition cdevs have the name <devname>.<partname> This makes it hard to find a partition by <partname>. This introduces a partname field in struct cdev so that. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devfs: let devfs_add_partition return the new partitionSascha Hauer2013-07-151-6/+6
| | | | | | Useful for unregistering later or for adding addional flags. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* read_file: Make it work on tftp servers which do not pass sizeSascha Hauer2013-06-202-1/+22
| | | | | | | | Some tftp servers (for example netkit-tftp) do not pass the filesize. Add a workaround for read_file which reads the file into a temporary file which then is copied to a buffer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/pr_print'Sascha Hauer2013-04-041-6/+6
|\
| * ext4: switch debug and printf to dev_xxxJean-Christophe PLAGNIOL-VILLARD2013-03-091-6/+6
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs: allocate FILE table dynamicallySascha Hauer2013-03-141-4/+7
|/ | | | | | | | | Some systems are runnignfrom a very limited SRAM, but have a huge malloc space in SDRAM. The bss normally is in SRAM, so we should avoid having big structures there. The FILE table is 5120 bytes big, so allocate it dynamically instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: add pread and pwrite functionsAlexander Aring2013-02-201-14/+74
| | | | | | | | | | | | | | | Add pread and pwrite functions. Split read and write functions to save some space. The functions pread and pwrite saves and sets the file position to a given offset and restore them afterwards. This also makes the nandtest command use these function which is necessary to not break compilation for the nandtest command. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: fix return type of readAlexander Aring2013-02-181-1/+1
| | | | | Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/oftree'Sascha Hauer2013-02-041-0/+19
|\ | | | | | | | | Conflicts: drivers/of/base.c
| * Add write_file functionSascha Hauer2013-01-191-0/+19
| | | | | | | | | | | | | | write_file() will write a buffer to a file. The file is created if necessary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2013-02-041-10/+11
|\ \
| * | tftp: reset timer on progressSascha Hauer2013-01-201-10/+11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | When during tftp receive operation a ACK packet can't successfully be sent the timer was resetted directly after send resulting in a deadlock. This patch changes the timer reset operation in a way that it is only resetted when the actually is progress, namely in the TFTP_ACK/TFTP_DATA pathes in the tftp handler. Reported-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Antony Pavlov <antonynpavlov@gmail.com>
* / treewide: fix format specifiersSascha Hauer2013-01-271-2/+2
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devfs & mtd: add MEMERASE ioctl supportWolfram Sang2012-12-191-1/+2
| | | | | | | | To make that, we need to shift mtd_erase before mtd_ioctl. ubi-utils need that, especially ubiformat. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers/base: fix corrupt device treeSascha Hauer2012-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_add_child is a very unsafe function. If called multiple times it allows setting the same device to different parents thus corrupting the siblings list. This happens regularly since: | commit c2e568d19c5c34a05a1002d25280bf113b72b752 | Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | Date: Sat Nov 3 16:11:05 2012 +0100 | | bus: add bus device | | automatically add it as parent of any bus device if none already specified | | we have now a nice output per bus If for example a FATfs is mounted this nice output per bus often ends with: > `---- fat0 > `---- 0 > `---- 0x86f0000087020031-0x86f000410df27124: /dev/<NULL> > `---- sram00 > `---- 0x00000000-0xffffffffffffffff: /dev/<NULL> > `---- 0x00000000-0xffffffffffffffff: /dev/<NULL> > unable to handle NULL pointer dereference at address 0x0000000c > pc : [<87f08a20>] lr : [<87f08a04>] > sp : 86eff8c0 ip : 87f3fbde fp : ffffffff > r10: ffffffff r9 : 00000000 r8 : 00000003 > r7 : 86f075b8 r6 : 00000002 r5 : ffffffec r4 : 86f07544 > r3 : 00000000 r2 : 43f900b4 r1 : 00000020 r0 : 00000005 > Flags: Nzcv IRQs off FIQs off Mode SVC_32 > [<87f08a20>] (do_devinfo_subtree+0x90/0x130) from [<87f08a90>] (do_devinfo_subtree+0x100/0x130) > > [<87f3e070>] (unwind_backtrace+0x0/0x90) from [<87f28514>] (panic+0x28/0x3c) > [<87f28514>] (panic+0x28/0x3c) from [<87f3e4b8>] (do_exception+0x10/0x14) > [<87f3e4b8>] (do_exception+0x10/0x14) from [<87f3e544>] (do_data_abort+0x2c/0x38) > [<87f3e544>] (do_data_abort+0x2c/0x38) from [<87f3e268>] (data_abort+0x48/0x60) This patch fixes this by adding a device to its parents children list in register_device so that dev_add_child is no longer needed. This function is removed from the tree. Now callers of register_device have to clearly set the parent *before* registering a device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reported-by: Jan Lübbe <jlu@pengutronix.de>
* fs: move dev_add_child before device_registerSascha Hauer2012-12-121-5/+5
| | | | | | Biology tells us that the parent is known before the child is born. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'kconfig'Sascha Hauer2012-12-081-1/+1
|\
| * Cleanup Kconfig filesAlexander Shiyan2012-12-081-1/+1
| | | | | | | | | | | | | | | | | | This patch provides a global cleanup barebox Kconfig files. This includes replacing spaces to tabs, formatting in accordance format, removing extraneous lines and spaces. No functional changes. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mem-commands'Sascha Hauer2012-12-071-1/+1
|\ \
| * | mem: add the swab (swap bytes) option to memory_display()Antony Pavlov2012-11-261-1/+1
| |/ | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / fs: implement initial ext4 support from U-BootSascha Hauer2012-12-0310-0/+1384
|/ | | | | | | | | | | | | | 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>
* omap4: add filesystem support over usb bootVicente2012-11-163-0/+225
| | | | | Signed-off-by: Vicente <vicencb@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/fs'Sascha Hauer2012-11-161-9/+18
|\
| * fs: improve robustnessVicente2012-10-081-9/+18
| | | | | | | | | | Signed-off-by: Vicente <vicencb@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs tftp: Fix possible fifo overflowSascha Hauer2012-10-241-1/+5
| | | | | | | | | | | | | | | | | | | | In tftp_read we send a request for a new packet without checking if we have enough space in the FIFO. This can lead to a FIFO overflow and a corrupt file. Add a check for it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Tested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
* | fs tftp: Only request a block onceSascha Hauer2012-10-241-0/+6
| | | | | | | | | | | | | | | | | | tftp_send is called often. Each time, when in STATE_RDATA, a packet is requested from the tftp server, even if we requested the same packet already. Stop this by tracking which packet we requested. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | devfs-core: add writesize in mtd partition ioctlAlexander Aring2012-10-231-0/+1
|/ | | | | | | Add writesize in mtd partition MEMGETINFO ioctl. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/remove-fsf-address'Sascha Hauer2012-10-037-21/+0
|\ | | | | | | | | | | Conflicts: drivers/net/miidev.c include/miidev.h
| * Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-177-21/+0
| | | | | | | | | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/fat-detection'Sascha Hauer2012-10-031-18/+19
|\ \
| * | fs/fat: Handle MBR on the first sectorFranck Jullien2012-09-201-18/+19
| |/ | | | | | | | | | | | | | | Use filetype to detect FAT boot sector. Add support for disk with MBR on the first sector. Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/driver'Sascha Hauer2012-10-031-0/+6
|\ \ | |/ |/|
| * driver: register busJean-Christophe PLAGNIOL-VILLARD2012-09-231-0/+6
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs: fs.c fix castAlexander Aring2012-09-111-2/+6
|/ | | | | | | Fix casting on min argument, to avoid warnings on 64bit build. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs/nfs: fix read when size < 1024Jean-Christophe PLAGNIOL-VILLARD2012-09-071-1/+5
| | | | | | | Currently we always request 1024. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/link'Sascha Hauer2012-09-053-41/+335
|\
| * nfs: add readlink supportJean-Christophe PLAGNIOL-VILLARD2012-09-051-28/+58
| | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
| * ramfs: add symlink and readlink supportJean-Christophe PLAGNIOL-VILLARD2012-09-051-6/+55
| | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
| * fs: introduce get_mounted_path to get the path where a file is mountedJean-Christophe PLAGNIOL-VILLARD2012-09-051-0/+9
| | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
| * fs: open: add symlink supportJean-Christophe PLAGNIOL-VILLARD2012-09-051-4/+11
| | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
| * fs: implement statJean-Christophe PLAGNIOL-VILLARD2012-09-051-0/+105
| | | | | | | | | | | | stat() stats the file pointed to by path and fills in buf. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
| * fs: add symlink supportJean-Christophe PLAGNIOL-VILLARD2012-09-051-0/+51
| | | | | | | | | | | | Limit it's support to existing file only Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
| * fs: rename stat to lstat as we implement lstatJean-Christophe PLAGNIOL-VILLARD2012-09-051-5/+5
| | | | | | | | | | | | | | For compatibility put a inline on lstat for stat until we have the symlink support. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
| * fs: fix rmdir with symlinkJean-Christophe PLAGNIOL-VILLARD2012-09-051-0/+6
| | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>