summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs (follow)
Commit message (Collapse)AuthorAgeFilesLines
* imfs: Replace devfs with an IMFS specializationSebastian Huber2020-03-0911-485/+163
| | | | | | | | | | | | | | | | Add a simplified path evaluation function IMFS_eval_path_devfs() for a device only IMFS configuration. The code size can be further reduced by the application if it disables the support for legacy IO drivers via: #define CONFIGURE_IMFS_DISABLE_MKNOD #define CONFIGURE_IMFS_DISABLE_MKNOD_DEVICE Obsolete CONFIGURE_MAXIMUM_DEVICES. Remove BSP_MAXIMUM_DEVICES. Update #3894. Update #3898.
* imfs: Simplify code generationSebastian Huber2020-03-091-11/+17
| | | | Update #3894.
* imfs: Remove unused handlersSebastian Huber2020-03-091-6/+1
| | | | Update #3894.
* imfs: Constify imfs_memfile_bytes_per_blockSebastian Huber2020-03-092-37/+0
| | | | | | | | The CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK value is validated by <rtems/confdefs/libio.h>. Changing this value during runtime could lead to memory corruption. Update #3894.
* imfs: Use _IMFS_get_time()Sebastian Huber2020-03-091-6/+5
| | | | Update #3894.
* imfs: Add IMFS_add_node()Sebastian Huber2020-03-043-5/+162
| | | | Update #3894.
* imfs: Simplify IMFS_create_node()Sebastian Huber2020-03-041-3/+4
| | | | Update #3894.
* imfs: Remove IMFS_NODE_FLAG_NAME_ALLOCATEDSebastian Huber2020-03-042-14/+39
| | | | | | | | Remove IMFS_NODE_FLAG_NAME_ALLOCATED and instead replace the node control in rename operations. This avoids a special case in the general node destruction which pulled in free(). Update #3894.
* cpukit/libfs: remove more dead code from pipe/fifo.cGedare Bloom2020-01-031-2/+0
| | | | | Dead code identified by Coverity (CID 1456674). The value of ret at line 358 is always 0.
* cpukit/libfs: remove dead code from pipe/fifo.cGedare Bloom2020-01-031-2/+0
| | | | | Dead code identified by Coverity (CID 1456678). The value of ret at line 293 is always 0.
* pipe: Use condition variablesSebastian Huber2019-12-111-49/+17
| | | | | | | Use self-contained condition variables instead of Classic API barriers. This simplifies the implementation and configuration. Update #3840.
* untar: Unify untar supportSebastian Huber2019-11-251-142/+55
| | | | Update #3823.
* imfs: Fix IMFS_make_linearfile()Sebastian Huber2019-11-211-2/+2
| | | | | | | | Fix prototype. Fix node size. Linfiles are dynamically turned into memfiles. Update #3823.
* imfs: Add IMFS_make_linfile()Sebastian Huber2019-11-194-20/+105
| | | | Update #3818.
* dosfs: Fix format with media block sizes > 512Sebastian Huber2019-10-011-47/+46
|
* doxygen: Added groups to IO libraryAndreas Dachsberger2019-04-023-3/+3
| | | | Update #3706.
* libfs/src/pipe/fifo.c: Fix warning.Joel Sherrill2019-03-251-2/+0
|
* fifo.c: Eliminate logically dead code (Coverity 1437635)Joel Sherrill2019-03-141-8/+5
|
* Remove explicit file names from @fileSebastian Huber2019-02-281-1/+1
| | | | | | This makes the @file documentation independent of the actual file name. Update #3707.
* fs: Add struct dirent::d_type supportSebastian Huber2019-02-055-4/+29
|
* Fix format warnings due to ino_t changesSebastian Huber2019-01-101-1/+2
|
* Spelling and grammar fixes in source code comments (GCI 2018)Marçal Comajoan Cara2018-12-042-2/+2
|
* 5 spelling errors for a Google Code-In task.Jacob Shin2018-12-021-1/+1
| | | | Username: deuteriumoxide Email: jacobshin313@gmail.com
* dosfs: Fix device identifierSebastian Huber2018-11-271-1/+1
| | | | Update #3358.
* pipe/fifo.c: Remove dead code (CID 1437649)Joel Sherrill2018-11-221-1/+0
| | | | Closes #3581.
* build: Merge libfs/Makefile.amSebastian Huber2018-10-102-176/+0
|
* jffs2: Avoid use of constant register variableSebastian Huber2018-10-051-0/+12
| | | | | Avoid the use of a constant register variable which is used in some conditions. This gets rid of a clang -Wsometimes-uninitialized warning.
* Remove superfluous pipe_create()Sebastian Huber2018-10-041-1/+4
|
* Use rtems_task_exit()Sebastian Huber2018-10-021-1/+1
| | | | | Update #3530. Update #3533.
* network: Use kernel/user space header filesSebastian Huber2018-09-101-1/+0
| | | | | | | | | | Add and use <machine/rtems-bsd-kernel-space.h> and <machine/rtems-bsd-user-space.h> similar to the libbsd to avoid command line defines and defines scattered throught the code base. Simplify cpukit/libnetworking/Makefile.am. Update #3375.
* nfsclient: Fix unused variable warningSebastian Huber2018-09-071-1/+0
|
* dosfs: Avoid deprecated routineSebastian Huber2018-08-074-2/+5
| | | | Update #3358.
* rfs: Remove erroneous call of rtems_disk_release()Sebastian Huber2018-08-071-1/+0
| | | | | | | The function rtems_rfs_buffer_sync() erroneously calls rtems_disk_release(). This screws up the reference counting of the disk. Close #3484.
* jffs2: Rename README to VERSIONSebastian Huber2018-07-191-0/+0
| | | | | | | This makes it easer to find files describing an upstream version, e.g. via "find -name VERSION". Update #3465.
* jffs2: Add READMESebastian Huber2018-07-161-0/+35
| | | | | | | Add README to document the corrspending Linux version and the update procedure. Close #3465.
* mtd: Unconditionally update ->fail_addr and ->addr in part_erase()Boris Brezillon2018-07-161-1/+0
| | | | | | | | | | | | | | | | | ->fail_addr and ->addr can be updated no matter the result of parent->_erase(), we just need to remove the code doing the same thing in mtd_erase_callback() to avoid adjusting those fields twice. Note that this can be done because all MTD users have been converted to not pass an erase_info->callback() and are thus only taking the ->addr_fail and ->addr fields into account after part_erase() has returned. While we're at it, get rid of the erase_info->mtd field which was only needed to let mtd_erase_callback() get the partition device back. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Richard Weinberger <richard@nod.at>
* mtd: Stop assuming mtd_erase() is asynchronousBoris Brezillon2018-07-161-31/+5
| | | | | | | | | | None of the mtd->_erase() implementations work in an asynchronous manner, so let's simplify MTD users that call mtd_erase(). All they need to do is check the value returned by mtd_erase() and assume that != 0 means failure. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Richard Weinberger <richard@nod.at>
* jffs2: fix spelling mistake: "requestied" -> "requested"Colin Ian King2018-07-161-1/+1
| | | | | | | | trivial fix to spelling mistake in JFFS2_ERROR message Signed-off-by: Colin Ian King <colin.king@canonical.com> [Brian: also fix 'an' -> 'a'] Signed-off-by: Brian Norris <computersforpeace@gmail.com>
* sched/headers: Prepare to move signal wakeup & sigpending methods from ↵Ingo Molnar2018-07-162-1/+1
| | | | | | | | | | | | | <linux/sched.h> into <linux/sched/signal.h> Fix up affected files that include this signal functionality via sched.h. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
* jffs2: Remove jffs2_{get,set,remove}xattr macrosAndreas Gruenbacher2018-07-161-6/+0
| | | | | | | | | | When CONFIG_JFFS2_FS_XATTR is off, jffs2_xattr_handlers is defined as NULL. With sb->s_xattr == NULL, the generic_{get,set,remove}xattr functions produce the same result as setting the {get,set,remove}xattr inode operations to NULL, so there is no need for these macros. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* vfs: make the string hashes salt the hashLinus Torvalds2018-07-165-6/+7
| | | | | | | | | | | | | | | | | | We always mixed in the parent pointer into the dentry name hash, but we did it late at lookup time. It turns out that we can simplify that lookup-time action by salting the hash with the parent pointer early instead of late. A few other users of our string hashes also wanted to mix in their own pointers into the hash, and those are updated to use the same mechanism. Hash users that don't have any particular initial salt can just use the NULL pointer as a no-salt. Cc: Vegard Nossum <vegard.nossum@oracle.com> Cc: George Spelvin <linux@sciencehorizons.net> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macrosKirill A. Shutemov2018-07-164-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time ago with promise that one day it will be possible to implement page cache with bigger chunks than PAGE_SIZE. This promise never materialized. And unlikely will. We have many places where PAGE_CACHE_SIZE assumed to be equal to PAGE_SIZE. And it's constant source of confusion on whether PAGE_CACHE_* or PAGE_* constant should be used in a particular case, especially on the border between fs and mm. Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much breakage to be doable. Let's stop pretending that pages in page cache are special. They are not. The changes are pretty straight-forward: - <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>; - <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>; - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN}; - page_cache_get() -> get_page(); - page_cache_release() -> put_page(); This patch contains automated changes generated with coccinelle using script below. For some reason, coccinelle doesn't patch header files. I've called spatch for them manually. The only adjustment after coccinelle is revert of changes to PAGE_CAHCE_ALIGN definition: we are going to drop it later. There are few places in the code where coccinelle didn't reach. I'll fix them manually in a separate patch. Comments and documentation also will be addressed with the separate patch. virtual patch @@ expression E; @@ - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT) + E @@ expression E; @@ - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) + E @@ @@ - PAGE_CACHE_SHIFT + PAGE_SHIFT @@ @@ - PAGE_CACHE_SIZE + PAGE_SIZE @@ @@ - PAGE_CACHE_MASK + PAGE_MASK @@ expression E; @@ - PAGE_CACHE_ALIGN(E) + PAGE_ALIGN(E) @@ expression E; @@ - page_cache_get(E) + get_page(E) @@ expression E; @@ - page_cache_release(E) + put_page(E) Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Acked-by: Michal Hocko <mhocko@suse.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* jffs2: Improve post-mount CRC scan efficiencyDavid Woodhouse2018-07-163-25/+45
| | | | | | | | | | | | | | | | | We need to finish doing the CRC checks before we can allow writes to happen, and we currently process the inodes in order. This means a call to jffs2_get_ino_cache() for each possible inode# up to c->highest_ino. There may be a lot of lookups which fail, if the inode# space is used sparsely. And the inode# space is *often* used sparsely, if a file system contains a lot of stuff that was put there in the original image, followed by lots of creation and deletion of new files. Instead of processing them numerically with a lookup each time, just walk the hash buckets instead. [fix locking typo reported by Dan Carpenter] Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* Fix directory hardlinks from deleted directoriesDavid Woodhouse2018-07-162-19/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | When a directory is deleted, we don't take too much care about killing off all the dirents that belong to it — on the basis that on remount, the scan will conclude that the directory is dead anyway. This doesn't work though, when the deleted directory contained a child directory which was moved *out*. In the early stages of the fs build we can then end up with an apparent hard link, with the child directory appearing both in its true location, and as a child of the original directory which are this stage of the mount process we don't *yet* know is defunct. To resolve this, take out the early special-casing of the "directories shall not have hard links" rule in jffs2_build_inode_pass1(), and let the normal nlink processing happen for directories as well as other inodes. Then later in the build process we can set ic->pino_nlink to the parent inode#, as is required for directories during normal operaton, instead of the nlink. And complain only *then* about hard links which are still in evidence even after killing off all the unreachable paths. Reported-by: Liu Song <liu.song11@zte.com.cn> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Cc: stable@vger.kernel.org
* jffs2: Fix page lock / f->sem deadlockDavid Woodhouse2018-07-161-7/+10
| | | | | | | | | | With this fix, all code paths should now be obtaining the page lock before f->sem. Reported-by: Szabó Tamás <sztomi89@gmail.com> Tested-by: Thomas Betker <thomas.betker@rohde-schwarz.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Cc: stable@vger.kernel.org
* tree wide: use kvfree() than conditional kfree()/vfree()Tetsuo Handa2018-07-163-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are many locations that do if (memory_was_allocated_by_vmalloc) vfree(ptr); else kfree(ptr); but kvfree() can handle both kmalloc()ed memory and vmalloc()ed memory using is_vmalloc_addr(). Unless callers have special reasons, we can replace this branch with kvfree(). Please check and reply if you found problems. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Acked-by: Michal Hocko <mhocko@suse.com> Acked-by: Jan Kara <jack@suse.com> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Acked-by: "Rafael J. Wysocki" <rjw@rjwysocki.net> Acked-by: David Rientjes <rientjes@google.com> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: Boris Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* jffs2: fix a memleak in read_direntry()Wei Fang2018-07-161-1/+5
| | | | | | | | Need to free the memory allocated for 'fd' if failed to read all of the remainder name. Signed-off-by: Wei Fang <fangwei1@huawei.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
* jffs2: fix unbalanced lockingBrian Norris2018-07-161-23/+4
| | | | | | | | | | | | | | | | | | | Li Zefan reported an unbalanced locking issue, found by his internal debugging feature on runtime. The particular case he was looking at doesn't lead to a deadlock, as the structure that this lock is embedded in is freed on error. But we should straighten out the error handling. Because several callers of jffs2_do_read_inode_internal() / jffs2_do_read_inode() already handle the locking/unlocking and inode clearing at their own level, let's just push any unlocks/clearing down to the caller. This consistency is much easier to verify. Reported-by: Li Zefan <lizefan@huawei.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
* jffs2: fix handling of corrupted summary lengthChen Jie2018-07-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sm->offset maybe wrong but magic maybe right, the offset do not have CRC. Badness at c00c7580 [verbose debug info unavailable] NIP: c00c7580 LR: c00c718c CTR: 00000014 REGS: df07bb40 TRAP: 0700 Not tainted (2.6.34.13-WR4.3.0.0_standard) MSR: 00029000 <EE,ME,CE> CR: 22084f84 XER: 00000000 TASK = df84d6e0[908] 'mount' THREAD: df07a000 GPR00: 00000001 df07bbf0 df84d6e0 00000000 00000001 00000000 df07bb58 00000041 GPR08: 00000041 c0638860 00000000 00000010 22084f88 100636c8 df814ff8 00000000 GPR16: df84d6e0 dfa558cc c05adb90 00000048 c0452d30 00000000 000240d0 000040d0 GPR24: 00000014 c05ae734 c05be2e0 00000000 00000001 00000000 00000000 c05ae730 NIP [c00c7580] __alloc_pages_nodemask+0x4d0/0x638 LR [c00c718c] __alloc_pages_nodemask+0xdc/0x638 Call Trace: [df07bbf0] [c00c718c] __alloc_pages_nodemask+0xdc/0x638 (unreliable) [df07bc90] [c00c7708] __get_free_pages+0x20/0x48 [df07bca0] [c00f4a40] __kmalloc+0x15c/0x1ec [df07bcd0] [c01fc880] jffs2_scan_medium+0xa58/0x14d0 [df07bd70] [c01ff38c] jffs2_do_mount_fs+0x1f4/0x6b4 [df07bdb0] [c020144c] jffs2_do_fill_super+0xa8/0x260 [df07bdd0] [c020230c] jffs2_fill_super+0x104/0x184 [df07be00] [c0335814] get_sb_mtd_aux+0x9c/0xec [df07be20] [c033596c] get_sb_mtd+0x84/0x1e8 [df07be60] [c0201ed0] jffs2_get_sb+0x1c/0x2c [df07be70] [c0103898] vfs_kern_mount+0x78/0x1e8 [df07bea0] [c0103a58] do_kern_mount+0x40/0x100 [df07bec0] [c011fe90] do_mount+0x240/0x890 [df07bf10] [c0120570] sys_mount+0x90/0xd8 [df07bf40] [c00110d8] ret_from_syscall+0x0/0x4 === Exception: c01 at 0xff61a34 LR = 0x100135f0 Instruction dump: 38800005 38600000 48010f41 4bfffe1c 4bfc2d15 4bfffe8c 72e90200 4082fc28 3d20c064 39298860 8809000d 68000001 <0f000000> 2f800000 419efc0c 38000001 mount: mounting /dev/mtdblock3 on /common failed: Input/output error Signed-off-by: Chen Jie <chenjie6@huawei.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* jffs2: compr_rubin: Remove unused functionRickard Strandqvist2018-07-161-5/+0
| | | | | | | | | | Remove the function pulledbits() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Reviewed-by: Richard Weinberger <richard@nod.at> Signed-off-by: Brian Norris <computersforpeace@gmail.com>