mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 07:45:16 +08:00
nfs: Simplify parameters saved for fstat()
This commit is contained in:
+1
-1
@@ -75,7 +75,7 @@ struct nfsnode
|
|||||||
uint8_t n_fhsize; /* Size in bytes of the file handle */
|
uint8_t n_fhsize; /* Size in bytes of the file handle */
|
||||||
uint8_t n_flags; /* Node flags */
|
uint8_t n_flags; /* Node flags */
|
||||||
uint16_t n_mode; /* File mode for fstat() */
|
uint16_t n_mode; /* File mode for fstat() */
|
||||||
struct timespec n_mtime; /* File modification time */
|
time_t n_mtime; /* File modification time */
|
||||||
time_t n_ctime; /* File creation time */
|
time_t n_ctime; /* File creation time */
|
||||||
nfsfh_t n_fhandle; /* NFS File Handle */
|
nfsfh_t n_fhandle; /* NFS File Handle */
|
||||||
uint64_t n_size; /* Current size of file */
|
uint64_t n_size; /* Current size of file */
|
||||||
|
|||||||
+3
-1
@@ -586,7 +586,9 @@ void nfs_attrupdate(FAR struct nfsnode *np, FAR struct nfs_fattr *attributes)
|
|||||||
np->n_mode = fxdr_unsigned(uint16_t, attributes->fa_mode);
|
np->n_mode = fxdr_unsigned(uint16_t, attributes->fa_mode);
|
||||||
np->n_size = fxdr_hyper(&attributes->fa_size);
|
np->n_size = fxdr_hyper(&attributes->fa_size);
|
||||||
|
|
||||||
fxdr_nfsv3time(&attributes->fa_mtime, &np->n_mtime);
|
fxdr_nfsv3time(&attributes->fa_mtime, &ts);
|
||||||
|
np->n_mtime = ts.tv_sec;
|
||||||
|
|
||||||
fxdr_nfsv3time(&attributes->fa_ctime, &ts);
|
fxdr_nfsv3time(&attributes->fa_ctime, &ts);
|
||||||
np->n_ctime = ts.tv_sec;
|
np->n_ctime = ts.tv_sec;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1245,7 +1245,7 @@ static int nfs_fstat(FAR const struct file *filep, FAR struct stat *buf)
|
|||||||
|
|
||||||
/* Extract time values as type time_t in units of seconds. */
|
/* Extract time values as type time_t in units of seconds. */
|
||||||
|
|
||||||
info.ns_mtime = np->n_mtime.tv_sec;
|
info.ns_mtime = np->n_mtime;
|
||||||
info.ns_ctime = np->n_ctime;
|
info.ns_ctime = np->n_ctime;
|
||||||
|
|
||||||
/* Use the current time for the time of last access. */
|
/* Use the current time for the time of last access. */
|
||||||
|
|||||||
Reference in New Issue
Block a user