summaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'pu/cramfs-fix' into nextSascha Hauer2011-12-052-59/+36
|\
| * fix cramfs support broken since zlib updateSascha Hauer2011-12-052-59/+36
| | | | | | | | | | | | | | 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>
* | ramfs: increase chunk size to 8192 bytesSascha Hauer2011-12-051-1/+1
|/ | | | | | | | 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>
* Merge branch 'master' into nextSascha Hauer2011-11-292-0/+9
|\ | | | | | | | | | | | | Conflicts: drivers/ata/disk_drive.c Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * fs/fat: Initialize local variable finfoFranck Jullien2011-11-171-0/+2
| | | | | | | | | | | | | | | | | | | | 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: Fix the printing of device nameFranck Jullien2011-11-111-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Create a unique cdev number for on demand devicesJuergen Beisert2011-11-281-0/+14
|/ | | | | | | | 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>
* fs: read: do not call read op when count is 0Sascha Hauer2011-11-091-0/+4
| | | | | | | 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>
* fix bug introduced with fixing path_check_prereq()Sascha Hauer2011-10-191-2/+6
| | | | | | | | | | | | | | | | | | | | | | This fixes a bug introduced with: commit 74c36329c3531acf59d76a09cd0c4cf11ce6b6a0 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>
* fs: fix chdir()Antony Pavlov2011-10-181-1/+2
| | | | | | | | 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>
* fs: fix path_check_prereq()Antony Pavlov2011-10-181-3/+4
| | | | | | | | 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>
* Merge branch 'next'Sascha Hauer2011-08-042-8/+9
|\
| * fs: switch to resourceJean-Christophe PLAGNIOL-VILLARD2011-07-302-5/+7
| | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
| * mem_read/write: use resourcesSascha Hauer2011-07-191-3/+2
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs/fat/ff.c: fix 'no previous prototype' warningsAntony Pavlov2011-08-031-4/+4
|/ | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: add fat filesystem supportSascha Hauer2011-04-1210-0/+3704
| | | | | | | | | | | | | | 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>
* fs mount: fix error handlingSascha Hauer2011-04-111-6/+13
| | | | | | | | 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>
* fs: use safe_strncpy instead of sprintfSascha Hauer2011-04-111-2/+3
| | | | | | This is safe against string overflows. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devfs: factor out core devfs functionalitySascha Hauer2011-04-113-165/+239
| | | | | | | | | 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>
* fs: implement flush functionSascha Hauer2011-04-112-0/+31
| | | | | | | Once we have caching in file functions we need a way to sync the the underlying devices. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devfs: remove unused struct filep* argument from open/closeSascha Hauer2011-04-111-2/+2
| | | | | | | the cdev layer is under the file layer, so it should not use struct filep*. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: remove unused field 'type' from struct fs_driver_dSascha Hauer2011-04-113-3/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: errno should be set correctly before the end of functionsSascha Hauer2011-04-041-2/+3
| | | | | | | | 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>
* ramfs: increase chunk size to 4 kbyteSascha Hauer2011-03-101-1/+1
| | | | | | This greatly increases speed on ramfs. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: fix multiple mount of the same fstypeSascha Hauer2011-01-081-0/+1
| | | | | | | 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>
* fs: Fix bug found by sparse.Marek Belisko2010-11-191-1/+1
| | | | | | | | Patch fix following sparse warning: fs/fs.c:757:28: warning: dubious: !x & y Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ramfs: sparse fixesSascha Hauer2010-10-211-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: add basic sanity check before accessing the files arrayBaruch Siach2010-07-281-0/+34
| | | | | | | | | 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>
* devfs: only check for ioctl function when neededSascha Hauer2010-07-051-8/+7
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add partition mtd supportSascha Hauer2010-07-052-0/+34
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cramfs: probe(): fix cdev lookupPeter Korsgaard2009-12-161-1/+1
| | | | | | | | 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>
* rename U-Boot-v2 project to bareboxSascha Hauer2009-12-152-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This has been done with the following script: find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \ -e 's/u2boot/barebox/g' \ -e 's/U2Boot/barebox/g' \ -e 's/U-boot V2/barebox/g' \ -e 's/u-boot v2/barebox/g' \ -e 's/U-Boot V2/barebox/g' \ -e 's/U-Boot-v2/barebox/g' \ -e 's/U_BOOT/BAREBOX/g' \ -e 's/UBOOT/BAREBOX/g' \ -e 's/uboot/barebox/g' \ -e 's/u-boot/barebox/g' \ -e 's/u_boot/barebox/g' \ -e 's/U-Boot/barebox/g' \ -e 's/U-boot/barebox/g' \ -e 's/U-BOOT/barebox/g' find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \ xargs -0 -r rename 's/u[-_]?boot/barebox/' It needs some manual fixup following in the next patch Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: replace broken dev_protect with protect_file functionSascha Hauer2009-10-021-0/+15
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devfs: fix return value for lseek in partitionsSascha Hauer2009-09-251-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devfs: add open counterSascha Hauer2009-09-111-7/+29
| | | | | | | 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>
* fs: write: fix writing on devicesSascha Hauer2009-07-301-3/+9
| | | | | | | | 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>
* reactivate cramfsSascha Hauer2009-07-211-80/+91
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* get rid of device idsSascha Hauer2009-07-212-18/+33
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* make sure ramfs/devfs are initialised when neededSascha Hauer2009-07-212-2/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Get rid of DEVICE_TYPE_FS usageSascha Hauer2009-07-214-16/+20
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devfs: add missing remove functionSascha Hauer2009-07-211-0/+5
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ramfs: add missing remove functionSascha Hauer2009-07-211-0/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce cdevSascha Hauer2009-07-212-58/+199
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove warningfredo2008-12-181-1/+1
| | | | | Signed-off-by: Frederic RODO <fred.rodo@gmail.com>
* fs: fix compiler warningSascha Hauer2008-08-261-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* implement memmap for mem driverSascha Hauer2008-08-141-1/+8
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lseek: return -1 for errors and check for that return valueSascha Hauer2008-08-012-6/+8
| | | | | | We cannot check for < 0 in lseek, otherwise we get problems with files > 0x7fffffff Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* [fs]: set errno correctly for ioctl()Sascha Hauer2008-06-251-3/+4
|
* - introduce ioctl callSascha Hauer2008-06-064-10/+74
| | | | - pass open/close/lseek through to drivers
* This is Kconfig cleanup patch (not all configurations will use CFI, SPI, ↵Menon, Nishanth2008-05-122-2/+12
| | | | | | | RAMFS and DEVFS). * Enable CFI and SPI drivers menuconfig option to be able to disable them in menuconfig. * Introduce capability to disable ramfs and devfs.