The FIOC_FILEPATH ioctl needs rf->rf_path, which is not initialized for
dup'ed romfs file and cause problems.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
1. Update all CMakeLists.txt to adapt to new layout
2. Fix cmake build break
3. Update all new file license
4. Fully compatible with current compilation environment(use configure.sh or cmake as you choose)
------------------
How to test
From within nuttx/. Configure:
cmake -B build -DBOARD_CONFIG=sim/nsh -GNinja
cmake -B build -DBOARD_CONFIG=sim:nsh -GNinja
cmake -B build -DBOARD_CONFIG=sabre-6quad/smp -GNinja
cmake -B build -DBOARD_CONFIG=lm3s6965-ek/qemu-flat -GNinja
(or full path in custom board) :
cmake -B build -DBOARD_CONFIG=$PWD/boards/sim/sim/sim/configs/nsh -GNinja
This uses ninja generator (install with sudo apt install ninja-build). To build:
$ cmake --build build
menuconfig:
$ cmake --build build -t menuconfig
--------------------------
2. cmake/build: reformat the cmake style by cmake-format
https://github.com/cheshirekow/cmake_format
$ pip install cmakelang
$ for i in `find -name CMakeLists.txt`;do cmake-format $i -o $i;done
$ for i in `find -name *\.cmake`;do cmake-format $i -o $i;done
Co-authored-by: Matias N <matias@protobits.dev>
Signed-off-by: chao an <anchao@xiaomi.com>
since mmap may exist in block_operations, but truncate may not,
moving mmap beforee truncate could make three struct more compatible
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
- Add mmap into file_operations and remove it from ioctl definitions.
- Add mm_map structure definitions to support future unmapping
- Modify all drivers to initialize the operations struct accordingly
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
- Add truncate into file_operations
- Move truncate to be common for mountpt_operations and file_operations
- Modify all drivers to initialize the operations struct accordingly
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
1.Don't check the return value of nxsem_init or nxmutex_init
2.Fix some style issue
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
The default size of file cache is size of a sector, it may
not be good size for optimizing read/write speed in physical
device. So we can set the config according to speed test profile
to optimize access IO speed.
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
and implement all status related change function. the individual
file system change will provide in other upcoming patchset.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I8fde9db8eba9586e9c8da078b67e020c26623cf4
Note: all attributes is guarded by PSEUDOFS_ATTRIBUTES to save the space
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I664d60382e356068fd920f08aca5b4a49d8d92a9
This PR corrects an error in the ROMFS file system. The error occurred after following a hard link (depending on how the ROMFS image is organized). The error occurred because some of the information buffered before following the links was stale and, hence, out of sync after following the hard link. This would cause random errors when paths containing hardlinks were used with ROMFS.
This PR resolves Issue #1543. Please compare the following output with the output in Issue #1543 to see how the problem was resolved:
NuttShell (NSH) NuttX-9.1.0
nsh> mount
/etc type romfs
/proc type procfs
/tmp type vfat
nsh> ls -Rl /etc
/etc:
dr-xr-xr-x 0 .
dr-xr-xr-x 0 ..
-r-xr-xr-x 20 group
dr-xr-xr-x 0 init.d/
-r-xr-xr-x 35 passwd
/etc/init.d:
dr-xr-xr-x 0 .
dr-xr-xr-x 0 ..
-r-xr-xr-x 71 rcS
nsh> ls -l /etc/init.d
/etc/init.d:
dr-xr-xr-x 0 .
dr-xr-xr-x 0 ..
-r-xr-xr-x 71 rcS
nsh> ls -l /etc/init.d/.
/etc/init.d/.:
dr-xr-xr-x 0 .
dr-xr-xr-x 0 ..
-r-xr-xr-x 71 rcS
nsh> ls -l /etc/init.d/..
/etc/init.d/..:
dr-xr-xr-x 0 .
dr-xr-xr-x 0 ..
-r-xr-xr-x 20 group
dr-xr-xr-x 0 init.d/
-r-xr-xr-x 35 passwd
nsh> ls -l /etc/init.d/../.
/etc/init.d/../.:
dr-xr-xr-x 0 .
dr-xr-xr-x 0 ..
-r-xr-xr-x 20 group
dr-xr-xr-x 0 init.d/
-r-xr-xr-x 35 passwd
nsh>
Found by clang-check:
romfs/fs_romfs.c:431:7: warning: Value stored to 'bytesread' is never read
bytesread = 0;
^ ~
romfs/fs_romfs.c:455:11: warning: Value stored to 'sector' is never read
sector += nsectors;
^ ~~~~~~~~
2 warnings generated.