summaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* | Merge branch 'for-next/sparse'Sascha Hauer2012-07-021-5/+5
|\ \
| * | fs FAT: fix warning: Using plain integer as NULL pointerSascha Hauer2012-06-301-5/+5
| |/ | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2012-07-021-0/+6
|\ \
| * | fs/devfs.c: disallow write and erase if a partition is read-onlyJan Luebbe2012-06-301-0/+6
| |/ | | | | | | | | Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | partitions: Make 64bit capableSascha Hauer2012-06-301-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | make cdev 64bit capableSascha Hauer2012-06-303-7/+8
| | | | | | | | | | | | Next step to 64bit support: Make cdev size a 64bit type. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | use loff_t for file offsetsSascha Hauer2012-06-307-15/+15
| | | | | | | | | | | | | | This is a first step for 64bit file support: Make the file sizes/offsets 64bit. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: fix arguments to bad block ioctlsSascha Hauer2012-06-301-3/+3
|/ | | | | | | | | In the Kernel the mtd ioctls expect a pointer to the offset, whereas barebox interprets the pointer itself as an offset. Since we want to add 64bit support for file sizes a pointer may not be sufficient, so align with the kernel and convert it to a pointer to the offset. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs tftp: Fix short file transfersSascha Hauer2012-06-241-1/+2
| | | | | | | | | With files smaller than the tftp block size the whole transfer is done in tftp_do_open already. In this case we are in STATE_DONE, but there is no error. Set priv->err to 0 and check for it to be able to transfer small files. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: limit flash erase and protect to the partiton boundaryJohannes Stezenbach2012-06-071-10/+8
| | | | | | | | | | | | | 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>
* devfs: don't erase past the end of the partitionJohannes Stezenbach2012-06-071-0/+3
| | | | | | | | "erase /dev/myflash0.mypart 0xf0000+0xf0000" could erase past the end of the partition. Signed-off-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'next'Sascha Hauer2012-06-065-138/+1313
|\
| * lseek: return -1 instead of -errnoSascha Hauer2012-05-181-2/+2
| | | | | | | | | | | | | | | | | | | | 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>
| * ramfs: rember last accessed chunkJan Weitzel2012-05-161-10/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Writing big files takes longer and longer because of the chunk list By storing a pointer of the recent used chunk in the inode, access times are improved. Testet on with tftp 10M: OMAP4 chunk size 4096: 12244ms 8192: 4239ms patched 2647ms 2785ms i.MX35 chunk size 8192: 7225ms patched 2691ms No impact on much smaller files seen Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * fs readdir: check for NULL pointer againSascha Hauer2012-05-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This got lost in: commit 6188685091c58c9772b990cf0ca6ac522f97a9d0 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>
| * fs: Add NFS supportSascha Hauer2012-05-143-0/+1059
| | | | | | | | | | | | | | | | This patch adds readonly NFS support. Currently no links are supported. This is based on the previous U-Boot/NetBSD based code and some Kernel bits. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * Make errno a positive valueSascha Hauer2012-05-141-132/+218
| | | | | | | | | | | | | | | | | | 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>
* | fs tftp: depend on NET, not on NET_TFTPSascha Hauer2012-05-311-1/+1
| | | | | | | | | | | | | | The tftp filesystem support is by no means dependent on the old tftp support, it depends on NET though. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs/tftp: depend on NET_TFTPEric Bénard2012-05-171-0/+1
|/ | | | | | | else the option remains selected when network gets disabled Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* complete: add delpart complete supportJean-Christophe PLAGNIOL-VILLARD2012-04-301-0/+19
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge branch 'work/dns' into nextSascha Hauer2012-04-161-1/+1
|\
| * fs tftp: use resolv to resolv ip addressSascha Hauer2012-04-151-1/+1
| | | | | | | | | | | | | | instead of assuming the backingstore is a ip address, use resolv() to make it possible to pass in a hostname. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | automount: remove existing automountpointSascha Hauer2012-04-151-0/+2
| | | | | | | | | | | | | | Before creating a new mountpoint on an already existing mountpoint we have to remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | automount: Pass automount pass as environment variableSascha Hauer2012-04-151-4/+9
|/ | | | | | | | 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>
* FAT: Fix error pathSascha Hauer2012-03-182-6/+16
| | | | | | | - forward the return value of chk_mounted to detect whether mount succeeded - free resources on mount failure Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs open: pass error from statSascha Hauer2012-03-181-6/+6
| | | | | | | | 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>
* Add automount supportSascha Hauer2012-03-182-0/+122
| | | | | | | | | | | | | | 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>
* fs: drop struct mtab_entrySascha Hauer2012-03-171-45/+43
| | | | | | | | | | 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>
* fs: change get_fs_device_by_path prototypeSascha Hauer2012-03-171-34/+31
| | | | | | | | | | 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>
* fs: get fs device using container_ofSascha Hauer2012-02-256-11/+5
| | | | | | This reduces the usage of dev->type_data. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>