summaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
* 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>
| * fs: add readlink supportJean-Christophe PLAGNIOL-VILLARD2012-09-051-0/+37
| | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | fs/fat: add filetypeJean-Christophe PLAGNIOL-VILLARD2012-09-041-0/+1
| | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | fs/mount: add autodetection type supportJean-Christophe PLAGNIOL-VILLARD2012-09-042-1/+34
|/ | | | | | if NULL is pass as type mount will try to autodetect the filesystem type Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* fs nfs: depend on netSascha Hauer2012-07-251-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: fix standard zero, full devicesSascha Hauer2012-07-042-5/+6
| | | | | | | | | | | | | | | | The standard devices are currently broken since they have the size ~0. As now files use loff_t as file size which is a signed type the read implementation gets confused and now returns -1. The current implementation also has the (somewhat theorical) problem that we do not have real streaming devices, so /dev/zero went out of zeroes after reading 4GB (or now LLONG_MAX). This patch introduces a new cdev flag DEVFS_IS_CHARACTER_DEV and a new file size flag FILE_SIZE_STREAM which makes it possible to create real stream devices instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/resource-size'Sascha Hauer2012-07-022-3/+3
|\ | | | | | | | | | | Conflicts: drivers/base/resource.c fs/fs.c
| * resource: store 'end' instead of 'size' in struct resourceSascha Hauer2012-07-012-3/+3
| | | | | | | | | | | | | | | | | | | | Storing the size instead of the resource end in struct resource was a mistake. 'size' ranges from 0 to UINT[32|64]_MAX + 1 which obviously leads to problems. 'end' on the other hand will never exceed UINT[32|64]_MAX. Also this way we can express a iomem region covering the whole address space. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/fs'Sascha Hauer2012-07-021-0/+30
|\ \
| * | fs: Fix file create bug when parent is not a directorySascha Hauer2012-06-301-0/+30
| |/ | | | | | | | | | | | | When creating a file or a directory we have to check if the parent is actually a directory. Otherwise trying it results in a crash. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>