Commit Graph

160 Commits

Author SHA1 Message Date
Erdem Meydanli
20ef084712 Fix the indentation and spacing that don't conform to the coding standard. 2020-05-28 12:22:23 -06:00
Erdem Meydanli
7f018e7898 fs/nfs/nfs_proto.h: Use of uint64_t in the data types breaks NFS functionality.
The use of uint64_t primitive type in NFS structures forces the compiler to align data on an 8-byte boundary.
As a result of this, unwanted gaps being created, which causes NFS to fail. (e.g., nfs_read/initialize the request)
Using nfsuint64 instead of uint64_t fixes this issue.
2020-05-28 12:22:23 -06:00
Gregory Nutt
fefd893b65 fs/nfs/nfs_util.c: Fix compilation error
The build gets broken when both the NFS and DEBUG_FS_ERROR configurations enabled. This tiny change fixes the compilation error.

Run file through nxstyle and correct issues.

NOTE:  This line:

    /* This logic just supports "//" sequences in the path name */

generates the false alarm error:

    fs/nfs/nfs_util.c:84:39: error: C++ style comment
2020-05-25 13:45:28 -06:00
Xiang Xiao
23668a4b9b build: Remove the empty variable assignment
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 08:24:13 -06:00
Gregory Nutt
ae401cecdd Check return from nxsem_wait_initialize()
Resolution of Issue 619 will require multiple steps, this part of the first step in that resolution:  Every call to nxsem_wait_uninterruptible() must handle the return value from nxsem_wait_uninterruptible properly.  This commit is only for those files under fs/driver, fs/aio, fs/nfs, crypto/, and boards/.

Please note:  The modified file under fs/nfs generates several " Mixed case identifier found" errors.  Please ignore these.  These cannot be fixed without changes to numerous other files.  They also follow a non-standard convention that is used many files:  Using lower case structure names in custom SIZEOF_ definitions.
2020-03-30 17:09:45 +01:00
Gregory Nutt
2b532ae4a8 fs/: Remove support for CONFIG_FS_READABLE 2020-03-22 08:24:07 -05:00
Gregory Nutt
7a871e2f29 fs/: Remove support for CONFIG_FS_WRITABLE 2020-03-22 08:24:07 -05:00
Ouss4
ae060e1d98 fs/nfs/nfs_vfsops.c: Run nxstyle against the file. 2020-03-07 17:44:27 +00:00
Xiang Xiao
9836d17f3f nfs: fix warning: 'byteswritten' may be used uninitialized 2020-03-07 17:29:11 +00:00
Xiang Xiao
de480b01b6 fs/nfs: Add the simplest RPCAUTH_UNIX support
Since most NFS server disable RPCAUTH_NULL to improve the security
2020-03-02 15:04:20 -06:00
Xiang Xiao
7794214a7d fs/nfs: Support both IPv6 and TCP
And correctly handle the retransmission
2020-03-02 15:04:07 -06:00
Xiang Xiao
6c77829940 fs/nfs: Should return the partial transfer bytes in nfs_read/nfs_write 2020-03-02 15:03:53 -06:00
Xiang Xiao
915f094a74 NFS bug fix and improvement (#412)
* fs/nfs: Remove all nfs_checkmount call.  The check just waste cpu cycle since nobody will set nm_mounted to false, and remove the unused fields(nm_mounted and n_flags) and related flags too
* fs/nfs: Fix the definition not confirm to RFC 1813 and other minor issue(unused, typo, duplication, alignment...)
* fs/nfs: Always represent error with negative number and remove the unused arguments from function
* fs/nfs: Set socket receive timeout with nfs_args->timeo and fix warning:

nfs/nfs.h:59:28: warning: large integer implicitly truncated to unsigned type [-Woverflow]
 #define NFS_TIMEO          (1 * NFS_HZ)   /* Default timeout = 1 second */
                            ^
nfs/nfs_vfsops.c:1857:23: note: in expansion of macro 'NFS_TIMEO'
   nprmt.timeo       = NFS_TIMEO;
                            ^
                       ^~~~~~~~~

* fs/nfs: Update the file attribute correctly in nfs_filetruncate and simplify the attrbitue conversion between NFSv3 and NuttX
* fs/nfs: Remove the unfinished and buggy EXCLUSIVE creation mode
* fs/nfs: Call nfs_fsinfo in nfs_bind instead of nfs_statfs since we should update the buffer size before transfer happen, and handle the attribute existence variance correctly.
* fs/nfs: Shouldn't insert node into list again in nfs_dup and fix other typo issue
* fs/nfs: Should skip . and .. in nfs_readdir
* fs/nfs: Remove the unnecessary dynamic allocation and the duplicated root handle storage
2020-03-01 14:55:01 -06:00
Xiang Xiao
cde88cabcc Run codespell -w with the latest dictonary again
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-23 22:27:46 +01:00
Xiang Xiao
bd4e8e19d3 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:45:07 -06:00
Xiang Xiao
5c80b94820 Replace #include <semaphore.h> to #include <nuttx/semaphore.h>
Since the kernel side should call nxsem_xxx instead and remove the unused inclusion
2020-02-01 08:27:30 -06:00
Xiang Xiao
0b860726db Ensure psock_socket and psock_accept initialize s_crefs to 1
This simplifies the caller usage
2020-01-31 13:45:14 -06:00
Xiang Xiao
68951e8d72 Remove exra whitespace from files (#189)
* Remove multiple newlines at the end of files
* Remove the whitespace from the end of lines
2020-01-31 09:24:49 -06:00
Xiang Xiao
6a3c2aded6 Fix wait loop and void cast (#24)
* Simplify EINTR/ECANCEL error handling

1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx

* Unify the void cast usage

1. Remove void cast for function because many place ignore the returned value witout cast
2. Replace void cast for variable with UNUSED macro
2020-01-02 10:54:43 -06:00
Gregory Nutt
c11c18858f fs/nfs/rpc_clnt.c: Fix a typo introduced with bd3cc792ff. 2019-10-27 15:39:08 -06:00
Gregory Nutt
bd3cc792ff fs/: Run all .c files under fs/ through tools/nxstyle. 2019-10-27 11:48:14 -06:00
Juha Niskanen
e8b5dd4528 Fix use of undefined pp-token #errror, other typos. 2019-09-19 18:19:18 -06:00
Gregory Nutt
be3dd0bac6 fs/: Fix various coding standard issues found while testing tools/nxstyle.c 2019-03-01 15:01:04 -06:00
zhangyuan7
37b9bbbdef fs/nfs: Update nfs mount to VER3 2018-08-26 13:11:24 -06:00
Alan Carvalho de Assis
283b73edc5 Fix lots of typos in C comments and Kconfig help text 2018-07-08 18:24:45 -06:00
Michael Jung
800da58e6c fs/nfs/rpc_clnt.c: Commit 091e3f7 broke the NFS client. sendto() can (correctly) no lnoger by used with a connected UDP socket. In that case, send() must be used instead. 2018-05-02 13:53:51 -06:00
Gregory Nutt
1567b82429 Make sure that labeling is used consistently in all function headers (part 2). 2018-02-01 12:03:55 -06:00
Gregory Nutt
7cf88d7dbd Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
Gregory Nutt
39fe6a0dff Squashed commit of the following:
fs/nxffs:  Add partial implementation of the truncate method:  It extend files, but cannot yet shrink them.
    fs/smartfs:  Add partial implementation of the truncate method:  It extend files, but cannot yet shrink them.
    fs/fat:  Add partial implementation of the truncate method:  It extend files, but no yet shrink them.
    fs/nfs:  Add support for the truncate method to the NFS file system.
2018-01-04 10:54:54 -06:00
Gregory Nutt
e4652bd3dc Squashed commit of the following:
fs: Add truncate() support for userfs
    fs/unionfs:  Add truncate() support to the unionfs
    fs/tmpfs:  Add ftruncate() support to tmpfs
    syscall/: Add system call support for ftruncate()
    net/route:  Adding ftruncate() support eliminates an issue in file-based routing table management.
    fs:  Add basic framework to support truncate() and ftruncate().  The infrastructure is complete.  Now, however, the actual implementation of ftruncate() will have to be done for each file system.
2018-01-03 16:03:56 -06:00
Michael Jung
d46a7beef9 fs/nfs/nfs_vfsops.c: Fix buffer corruption. In case multiple read requests to the NFS server are required to fill up the user provided buffer, nfs_read might write behind the end of said buffer. This is fixed with this change. 2017-12-28 06:31:49 -06:00
Michael Jung
223104a6b4 fs/nfs/nfs_vfsops.c: Correctly infer file type. The file type is in struct nfs_statinfo_s's ns_type field, not in the ns_mode field. 2017-12-17 06:43:30 -06:00
Gregory Nutt
ecf6dda2c5 Correct recurring typo: semaphore not semapore 2017-10-09 09:57:56 -06:00
Gregory Nutt
700f1a8e8c Eliminate some warnings found in build testing. 2017-10-08 16:27:17 -06:00
Gregory Nutt
9568600ab1 Squashed commit of the following:
This commit backs out most of commit b4747286b1.  That change was added because sem_wait() would sometimes cause cancellation points inappropriated.  But with these recent changes, nxsem_wait() is used instead and it is not a cancellation point.

    In the OS, all calls to sem_wait() changed to nxsem_wait().  nxsem_wait() does not return errors via errno so each place where nxsem_wait() is now called must not examine the errno variable.

    In all OS functions (not libraries), change sem_wait() to nxsem_wait().  This will prevent the OS from creating bogus cancellation points and from modifying the per-task errno variable.

    sched/semaphore:  Add the function nxsem_wait().  This is a new internal OS interface.  It is functionally equivalent to sem_wait() except that (1) it is not a cancellation point, and (2) it does not set the per-thread errno value on return.
2017-10-04 15:22:27 -06:00
Gregory Nutt
42a0796615 Squashed commit of the following:
sched/semaphore:  Add nxsem_post() which is identical to sem_post() except that it never modifies the errno variable.  Changed all references to sem_post in the OS to nxsem_post().

    sched/semaphore:  Add nxsem_destroy() which is identical to sem_destroy() except that it never modifies the errno variable.  Changed all references to sem_destroy() in the OS to nxsem_destroy().

    libc/semaphore and sched/semaphore:  Add nxsem_getprotocol() and nxsem_setprotocola which are identical to sem_getprotocol() and set_setprotocol() except that they never modifies the errno variable.  Changed all references to sem_setprotocol in the OS to nxsem_setprotocol().  sem_getprotocol() was not used in the OS
2017-10-03 15:35:24 -06:00
Gregory Nutt
83cdb0c552 Squashed commit of the following:
libc/semaphore:  Add nxsem_getvalue() which is identical to sem_getvalue() except that it never modifies the errno variable.  Changed all references to sem_getvalue in the OS to nxsem_getvalue().

    sched/semaphore:  Rename all internal private functions from sem_xyz to nxsem_xyz.  The sem_ prefix is (will be) reserved only for the application semaphore interfaces.

    libc/semaphore:  Add nxsem_init() which is identical to sem_init() except that it never modifies the errno variable.  Changed all references to sem_init in the OS to nxsem_init().

    sched/semaphore:  Rename sem_tickwait() to nxsem_tickwait() so that it is clear this is an internal OS function.

    sched/semaphoate:  Rename sem_reset() to nxsem_reset() so that it is clear this is an internal OS function.
2017-10-03 12:52:31 -06:00
Gregory Nutt
2c2aa94b7d Squashed commit of the following:
net/: psock_recvfrom() is an internal interface and should not set the errno nor should it be a cancellation point.

    net/: psock_accept() is not a cancellation point.

    net/: psock_getsockopt() and psock_socket*9 are an internal interfaces and should not set the errno.

    net/: psock_getsockopt() is an internal interface and should not set the errno.

    net/: psock_listen() is an internal interface and should not set the errno.

    net/: psock_connect(( is an internal interface and should not set the errno nor should it be a cancellation point.

    net/: psock_bind() is an internal interface and should not set the errno.

    net/: psock_accept() is an internal interface and should not set the errno.
2017-09-30 08:18:08 -06:00
Gregory Nutt
9e8529b1d0 net/sockets: psock_sendto() is an internal OS interface an should not set the errno variable. 2017-09-29 17:35:38 -06:00
Gregory Nutt
aeb59383cf Remove CONFIG_NET_MULTILINK. This increases code size by a little, but greatly reduces the complexity of the network code. 2017-08-08 15:26:09 -06:00
Gregory Nutt
191fb658d0 nfs: Simplify parameters saved for fstat() 2017-02-14 08:16:03 -06:00
Gregory Nutt
d0f0dd222e NFS: Use clock_gettime() instead of deprecated gettimeofday() 2017-02-13 10:39:49 -06:00
Gregory Nutt
10378bb10b fstat: Add fstat() support to nfs. 2017-02-13 10:07:43 -06:00
Gregory Nutt
7d91fabf01 fstat: Add skeleton implmentations of fstat() in all file systems. 2017-02-12 13:42:27 -06:00
Gregory Nutt
0908a6c6b9 Fix calculations using MSEC_PER_TICK. If USEC_PER_TICK is less than 1000, then MSEC_PER_TICK will be zero. It will be inaccurate in any case. 2016-09-25 08:17:33 -06:00
Gregory Nutt
c0142b618d Missing left parenthesis on one of the modified debug statements. 2016-06-11 17:31:11 -06:00
Gregory Nutt
1acafa813b Missing open quotation mark on one of the modified debug statements. 2016-06-11 17:29:32 -06:00
Gregory Nutt
ad2f7b0119 fs/: Change some *err() message to *info() messages if what was a *dbg() message does not indicate and error condition. 2016-06-11 17:14:02 -06:00
Gregory Nutt
a1469a3e95 Add CONFIG_DEBUG_ERROR. Change names of *dbg() * *err() 2016-06-11 15:50:49 -06:00
Gregory Nutt
fc3540cffe Replace all occurrences of vdbg with vinfo 2016-06-11 11:59:51 -06:00