diff options
author | Jeremy Allison <jra@samba.org> | 2019-10-18 09:34:02 -0700 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2020-01-14 08:30:23 +0000 |
commit | ee236c2f3078348bcc2bcfd5e4100be9711f6071 (patch) | |
tree | 8398c532eac835ae6f1a96638f26d99554cb4030 /source3 | |
parent | 06b0e8d3ae18ca64ee390ad638d77502a4efe8fa (diff) | |
download | samba-ee236c2f3078348bcc2bcfd5e4100be9711f6071.tar.gz |
s3: libsmb: Move setting st->st_ino into setup_stat.
Signed-off-by: Puran Chand <pchand@vmware.com>
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 7d3b4f47be0359b496087fc40f89b815c7958dd6)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/libsmb_internal.h | 3 | ||||
-rw-r--r-- | source3/libsmb/libsmb_stat.c | 15 |
2 files changed, 9 insertions, 9 deletions
diff --git a/source3/include/libsmb_internal.h b/source3/include/libsmb_internal.h index 16a5673e4d2..6a58b3306c7 100644 --- a/source3/include/libsmb_internal.h +++ b/source3/include/libsmb_internal.h @@ -525,7 +525,8 @@ SMBC_attr_server(TALLOC_CTX *ctx, void setup_stat(struct stat *st, const char *fname, off_t size, - int mode); + int mode, + ino_t ino); int SMBC_stat_ctx(SMBCCTX *context, diff --git a/source3/libsmb/libsmb_stat.c b/source3/libsmb/libsmb_stat.c index 62d99ce4ba9..1bb9e909b15 100644 --- a/source3/libsmb/libsmb_stat.c +++ b/source3/libsmb/libsmb_stat.c @@ -48,7 +48,8 @@ static ino_t generate_inode(const char *name) void setup_stat(struct stat *st, const char *fname, off_t size, - int mode) + int mode, + ino_t ino) { st->st_mode = 0; @@ -90,7 +91,9 @@ void setup_stat(struct stat *st, st->st_nlink = 1; } - if (st->st_ino == 0) { + if (ino != 0) { + st->st_ino = ino; + } else { st->st_ino = generate_inode(fname); } } @@ -177,9 +180,7 @@ SMBC_stat_ctx(SMBCCTX *context, return -1; } - st->st_ino = ino; - - setup_stat(st, fname, size, mode); + setup_stat(st, fname, size, mode, ino); st->st_atime = convert_timespec_to_time_t(access_time_ts); st->st_ctime = convert_timespec_to_time_t(change_time_ts); @@ -282,9 +283,7 @@ SMBC_fstat_ctx(SMBCCTX *context, write_time_ts = convert_time_t_to_timespec(write_time); } - st->st_ino = ino; - - setup_stat(st, file->fname, size, mode); + setup_stat(st, file->fname, size, mode, ino); st->st_atime = convert_timespec_to_time_t(access_time_ts); st->st_ctime = convert_timespec_to_time_t(change_time_ts); |