summaryrefslogtreecommitdiffstats
path: root/fs/fat
Commit message (Collapse)AuthorAgeFilesLines
* fs: let truncate take a loff_t argumentSascha Hauer2019-02-061-1/+1
| | | | | | | loff_t is the correct type for file sizes. Use it to allow to truncate to sizes bigger than 32bit. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: devfs: Change .lseek callbacks to return 'int'Andrey Smirnov2019-02-041-2/+2
| | | | | | | | | | | Returning requested offset from .lseek() callback doesn't really give us any new information while bringing unnecessary complications. Change all .lseek() types (both in struct struct cdev_operations and in struct fs_driver_d) to return 'int' and adjust the rest of the codebase accordingly. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: Update FILE position in lseek()Andrey Smirnov2019-01-291-1/+0
| | | | | | | | | | Instead on relying on driver callbacks to update 'pos' in FILE, do it as a part of lseek() code. This allows us to drop a bit of repeating code as well as making lseek() implementation consistent with write() and read(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs/fat: fix FAT32 detectionAlexander Kurz2019-01-041-5/+7
| | | | | | | | | | | | Limits for the number of clusters were used to determine the FAT fs type. This fails e.g. for FAT32 fs with low cluster number that can be found in certain Android images. Sync the FAT fs type detection to the method used in linux by checking the sectors/FAT entries at offset 0x16 (must be zero for FAT32) and offset 0x24 (must be non-zero for FAT32). Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: dentry cache implementationSascha Hauer2018-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | This adds the Linux dentry cache implementation to barebox. Until now every filesystem driver resolves the full path to a file for itself. This leads to code duplication and is error prone since resolving paths is a complicated task. Also it can narrow down the lookup performance since barebox only knows ASCII paths and has no way of caching lookups. With this patch we get the Linux dcache implementation. The path resolving code from fs/namei.c is nearly taken as-is, minus the RCU and locking code. Dcaching is made simple as of now: We simply cache everything and never release any dentries. Although we do reference counting for inodes and dentries it is effectively not used yet. We never free anything until a fs is unmounted in which case we free everything no matter if references are taken or not. This patch also contains a wrapper in fs/legacy.c to support filesystems with the old API. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: fat: fix copy-paste typoAntony Pavlov2016-02-231-2/+2
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: fix 'new blank line at EOF' formatting errorAntony Pavlov2015-07-021-1/+0
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: rename inode member of struct filep to privSascha Hauer2015-03-091-6/+6
| | | | | | | Because that's what it is. 'inode' will become confusing once we support real inodes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fat: Use correct format specifierSascha Hauer2014-07-111-2/+2
| | | | | | Use %zd to print size_t arguments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: cleanup backingstore handlingSascha Hauer2013-09-291-13/+4
| | | | | | | | | | | All filesystem drivers which need a backingstore device do the same ignoring of '/dev/' in the backingstore followed by a cdev_open. Add a helper function for it and let the core handle the cdev. As a side effect this makes sure that fsdev->cdev is also set when a device is mounted without the leading '/dev/' which was previously ignored by the mount code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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/remove-fsf-address'Sascha Hauer2012-10-031-3/+0
|\ | | | | | | | | | | Conflicts: drivers/net/miidev.c include/miidev.h
| * Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-3/+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>
* | 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>
* fs/fat: add filetypeJean-Christophe PLAGNIOL-VILLARD2012-09-041-0/+1
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* 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>
* | use loff_t for file offsetsSascha Hauer2012-06-301-3/+3
|/ | | | | | | This is a first step for 64bit file support: Make the file sizes/offsets 64bit. 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: get fs device using container_ofSascha Hauer2012-02-251-2/+1
| | | | | | This reduces the usage of dev->type_data. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fat: revert fat caching mechanismSascha Hauer2012-02-151-73/+20
| | | | | | | | There seems to be a bug in this mechanism. It's easy to get the cached fat out of sync with the device. Revert it for now. This includes a huge write performance drop. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fat fs: Fix compile warningSascha Hauer2012-01-051-1/+1
| | | | 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>
* 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-128-0/+3701
| | | | | | | | | | | | | | 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>
* remove uncompilable filesystemsSascha Hauer2007-09-213-1265/+0
|
* svn_rev_003Sascha Hauer2007-07-051-3/+0
| | | | remove all #if 0 and #if 1
* Move "ar" flags to config.mk to allow for silent "make -s"Wolfgang Denk2006-10-091-1/+1
| | | | Based on patch by Mike Frysinger, 20 Jun 2006
* Add support for a saving build objects in a separate directory.Marian Balakowicz2006-09-011-8/+7
| | | | | | | | | | | | | | | | | | | | | Modifications are based on the linux kernel approach and support two use cases: 1) Add O= to the make command line 'make O=/tmp/build all' 2) Set environement variable BUILD_DIR to point to the desired location 'export BUILD_DIR=/tmp/build' 'make' The second approach can also be used with a MAKEALL script 'export BUILD_DIR=/tmp/build' './MAKEALL' Command line 'O=' setting overrides BUILD_DIR environent variable. When none of the above methods is used the local build is performed and the object files are placed in the source directory.
* Cleanup for GCC-4.xWolfgang Denk2005-10-131-1/+1
|
* Add support for Altera NIOS DK1C20 boardWolfgang Denk2005-08-061-0/+3
| | | | Patch by Shlomo Kut, 13 Dec 2004
* "static" from "do_fat_read" removedstroese2004-12-161-1/+1
|
* * Patches by Sean Chang, 09 Aug 2004:wdenk2004-09-291-1/+1
| | | | | | | | | | | | - Added support for both 8 and 16 bit mode access to System ACE CF through MPU. - Fixed missing System ACE CF device during get FAT partition info in fat_register_device function. - Enabled System ACE CF support on ML300. * Patch by Sean Chang, 09 Aug 2004: Synch defines for saveenv and do_saveenv functions so they get compiled under the same statement.
* * Patches by Travis Sawyer, 12 Mar 2004:wdenk2004-03-141-0/+4
| | | | | | | | | | | | | | | | | | | | | - Fix Gigabit Ethernet support for 440GX - Add Gigabit Ethernet Support to MII PHY utilities * Patch by Brad Kemp, 12 Mar 2004: Fixes for drivers/cfi_flash.c: - Better support for x8/x16 implementations - Added failure for AMD chips attempting to use CFG_FLASH_USE_BUFFER_WRITE - Added defines for AMD command and address constants * Patch by Leon Kukovec, 12 Mar 2004: Fix get_dentfromdir() to correctly handle deleted dentries * Patch by George G. Davis, 11 Mar 2004: Remove hard coded network settings in TI OMAP1610 H2 default board config * Patch by George G. Davis, 11 Mar 2004: add support for ADS GraphicsClient+ board.
* * Patch by Markus Pietrek, 24 Feb 2004:wdenk2004-02-261-1/+2
| | | | | | | | | | | | | NS9750 DevBoard added * Patch by Pierre AUBERT, 24 Feb 2004 add USB support for MPC5200 * Patch by Steven Scholz, 24 Feb 2004: - fix MII commands to use values from last command * Patch by Torsten Demke, 24 Feb 2004: Add support for the eXalion platform (SPSW-8240, F-30, F-300)
* * Patch by Thomas Elste, 10 Feb 2004:wdenk2004-02-231-5/+6
| | | | | | | | | | | | | | Add support for NET+50 CPU and ModNET50 board * Patch by Sam Song, 10 Feb 2004: Fix typos in cfi_flash.c * Patch by Leon Kukovec, 10 Feb 2004 Fixed long dir entry slot id calculation in get_vfatname * Patch by Robin Gilks, 10 Feb 2004: add "itest" command (operators: -eq, -ne, -lt, -gt, -le, -ge, ==, !=, <>, <, >, <=, >=)
* * Patches by David Müller, 14 Nov 2003:wdenk2003-12-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - board/mpl/common/common_util.c * implement support for BZIP2 compressed images * various cleanups (printf -> puts, ...) - board/mpl/common/flash.c * report correct errors to upper layers * check the erase fail and VPP low bits in status reg - board/mpl/vcma9/cmd_vcma9.c - board/mpl/vcma9/flash.c * various cleanups (printf -> puts, ...) - common/cmd_usb.c * fix typo in comment - cpu/arm920t/usb_ohci.c * support for S3C2410 is missing in #if line - drivers/cs8900.c * reinit some registers in case of error (cable missing, ...) - fs/fat/fat.c * support for USB/MMC devices is missing in #if line - include/configs/MIP405.h - include/configs/PIP405.h * enable BZIP2 support * enlarge malloc space to 1MiB because of BZIP2 support - include/configs/VCMA9.h * enable BZIP2 support * enlarge malloc space to 1MiB because of BZIP2 support * enable USB support - lib_arm/armlinux.c * change calling convention of ARM Linux kernel as described on http://www.arm.linux.org.uk/developer/booting.php * Patch by Thomas Lange, 14 Nov 2003: Split dbau1x00 into dbau1000, dbau1100 and dbau1500 configs to support all these AMD boards. * Patch by Thomas Lange, 14 Nov 2003: Workaround for mips au1x00 physical memory accesses (the au1x00 uses a 36 bit bus internally and cannot access physical memory directly. Use the uncached SDRAM address instead of the physical one.)
* * Prepare for releasewdenk2003-10-291-17/+12
| | | | | | | | | * Fix problems in memory test on some boards (which was not non-destructive as intended) * Patch by Gary Jennejohn, 28 Oct 2003: Change fs/fat/fat.c to put I/O buffers in BSS instead on the stack to prevent stack overflow on ARM systems
* * Patch by Martin Krause, 09 Oct 2003:wdenk2003-10-091-0/+5
| | | | | | | | | | | | | Fixes for TRAB board - /board/trab/rs485.c: correct baudrate - /board/trab/cmd_trab.c: bug fix for problem with timer overflow in udelay(); fix some timing problems with adc controller - /board/trab/trab_fkt.c: add new commands: gain, eeprom and power; modify commands: touch and buzzer * Disable CONFIG_SUPPORT_VFAT when used with CONFIG_AUTO_UPDATE (quick & dirty workaround for rogue pointer problem in get_vfatname()); Use direct function calls for auto_update instead of hush commands
* * Patch by Gary Jennejohn, 11 Sep 2003:wdenk2003-09-111-2/+4
| | | | | | | | | | | - allow for longer timeouts for USB mass storage devices * Patch by Denis Peter, 11 Sep 2003: - fix USB data pointer assignment for bulk only transfer. - prevent to display erased directories in FAT filesystem. * Change output format for NAND flash - make it look like for other memory, too
* * Patches by Denis Peter, 9 Sep 2003:wdenk2003-09-101-41/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | add FAT support for IDE, SCSI and USB * Patches by Gleb Natapov, 2 Sep 2003: - cleanup of POST code for unsupported architectures - MPC824x locks way0 of data cache for use as initial RAM; this patch unlocks it after relocation to RAM and invalidates the locked entries. * Patch by Gleb Natapov, 30 Aug 2003: new I2C driver for mpc107 bridge. Now works from flash. * Patch by Dave Ellis, 11 Aug 2003: - JFFS2: fix typo in common/cmd_jffs2.c - JFFS2: fix CFG_JFFS2_SORT_FRAGMENTS option - JFFS2: remove node version 0 warning - JFFS2: accept JFFS2 PADDING nodes - SXNI855T: add AM29LV800 support - SXNI855T: move environment from EEPROM to flash - SXNI855T: boot from JFFS2 in NOR or NAND flash * Patch by Bill Hargen, 11 Aug 2003: fixes for I2C on MPC8240 - fix i2c_write routine - fix iprobe command - eliminates use of global variables, plus dead code, cleanup.
* * Code cleanup:wdenk2003-06-271-3/+3
| | | | | | | | | - remove trailing white space, trailing empty lines, C++ comments, etc. - split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c) * Patches by Kenneth Johansson, 25 Jun 2003: - major rework of command structure (work done mostly by Michal Cendrowski and Joakim Kristiansen)
* * Fix CONFIG_NET_MULTI support in include/net.hwdenk2003-06-153-0/+1155
* Patches by Kyle Harris, 13 Mar 2003: - Add FAT partition support - Add command support for FAT - Add command support for MMC ---- - Add Intel PXA support for video - Add Intel PXA support for MMC ---- - Enable MMC and FAT for lubbock board - Other misc changes for lubbock board