1. 11 Sep, 2015 5 commits
  2. 06 Mar, 2015 1 commit
  3. 01 Dec, 2014 1 commit
  4. 23 Nov, 2014 4 commits
  5. 27 Oct, 2014 1 commit
  6. 24 Sep, 2014 1 commit
  7. 09 Aug, 2014 1 commit
    • Stephen Warren's avatar
      fs: implement size/fatsize/ext4size · cf659819
      Stephen Warren authored
      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: default avatarStephen Warren <swarren@nvidia.com>
      cf659819
  8. 19 Jun, 2014 1 commit
    • Stephen Warren's avatar
      fs: ext4: fix writing zero-length files · d0180280
      Stephen Warren authored
      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: default avatarStephen Warren <swarren@nvidia.com>
      d0180280
  9. 11 Jun, 2014 1 commit
  10. 12 May, 2014 2 commits
    • Łukasz Majewski's avatar
      fs:ext4:write:fix: Reinitialize global variables after updating a file · 8b454eee
      Łukasz Majewski authored
      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: default avatarLukasz Majewski <l.majewski@samsung.com>
      8b454eee
    • Łukasz Majewski's avatar
      fs:ext4:cleanup: Remove superfluous code · 35dd055b
      Łukasz Majewski authored
      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: default avatarLukasz Majewski <l.majewski@samsung.com>
      35dd055b
  11. 26 Feb, 2014 1 commit
  12. 21 Feb, 2014 1 commit
    • Ionut Nicu's avatar
      ext4fs: Add ext4 extent cache for read operations · fc0fc50f
      Ionut Nicu authored
      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: default avatarIonut Nicu <ioan.nicu.ext@nsn.com>
      fc0fc50f
  13. 19 Feb, 2014 1 commit
  14. 20 Jan, 2014 4 commits
  15. 17 Nov, 2013 1 commit
  16. 31 Oct, 2013 1 commit
  17. 24 Jul, 2013 1 commit
  18. 22 Jul, 2013 1 commit
  19. 15 Jul, 2013 1 commit
    • Frederic Leroy's avatar
      Fix ext2/ext4 filesystem accesses beyond 2TiB · 04735e9c
      Frederic Leroy authored
      With CONFIG_SYS_64BIT_LBA, lbaint_t gets defined as a 64-bit type,
      which is required to represent block numbers for storage devices that
      exceed 2TiB (the block size usually is 512B), e.g. recent hard drives
      
      We now use lbaint_t for partition offset to reflect the lbaint_t change,
      and access partitions beyond or crossing the 2.1TiB limit.
      This required changes to signature of ext4fs_devread(), and type of all
      variables relatives to block sector.
      
      ext2/ext4 fs uses logical block represented by a 32 bit value. Logical
      block is a multiple of device block sector. To avoid overflow problem
      when calling ext4fs_devread(), we need to cast the sector parameter.
      Signed-off-by: default avatarFrédéric Leroy <fredo@starox.org>
      04735e9c
  20. 24 May, 2013 1 commit
  21. 10 May, 2013 1 commit
  22. 01 Apr, 2013 1 commit
    • York Sun's avatar
      Consolidate bool type · 472d5460
      York Sun authored
      'bool' is defined in random places. This patch consolidates them into a
      single header file include/linux/types.h, using stdbool.h introduced in C99.
      
      All other #define, typedef and enum are removed. They are all consistent with
      true = 1, false = 0.
      
      Replace FALSE, False with false. Replace TRUE, True with true.
      Skip *.py, *.php, lib/* files.
      Signed-off-by: default avatarYork Sun <yorksun@freescale.com>
      472d5460
  23. 04 Mar, 2013 2 commits
  24. 07 Dec, 2012 4 commits
  25. 29 Oct, 2012 1 commit
    • Stephen Warren's avatar
      fs: separate CONFIG_FS_{FAT, EXT4} from CONFIG_CMD_{FAT, EXT*} · 03e2ecf6
      Stephen Warren authored
      This makes the FAT and ext4 filesystem implementations build if
      CONFIG_FS_{FAT,EXT4} are defined, rather than basing the build on
      whether CONFIG_CMD_{FAT,EXT*} are defined. This will allow the
      filesystems to be built separately from the filesystem-specific commands
      that use them. This paves the way for the creation of filesystem-generic
      commands that used the filesystems, without requiring the filesystem-
      specific commands.
      
      Minor documentation changes are made for this change.
      
      The new config options are automatically selected by the old config
      options to retain backwards-compatibility.
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      Reviewed-by: default avatarBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
      03e2ecf6