mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
Revert "fs: add infrastructure for multigrain timestamps"
This reverts commit ffb6cf19e0.
Users reported regressions due to enabling multi-grained timestamps
unconditionally. As no clear consensus on a solution has come up and the
discussion has gone back to the drawing board revert the infrastructure
changes for. If it isn't code that's here to stay, make it go away.
Message-ID: <20230920-keine-eile-c9755b5825db@brauner>
Acked-by: Jan Kara <jack@suse.cz>
Acked-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
41
fs/stat.c
41
fs/stat.c
@@ -26,37 +26,6 @@
|
||||
#include "internal.h"
|
||||
#include "mount.h"
|
||||
|
||||
/**
|
||||
* fill_mg_cmtime - Fill in the mtime and ctime and flag ctime as QUERIED
|
||||
* @stat: where to store the resulting values
|
||||
* @request_mask: STATX_* values requested
|
||||
* @inode: inode from which to grab the c/mtime
|
||||
*
|
||||
* Given @inode, grab the ctime and mtime out if it and store the result
|
||||
* in @stat. When fetching the value, flag it as queried so the next write
|
||||
* will use a fine-grained timestamp.
|
||||
*/
|
||||
void fill_mg_cmtime(struct kstat *stat, u32 request_mask, struct inode *inode)
|
||||
{
|
||||
atomic_long_t *pnsec = (atomic_long_t *)&inode->__i_ctime.tv_nsec;
|
||||
|
||||
/* If neither time was requested, then don't report them */
|
||||
if (!(request_mask & (STATX_CTIME|STATX_MTIME))) {
|
||||
stat->result_mask &= ~(STATX_CTIME|STATX_MTIME);
|
||||
return;
|
||||
}
|
||||
|
||||
stat->mtime = inode->i_mtime;
|
||||
stat->ctime.tv_sec = inode->__i_ctime.tv_sec;
|
||||
/*
|
||||
* Atomically set the QUERIED flag and fetch the new value with
|
||||
* the flag masked off.
|
||||
*/
|
||||
stat->ctime.tv_nsec = atomic_long_fetch_or(I_CTIME_QUERIED, pnsec) &
|
||||
~I_CTIME_QUERIED;
|
||||
}
|
||||
EXPORT_SYMBOL(fill_mg_cmtime);
|
||||
|
||||
/**
|
||||
* generic_fillattr - Fill in the basic attributes from the inode struct
|
||||
* @idmap: idmap of the mount the inode was found from
|
||||
@@ -89,14 +58,8 @@ void generic_fillattr(struct mnt_idmap *idmap, u32 request_mask,
|
||||
stat->rdev = inode->i_rdev;
|
||||
stat->size = i_size_read(inode);
|
||||
stat->atime = inode->i_atime;
|
||||
|
||||
if (is_mgtime(inode)) {
|
||||
fill_mg_cmtime(stat, request_mask, inode);
|
||||
} else {
|
||||
stat->mtime = inode->i_mtime;
|
||||
stat->ctime = inode_get_ctime(inode);
|
||||
}
|
||||
|
||||
stat->mtime = inode->i_mtime;
|
||||
stat->ctime = inode_get_ctime(inode);
|
||||
stat->blksize = i_blocksize(inode);
|
||||
stat->blocks = inode->i_blocks;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user