summaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
...
* common: Make sure arch-specific map_sysmem() is definedJoe Hershberger2015-04-181-0/+1
| | | | | | | | | | | In the case where the arch defines a custom map_sysmem(), make sure that including just mapmem.h is sufficient to have these functions as they are when the arch does not override it. Also split the non-arch specific functions out of common.h Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* fs: ext4 write: return file len on successPrzemyslaw Marczak2015-03-051-0/+3
| | | | | | | | | | | | After rework of the file system API, the size of ext4 write was missed. This causes printing unreliable write size at the end of the file system write operation. Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@nvidia.com>
* Merge branch 'master' of git://git.denx.de/u-boot-ubiTom Rini2015-02-047-24/+986
|\
| * ubifs: Enable journal replay during mountAnton Habegger2015-01-295-14/+978
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable ubifs_replay_journal during mount_ubifs, which was disabled before. This commit fix an issue with unrecoverable ubifs volumes after power cut. Therefor the gc.c is imported now from 1860e37 Linux 3.15 hs: added SPDX-License-Identifier for fs/ubifs/gc.c Signed-off-by: Anton Habegger <anton.habegger@gmail.com>
| * ubifs: Import atomic_long operations from LinuxAnton Habegger2015-01-282-10/+8
| | | | | | | | | | | | | | | | | | | | This commit is a preperation for a subsequent UBIFS commit which needs atomic_long operations. Therefor "include/asm-generic/atomic-long.h" is imported from 1860e37 Linux 3.15 Signed-off-by: Anton Habegger <anton.habegger@gmail.com>
* | fs: Add command to retrieve the filesystem typeSjoerd Simons2015-01-291-0/+27
|/ | | | | | | | New command to determine the filesystem type of a given partition. Optionally stores the filesystem type in a environment variable. Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Reviewed-by: Stephen Warren <swarren@nvidia.com>
* fs: fat: read: fix fat16 ls/read issuePrzemyslaw Marczak2015-01-051-18/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The present fat implementation ignores FAT16 long name directory entries which aren't placed in a single sector. This was becouse of the buffer was always filled by the two sectors, and the loop was made also for two sectors. If some file long name entries are stored in two sectors, the we have two cases: Case 1: Both of sectors are in the buffer - all required data for long file name is in the buffer. - Read OK! Case 2: The current directory entry is placed at the end of the second buffered sector. And the next entries are placed in a sector which is not buffered yet. Then two next sectors are buffered and the mentioned entry is ignored. - Read fail! This commit fixes this issue by: - read two sectors after loop on each single is done - keep the last used sector as a first in the buffer before the read of two next The commit doesn't affects the fat32 imlementation, which works good as previous. Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Mikhail Zolotaryov <lebon@lebon.org.ua> Cc: Tom Rini <trini@ti.com> Cc: Stephen Warren <swarren@nvidia.com> Cc: Simon Glass <sjg@chromium.org> Cc: Suriyan Ramasami <suriyan.r@gmail.com> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Wolfgang Denk <wd@denx.de> Tested-by: Simon Glass <sjg@chomium.org>
* fs/ext4/ext4fs.c, fs/fs.c fs/fat/fat_write.c: Adjust 64bit math methodsTom Rini2014-12-013-11/+16
| | | | | | | | | | | | The changes to introduce loff_t into filesize means that we need to do 64bit math on 32bit platforms. Make sure we use the right wrappers for these operations. Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Suriyan Ramasami <suriyan.r@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@ti.com> Tested-by: Pierre Aubert <p.aubert@staubli.com>
* fs: API changes enabling extra parameter to return size of type loff_tSuriyan Ramasami2014-11-234-87/+70
| | | | | | | | | | | | | | | The sandbox/ext4/fat/generic fs commands do not gracefully deal with files greater than 2GB. Negative values are returned in such cases. To handle this, the fs functions have been modified to take an additional parameter of type "* loff_t" which is then populated. The return value of the fs functions are used only for error conditions. Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com> Acked-by: Simon Glass <sjg@chromium.org> [trini: Update board/gdsys/p1022/controlcenterd-id.c, drivers/fpga/zynqpl.c for changes] Signed-off-by: Tom Rini <trini@ti.com>
* sandbox: Prepare API change for files greater than 2GBSuriyan Ramasami2014-11-231-23/+55
| | | | | | | | Change the internal sandbox functions to use loff_t for file offsets. Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
* ext4: Prepare API change for files greater than 2GBSuriyan Ramasami2014-11-234-28/+75
| | | | | | | | | Change the internal EXT4 functions to use loff_t for offsets. Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com> Acked-by: Simon Glass <sjg@chromium.org> [trini: Update common/spl/spl_ext.c] Signed-off-by: Tom Rini <trini@ti.com>
* fat: Prepare API change for files greater than 2GBSuriyan Ramasami2014-11-233-86/+113
| | | | | | | | | Change the internal FAT functions to use loff_t for offsets. Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com> Acked-by: Simon Glass <sjg@chromium.org> [trini: Fix fs/fat/fat.c for min3 updates] Signed-off-by: Tom Rini <trini@ti.com>
* fs: make it possible to read the filesystem UUIDChristian Gmeiner2014-11-232-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some filesystems have a UUID stored in its superblock. To allow using root=UUID=... for the kernel command line we need a way to read-out the filesystem UUID. changes rfc -> v1: - make the environment variable an option parameter. If not given, the UUID is printed out. If given, it is stored in the env variable. - corrected typos - return error codes changes v1 -> v2: - fix return code of do_fs_uuid(..) - document do_fs_uuid(..) - implement fs_uuid_unsuported(..) be more consistent with the way other optional functionality works changes v2 -> v3: - change ext4fs_uuid(..) to make use of #if .. #else .. #endif construct to get rid of unreachable code Hit any key to stop autoboot: 0 => fsuuid fsuuid - Look up a filesystem UUID Usage: fsuuid <interface> <dev>:<part> - print filesystem UUID fsuuid <interface> <dev>:<part> <varname> - set environment variable to filesystem UUID => fsuuid mmc 0:1 d9f9fc05-45ae-4a36-a616-fccce0e4f887 => fsuuid mmc 0:2 eb3db83c-7b28-499f-95ce-9e0bb21cda81 => fsuuid mmc 0:1 uuid1 => fsuuid mmc 0:2 uuid2 => printenv uuid1 uuid1=d9f9fc05-45ae-4a36-a616-fccce0e4f887 => printenv uuid2 uuid2=eb3db83c-7b28-499f-95ce-9e0bb21cda81 => Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Acked-by: Stephen Warren <swarren@nvidia.com>
* linux/kernel.h: sync min, max, min3, max3 macros with LinuxMasahiro Yamada2014-11-232-8/+7
| | | | | | | | | | | | | | | | | | | | U-Boot has never cared about the type when we get max/min of two values, but Linux Kernel does. This commit gets min, max, min3, max3 macros synced with the kernel introducing type checks. Many of references of those macros must be fixed to suppress warnings. We have two options: - Use min, max, min3, max3 only when the arguments have the same type (or add casts to the arguments) - Use min_t/max_t instead with the appropriate type for the first argument Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Pavel Machek <pavel@denx.de> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Tested-by: Lukasz Majewski <l.majewski@samsung.com> [trini: Fixup arch/blackfin/lib/string.c] Signed-off-by: Tom Rini <trini@ti.com>
* include: move various macros to include/linux/kernel.hMasahiro Yamada2014-11-201-4/+0
| | | | | | | | | | | | | | | | | | | | | | | U-Boot has imported various utility macros from Linux scattering them to various places without consistency. In include/common.h are min, max, min3, max3, ARRAY_SIZE, ALIGN, container_of, DIV_ROUND_UP, etc. In include/linux/compat.h are min_t, max_t, round_up, round_down, etc. We also have duplicated defines of min_t in some *.c files. Moreover, we are suffering from too cluttered include/common.h. This commit moves various macros that originate in include/linux/kernel.h of Linux to their original position. Note: This commit simply moves the macros; the macros roundup, min, max, min2, max3, ARRAY_SIZE are different from those of Linux at this point. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* ZFS: Clean up cppcheck warnings where relevant, leaked memory etcJorgen Lundman2014-11-101-1/+8
| | | | | | | | | | | | | | | | | | | | | In a message from Wolfgang Denk highlighting warnings from cppcheck, the patch will address those that are correctly diagnosed. Some are false-positives: > [fs/zfs/zfs.c:937]: (error) Memory leak: l dmu_read() allocates "l" if successful, so error-case should not free it. > [fs/zfs/zfs.c:1141]: (error) Memory leak: dnbuf dmu_read() allocates "dnbuf" if successful, so error-case should not free it. > [fs/zfs/zfs.c:1372]: (error) Memory leak: osp zio_read() allocates "osp" if successful, so error-case should not free it. > [fs/zfs/zfs.c:1726]: (error) Memory leak: nvlist int_zfs_fetch_nvlist() allocates "nvlist" if successful, so error-case should not free it. Signed-off-by: Jorgen Lundman <lundman@lundman.net>
* spl: Add EXT support to SPLGuillaume GARDET2014-10-271-0/+1
| | | | | | | | Add EXT filesystem support to SPL. Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr> [trini: Fix a warning and checkpatch problems] Signed-off-by: Tom Rini <trini@ti.com>
* ext4: Use inttypes for printf() stringSimon Glass2014-10-271-1/+2
| | | | | | | On 64-bit platforms (like sandbox) 64-bit integers may be 'long' rather than 'long long'. Use the inttypes header to avoid compiler warnings. Signed-off-by: Simon Glass <sjg@chromium.org>
* cosmetic: replace MIN, MAX with min, maxMasahiro Yamada2014-09-241-3/+3
| | | | | | | The macro MIN, MAX is defined as the aliase of min, max, respectively. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* kconfig: add blank Kconfig filesMasahiro Yamada2014-09-247-0/+19
| | | | | | | | This would be useful to start moving various config options. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* kbuild: force to define __UBOOT__ in all the C sourcesMasahiro Yamada2014-09-1619-19/+0
| | | | | | | | | | | | | | | | | | | | | | | U-Boot has imported various source files from other projects, mostly Linux. Something like #ifdef __UBOOT__ [ modification for U-Boot ] #else [ original code ] #endif is an often used strategy for clarification of adjusted parts, that is, easier re-sync in future. Instead of defining __UBOOT__ in each source file, passing it from the top Makefile would be easier. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Heiko Schocher <hs@denx.de>
* mtd,ubi,ubifs: sync with linux v3.15Heiko Schocher2014-08-251-2/+3
| | | | | | | | | | | | | | snyc with linux v3.15: commit 1860e379875dfe7271c649058aeddffe5afd9d0d Author: Linus Torvalds <torvalds@linux-foundation.org> Date: Sun Jun 8 11:19:54 2014 -0700 Linux 3.15 Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Scott Wood <scottwood@freescale.com> Cc: Tom Rini <trini@ti.com>
* mtd, ubi, ubifs: update for the sync with linux v3.14Heiko Schocher2014-08-251-0/+6
| | | | | | | | | | | | | while playing with the new mtd/ubi/ubifs sync, found some small updates for it: - add del_mtd_partition() to include/linux/mtd/mtd - mtd: add a debug_printf - remove some not used functions Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Scott Wood <scottwood@freescale.com> Cc: Tom Rini <trini@ti.com>
* mtd, ubi, ubifs: resync with Linux-3.14Heiko Schocher2014-08-2522-1934/+14456
| | | | | | | | | | | | | | | | | | | | resync ubi subsystem with linux: commit 455c6fdbd219161bd09b1165f11699d6d73de11c Author: Linus Torvalds <torvalds@linux-foundation.org> Date: Sun Mar 30 20:40:15 2014 -0700 Linux 3.14 A nice side effect of this, is we introduce UBI Fastmap support to U-Boot. Signed-off-by: Heiko Schocher <hs@denx.de> Signed-off-by: Tom Rini <trini@ti.com> Cc: Marek Vasut <marex@denx.de> Cc: Sergey Lapin <slapin@ossfans.org> Cc: Scott Wood <scottwood@freescale.com> Cc: Joerg Krause <jkrause@posteo.de>
* lib, linux: move linux specific defines to linux/compat.hHeiko Schocher2014-08-251-2/+0
| | | | | | | | | | | | | | | | - move linux specific defines from usb and video code into linux/compat.h - move common linux specific defines from include/ubi_uboot.h to linux/compat.h - add for new mtd/ubi/ubifs sync new needed linux specific defines to linux/compat.h Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Marek Vasut <marex@denx.de> Cc: Anatolij Gustschin <agust@denx.de> [trini: Add spin_lock_irqsave/spin_unlock_irqrestore dummies from usb/lin_gadet_compat.h] Signed-off-by: Tom Rini <trini@ti.com>
* fs: implement size/fatsize/ext4sizeStephen Warren2014-08-094-0/+58
| | | | | | | | | | These commands may be used to determine the size of a file without actually reading the whole file content into memory. This may be used to determine if the file will fit into the memory buffer that will contain it. In particular, the DFU code will use it for this purpose in the next commit. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* catch wrong load address passed to fatload / ext2loadPavel Machek2014-07-221-1/+4
| | | | | | | | If filename is passed instead of address to ext2load or fatload, u-boot silently accepts that, and uses 0 for load address and default filename from environment. That is confusing, display help instead. Signed-off-by: Pavel Machek <pavel@denx.de>
* yaffs2: preprocessor cleanupJeroen Hofstee2014-07-181-11/+10
| | | | | | | | | Current code uses the preprocessor to change an else case to a statement without any if condition at all. Although this works, change the optional code to return early, so all optional code is contained within a single #ifdef. Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* yaffs2: cosmetic: remove self assignmentsJeroen Hofstee2014-07-183-22/+1
| | | | | | | | | Remove self assignments which is just dead code to prevent compiler warnings about non used arguments. For u-boot this does not prevent any warning though, on the contrary it actual introduces warnings when compiling with clang. Remove them. Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* fs: ext4: fix writing zero-length filesStephen Warren2014-06-191-3/+1
| | | | | | | | | | | | | ext4fs_allocate_blocks() always allocates at least one block for a file. If the file size is zero, this causes total_remaining_blocks to underflow, which then causes an apparent hang while 2^32 blocks are allocated. To solve this, check that total_remaining_blocks is non-zero as part of the loop condition (i.e. before each loop) rather than at the end of the loop. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* jffs2:jffs2_1pass.c: remove double bracesJeroen Hofstee2014-06-111-1/+1
| | | | | | | | | Clang interpretes an if condition like  "if ((a = b) == NULL) as it tries to assign a value in a statement. Hence if you do "if ((something)) it warns you that you might be confused. Hence drop the double braces for plane if statements. Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* ext4: correctly zero filenameJeroen Hofstee2014-06-111-1/+1
| | | | | | | | | | | | Since ALLOC_CACHE_ALIGN_BUFFER declares a char* for filename sizeof(filename) is not the size of the buffer. Use the already known length instead. cc: Uma Shankar <uma.shankar@samsung.com> cc: Manjunatha C Achar <a.manjunatha@samsung.com> cc: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl> Acked-by: Marek Vasut <marex@denx.de>
* disk: part_efi: clarify lbaint_t usageSteve Rae2014-06-051-1/+1
| | | | | | | | | | - update the comments regarding lbaint_t usage - cleanup casting of values related to the lbaint_t type - cleanup of a type that requires a u64 Tested on little endian ARMv7 and ARMv8 configurations Signed-off-by: Steve Rae <srae@broadcom.com>
* fs/fat: correct FAT16/12 file finding in root dirWu, Josh2014-05-121-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | When write a file into FAT file system, it will search a match file in root dir. So the find_directory_entry() will get the first cluster of root dir content and search the directory item one by one. If the file is not found, we will call get_fatent_value() to get next cluster of root dir via lookup the FAT table and continue the search. The issue is in FAT16/12 system, we cannot get root dir's next clust from FAT table. The FAT table only be use to find the clust of data aera in FAT16/12. In FAT16/12 if the clust is in root dir, the clust number is a negative number or 0, 1. Since root dir is located in front of the data area. Data area start clust #2. So the root dir clust number should < 2. This patch will check above situation before call get_fatenv_value(). If curclust is < 2, include minus number, we just increase one on the curclust since root dir is in continous cluster. The patch also add a sanity check for entry in get_fatenv_value(). Signed-off-by: Josh Wu <josh.wu@atmel.com>
* fs: fat_write: fix the incorrect last cluster checkingWu, Josh2014-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | In fat_write.c, the last clust condition check is incorrect: if ((curclust >= 0xffffff8) || (curclust >= 0xfff8)) { ... ... } For example, in FAT32 if curclust is 0x11000. It is a valid clust. But on above condition check, it will be think as a last clust. So the correct last clust check should be: in fat32, curclust >= 0xffffff8 in fat16, curclust >= 0xfff8 in fat12, curclust >= 0xff8 This patch correct the last clust check. Signed-off-by: Josh Wu <josh.wu@atmel.com>
* fs:ext4:write:fix: Reinitialize global variables after updating a fileŁukasz Majewski2014-05-122-9/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug shows up when file stored on the ext4 file system is updated. The ext4fs_delete_file() is responsible for deleting file's (e.g. uImage) data. However some global data (especially ext4fs_indir2_block), which is used during file deletion are left unchanged. The ext4fs_indir2_block pointer stores reference to old ext4 double indirect allocated blocks. When it is unchanged, after file deletion, ext4fs_write_file() uses the same pointer (since it is already initialized - i.e. not NULL) to return number of blocks to write. This trunks larger file when previous one was smaller. Lets consider following scenario: 1. Flash target with ext4 formatted boot.img (which has uImage [*] on itself) 2. Developer wants to upload their custom uImage [**] - When new uImage [**] is smaller than the [*] - everything works correctly - we are able to store the whole smaller file with corrupted ext4fs_indir2_block pointer - When new uImage [**] is larger than the [*] - theCRC is corrupted, since truncation on data stored at eMMC was done. 3. When uImage CRC error appears, then reboot and LTHOR/DFU reflashing causes proper setting of ext4fs_indir2_block() and after that uImage[**] is successfully stored (correct uImage [*] metadata is stored at an eMMC on the first flashing). Due to above the bug was very difficult to reproduce. This patch sets default values for all ext4fs_indir* pointers/variables. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
* fs:ext4:cleanup: Remove superfluous codeŁukasz Majewski2014-05-122-41/+21
| | | | | | | | | Code responsible for handling situation when ext4 has block size of 1024B can be ordered to take less space. This patch does that for ext4 common and write files. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
* fs: ubifs: drop __DATE__ and __TIME__Masahiro Yamada2014-05-121-1/+0
| | | | | | | __DATE__ and __TIME__ makes the build non-deterministic. Drop the debug message using them. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* fs: fat: Fix cache align error message in fatwriteNobuhiro Iwamatsu2014-05-121-1/+1
| | | | | | | | | | Use of malloc of do_fat_write() causes cache error on ARM v7 platforms. Perhaps, the same problem will occur at any other CPUs. This replaces malloc with memalign to fix cache buffer alignment. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Yoshiyuki Ito <yoshiyuki.ito.ub@renesas.com> Tested-by: Hector Palacios <hector.palacios@digi.com>
* yaffs: Remove private list implementationSimon Glass2014-03-042-127/+1
| | | | | | | | | | | | | | | | | | U-Boot already has a list implementation, and files which include both that and the yaffs implementation will get errors: In file included from ydirectenv.h:80:0, from yportenv.h:81, from yaffs_guts.h:19, from yaffs_allocator.h:19, from yaffs_allocator.c:14: yaffs_list.h:32:8: error: redefinition of ‘struct list_head’ struct list_head { ^ Remove the yaffs implementation. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini2014-02-261-3/+0
|\ | | | | | | | | | | | | | | | | Conflicts: arch/arm/cpu/armv7/config.mk board/ti/am43xx/mux.c include/configs/am43xx_evm.h Signed-off-by: Tom Rini <trini@ti.com>
| * arm: Switch to -mno-unaligned-access when supported by the compilerTom Rini2014-02-261-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we tell the compiler to optimize for ARMv7 (and ARMv6 for that matter) it assumes a default of SCTRL.A being cleared and unaligned accesses being allowed and fast at the hardware level. We set this bit and must pass along -mno-unaligned-access so that the compiler will still breakdown accesses and not trigger a data abort. To better help understand the requirements of the project with respect to unaligned memory access, the Documentation/unaligned-memory-access.txt file has been added as doc/README.unaligned-memory-access.txt and is taken from the v3.14-rc1 tag of the kernel. Cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Cc: Mans Rullgard <mans@mansr.com> Signed-off-by: Tom Rini <trini@ti.com>
* | Revert "ext4fs: Add ext4 extent cache for read operations"Tom Rini2014-02-263-130/+73
| | | | | | | | | | | | | | | | | | | | This reverts commit fc0fc50f38a4d7d0554558076a79dfe8b0d78cd5. The author has asked on the mailing list that we revert this for now as it breaks write support. Reported-by: Łukasz Majewski <l.majewski@samsung.com> Signed-off-by: Tom Rini <trini@ti.com>
* | ubifs: fix checkpatch warningKaricheri, Muralidharan2014-02-211-0/+7
| | | | | | | | | | | | | | | | Fix the following checkpatch warning:- WARNING: externs should be avoided in .c files Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
* | ext4fs: Add ext4 extent cache for read operationsIonut Nicu2014-02-213-73/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In an ext4 filesystem, the inode corresponding to a file has a 60-byte area which contains an extent header structure and up to 4 extent structures (5 x 12 bytes). For files that need more than 4 extents to be represented (either files larger than 4 x 128MB = 512MB or smaller files but very fragmented), ext4 creates extent index structures. Each extent index points to a 4KB physical block where one extent header and additional 340 extents could be stored. The current u-boot ext4 code is very inefficient when it tries to load a file which has extent indexes. For each logical file block the code will read over and over again the same blocks of 4096 bytes from the disk. Since the extent tree in a file is always the same, we can cache the extent structures in memory before actually starting to read the file. This patch creates a simple linked list of structures holding information about all the extents used to represent a file. The list is sorted by the logical block number (ee_block) so that we can easily find the proper extent information for any file block. Without this patch, a 69MB file which had just one extent index pointing to a block with another 6 extents was read in approximately 3 minutes. With this patch applied the same file can be read in almost 20 seconds. Signed-off-by: Ionut Nicu <ioan.nicu.ext@nsn.com>
* | fs/fdos: RemoveTom Rini2014-02-2110-1488/+0
|/ | | | | | We have an unused FAT implementation in fs/fdos, remove. Signed-off-by: Tom Rini <trini@ti.com>
* kbuild: use Linux Kernel build scriptsMasahiro Yamada2014-02-192-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now we are ready to switch over to real Kbuild. This commit disables temporary scripts: scripts/{Makefile.build.tmp, Makefile.host.tmp} and enables real Kbuild scripts: scripts/{Makefile.build,Makefile.host,Makefile.lib}. This switch is triggered by the line in scripts/Kbuild.include -build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj +build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj We need to adjust some build scripts for U-Boot. But smaller amount of modification is preferable. Additionally, we need to fix compiler flags which are locally added or removed. In Kbuild, it is not allowed to change CFLAGS locally. Instead, ccflags-y, asflags-y, cppflags-y, CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o are prepared for that purpose. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Tested-by: Gerhard Sittig <gsi@denx.de>
* kbuild: change out-of-tree buildMasahiro Yamada2014-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the working directory where the build process occurs. Before this commit, build process occurred under the source tree for both in-tree and out-of-tree build. That's why we needed to add $(obj) prefix to all generated files in makefiles like follows: $(obj)u-boot.bin: $(obj)u-boot Here, $(obj) is empty for in-tree build, whereas it points to the output directory for out-of-tree build. And our old build system changes the current working directory with "make -C <sub-dir>" syntax when descending into the sub-directories. On the other hand, Kbuild uses a different idea to handle out-of-tree build and directory descending. The build process of Kbuild always occurs under the output tree. When "O=dir/to/store/output/files" is given, the build system changes the current working directory to that directory and restarts the make. Kbuild uses "make -f $(srctree)/scripts/Makefile.build obj=<sub-dir>" syntax for descending into sub-directories. (We can write it like "make $(obj)=<sub-dir>" with a shorthand.) This means the current working directory is always the top of the output directory. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Tested-by: Gerhard Sittig <gsi@denx.de>
* fat: implement exists() for FAT fsStephen Warren2014-02-192-5/+15
| | | | | | | | This hooks into the generic "file exists" support added in an earlier patch, and provides an implementation for the FAT filesystem. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
* ext4: implement exists() for ext4fsStephen Warren2014-02-192-1/+9
| | | | | | | | This hooks into the generic "file exists" support added in an earlier patch, and provides an implementation for the ext4 filesystem. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
OpenPOWER on IntegriCloud