mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-12-23 09:18:55 +00:00
Update ctime during nocopyapi operations
Follows on to 2c43b1e12b
. Fixes #971.
This commit is contained in:
parent
f2fe1738cd
commit
059ab1f0f4
@ -1025,6 +1025,16 @@ bool FdEntity::GetStats(struct stat& st)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int FdEntity::SetCtime(time_t time)
|
||||||
|
{
|
||||||
|
if(-1 == time){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
orgmeta["x-amz-meta-ctime"] = str(time);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int FdEntity::SetMtime(time_t time)
|
int FdEntity::SetMtime(time_t time)
|
||||||
{
|
{
|
||||||
S3FS_PRN_INFO3("[path=%s][fd=%d][time=%jd]", path.c_str(), fd, (intmax_t)time);
|
S3FS_PRN_INFO3("[path=%s][fd=%d][time=%jd]", path.c_str(), fd, (intmax_t)time);
|
||||||
|
@ -154,6 +154,7 @@ class FdEntity
|
|||||||
int GetFd(void) const { return fd; }
|
int GetFd(void) const { return fd; }
|
||||||
|
|
||||||
bool GetStats(struct stat& st);
|
bool GetStats(struct stat& st);
|
||||||
|
int SetCtime(time_t time);
|
||||||
int SetMtime(time_t time);
|
int SetMtime(time_t time);
|
||||||
bool UpdateCtime(void);
|
bool UpdateCtime(void);
|
||||||
bool UpdateMtime(void);
|
bool UpdateMtime(void);
|
||||||
|
@ -1735,6 +1735,8 @@ static int s3fs_chmod_nocopy(const char* _path, mode_t mode)
|
|||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ent->SetCtime(time(NULL));
|
||||||
|
|
||||||
// Change file mode
|
// Change file mode
|
||||||
ent->SetMode(mode);
|
ent->SetMode(mode);
|
||||||
|
|
||||||
@ -1891,6 +1893,8 @@ static int s3fs_chown_nocopy(const char* _path, uid_t uid, gid_t gid)
|
|||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ent->SetCtime(time(NULL));
|
||||||
|
|
||||||
// Change owner
|
// Change owner
|
||||||
ent->SetUId(uid);
|
ent->SetUId(uid);
|
||||||
ent->SetGId(gid);
|
ent->SetGId(gid);
|
||||||
|
Loading…
Reference in New Issue
Block a user