f8240ce9 | 11-Sep-2018 |
AKASHI Takahiro <takahiro.akashi@linaro.org> |
fs: fat: support unlink
In this patch, unlink support is added to FAT file system. A directory can be deleted only if it is empty.
In this implementation, only a directory entry for a short file na
fs: fat: support unlink
In this patch, unlink support is added to FAT file system. A directory can be deleted only if it is empty.
In this implementation, only a directory entry for a short file name will be removed. So entries for a long file name can and should be reclaimed with fsck.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
31a18d57 | 11-Sep-2018 |
AKASHI Takahiro <takahiro.akashi@linaro.org> |
fs: fat: support mkdir
In this patch, mkdir support is added to FAT file system. A newly created directory contains only "." and ".." entries.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro
fs: fat: support mkdir
In this patch, mkdir support is added to FAT file system. A newly created directory contains only "." and ".." entries.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
3a10e072 | 11-Sep-2018 |
AKASHI Takahiro <takahiro.akashi@linaro.org> |
fs: fat: remember the starting cluster number of directory
The starting cluster number of directory is needed to initialize ".." (parent directory) entry when creating a new directory.
Signed-off-b
fs: fat: remember the starting cluster number of directory
The starting cluster number of directory is needed to initialize ".." (parent directory) entry when creating a new directory.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
e7074cff | 11-Sep-2018 |
AKASHI Takahiro <takahiro.akashi@linaro.org> |
fs: add mkdir interface
"mkdir" interface is added to file operations. This is a preparatory change as mkdir support for FAT file system will be added in next patch.
Signed-off-by: AKASHI Takahiro
fs: add mkdir interface
"mkdir" interface is added to file operations. This is a preparatory change as mkdir support for FAT file system will be added in next patch.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
cb8af8af | 11-Sep-2018 |
AKASHI Takahiro <takahiro.akashi@linaro.org> |
fs: fat: support write with non-zero offset
In this patch, all the necessary code for allowing for a file offset at write is implemented. What plays a major roll here is get_set_cluster(), which, in
fs: fat: support write with non-zero offset
In this patch, all the necessary code for allowing for a file offset at write is implemented. What plays a major roll here is get_set_cluster(), which, in contrast to its counterpart, set_cluster(), only operates on already-allocated clusters, overwriting with data.
So, with a file offset specified, set_contents() seeks and writes data with set_get_cluster() until the end of a file, and, once it reaches there, continues writing with set_cluster() for the rest.
Please note that a file will be trimmed as a result of write operation if write ends before reaching file's end. This is an intended behavior in order to maintain compatibility with the current interface.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
704df6aa | 11-Sep-2018 |
AKASHI Takahiro <takahiro.akashi@linaro.org> |
fs: fat: refactor write interface for a file offset
The current write implementation is quite simple: remove existing clusters and then allocating new ones and filling them with data. This, inevitab
fs: fat: refactor write interface for a file offset
The current write implementation is quite simple: remove existing clusters and then allocating new ones and filling them with data. This, inevitably, enforces always writing from the beginning of a file.
As the first step to lift this restriction, fat_file_write() and set_contents() are modified to accept an additional parameter, file offset and further re-factored so that, in the next patch, all the necessary code will be put into set_contents().
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
4ced2039 | 11-Sep-2018 |
AKASHI Takahiro <takahiro.akashi@linaro.org> |
fs: fat: support write with sub-directory path
In this patch, write implementation is overhauled and rewritten by making full use of directory iterator. The obvious bonus is that we are now able to
fs: fat: support write with sub-directory path
In this patch, write implementation is overhauled and rewritten by making full use of directory iterator. The obvious bonus is that we are now able to write to a file with a directory path, like /A/B/C/FILE.
Please note that, as there is no notion of "current directory" on u-boot, a file name specified must contain an absolute directory path. Otherwise, "/" (root directory) is assumed.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
f1149cea | 11-Sep-2018 |
AKASHI Takahiro <takahiro.akashi@linaro.org> |
fs: fat: write returns error code instead of -1
It would be good that FAT write function return error code instead of just returning -1 as fat_read_file() does. This patch attempts to address this i
fs: fat: write returns error code instead of -1
It would be good that FAT write function return error code instead of just returning -1 as fat_read_file() does. This patch attempts to address this issue although it is 'best effort (or estimate)' for now.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
25bb9dab | 11-Sep-2018 |
AKASHI Takahiro <takahiro.akashi@linaro.org> |
fs: fat: check and normalize file name
FAT file system's long file name support is a bit complicated and has some restrictions on its naming. We should be careful about it especially for write as it
fs: fat: check and normalize file name
FAT file system's long file name support is a bit complicated and has some restrictions on its naming. We should be careful about it especially for write as it may easily end up with wrong file system.
normalize_longname() check for the rules and normalize a file name if necessary. Please note, however, that this function is yet to be extended to fully comply with the standard.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
881042ef | 11-Sep-2018 |
AKASHI Takahiro <takahiro.akashi@linaro.org> |
Revert "fs: fat: cannot write to subdirectories"
This reverts commit 0dc1bfb7302d220a48364263d5632d6d572b069b. The succeeding patch series will supersede it.
Signed-off-by: AKASHI Takahiro <takahir
Revert "fs: fat: cannot write to subdirectories"
This reverts commit 0dc1bfb7302d220a48364263d5632d6d572b069b. The succeeding patch series will supersede it.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
f528c140 | 11-Sep-2018 |
AKASHI Takahiro <takahiro.akashi@linaro.org> |
fs: fat: assure iterator's ->dent belongs to ->clust
In my attempt to re-work write operation, it was revealed that iterator's "clust" does not always point to a cluster to which a current directory
fs: fat: assure iterator's ->dent belongs to ->clust
In my attempt to re-work write operation, it was revealed that iterator's "clust" does not always point to a cluster to which a current directory entry ("dent") belongs. This patch assures that it is always true by adding "next_clust" which is used solely for dereferencing a cluster chain.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
b94b6be5 | 11-Sep-2018 |
AKASHI Takahiro <takahiro.akashi@linaro.org> |
fs: fat: handle "." and ".." of root dir correctly with fat_itr_resolve()
FAT's root directory does not have "." nor ".." So care must be taken when scanning root directory with fat_itr_resolve(). W
fs: fat: handle "." and ".." of root dir correctly with fat_itr_resolve()
FAT's root directory does not have "." nor ".." So care must be taken when scanning root directory with fat_itr_resolve(). Without this patch, any file path starting with "." or ".." will not be resolved at all.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
f8c987f8 | 05-Jun-2018 |
Alexey Brodkin <Alexey.Brodkin@synopsys.com> |
lib: Add hexdump
Often during debugging session it's very interesting to see what data we were dealing with. For example what we write or read to/from memory or peripherals.
This change introduces
lib: Add hexdump
Often during debugging session it's very interesting to see what data we were dealing with. For example what we write or read to/from memory or peripherals.
This change introduces functions that allow to dump binary data with one simple function invocation like: ------------------->8---------------- print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, buf, len); ------------------->8----------------
which gives us the following: ------------------->8---------------- 00000000: f2 b7 c9 88 62 61 75 64 72 61 74 65 3d 31 31 35 ....baudrate=115 00000010: 32 30 30 00 62 6f 6f 74 61 72 67 73 3d 63 6f 6e 200.bootargs=con 00000020: 73 6f 6c 65 3d 74 74 79 53 33 2c 31 31 35 32 30 sole=ttyS3,11520 00000030: 30 6e 38 00 62 6f 6f 74 64 65 6c 61 79 3d 33 00 0n8.bootdelay=3. 00000040: 62 6f 6f 74 66 69 6c 65 3d 75 49 6d 61 67 65 00 bootfile=uImage. 00000050: 66 64 74 63 6f 6e 74 72 6f 6c 61 64 64 72 3d 39 fdtcontroladdr=9 00000060: 66 66 62 31 62 61 30 00 6c 6f 61 64 61 64 64 72 ffb1ba0.loadaddr 00000070: 3d 30 78 38 32 30 30 30 30 30 30 00 73 74 64 65 =0x82000000.stde 00000080: 72 72 3d 73 65 72 69 61 6c 30 40 65 30 30 32 32 rr=serial0@e0022 00000090: 30 30 30 00 73 74 64 69 6e 3d 73 65 72 69 61 6c 000.stdin=serial 000000a0: 30 40 65 30 30 32 32 30 30 30 00 73 74 64 6f 75 0@e0022000.stdou 000000b0: 74 3d 73 65 72 69 61 6c 30 40 65 30 30 32 32 30 t=serial0@e00220 000000c0: 30 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00.............. ... ------------------->8----------------
Source of hexdump.c was copied from Linux kernel v4.7-rc2.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Anatolij Gustschin <agust@denx.de> Cc: Mario Six <mario.six@gdsys.cc> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Cc: Stefan Roese <sr@denx.de>
show more ...
|