Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fs: allow error returns from generic_update_time

Now that no caller looks at the updated flags, switch generic_update_time
to the same calling convention as the ->update_time method and return 0
or a negative errno.

This prepares for adding non-blocking timestamp updates that could return
-EAGAIN.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20260108141934.2052404-3-hch@lst.de
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Christoph Hellwig and committed by
Christian Brauner
dc9629fa 20b78183

+8 -13
+1 -2
fs/gfs2/inode.c
··· 2257 2257 if (error) 2258 2258 return error; 2259 2259 } 2260 - generic_update_time(inode, flags); 2261 - return 0; 2260 + return generic_update_time(inode, flags); 2262 2261 } 2263 2262 2264 2263 static const struct inode_operations gfs2_file_iops = {
+2 -2
fs/inode.c
··· 2141 2141 * or S_VERSION need to be updated we attempt to update all three of them. S_ATIME 2142 2142 * updates can be handled done independently of the rest. 2143 2143 * 2144 - * Returns a S_* mask indicating which fields were updated. 2144 + * Returns a negative error value on error, else 0. 2145 2145 */ 2146 2146 int generic_update_time(struct inode *inode, int flags) 2147 2147 { ··· 2153 2153 if (updated & S_VERSION) 2154 2154 dirty_flags |= I_DIRTY_SYNC; 2155 2155 __mark_inode_dirty(inode, dirty_flags); 2156 - return updated; 2156 + return 0; 2157 2157 } 2158 2158 EXPORT_SYMBOL(generic_update_time); 2159 2159
+2 -4
fs/ubifs/file.c
··· 1379 1379 .dirtied_ino_d = ALIGN(ui->data_len, 8) }; 1380 1380 int err, release; 1381 1381 1382 - if (!IS_ENABLED(CONFIG_UBIFS_ATIME_SUPPORT)) { 1383 - generic_update_time(inode, flags); 1384 - return 0; 1385 - } 1382 + if (!IS_ENABLED(CONFIG_UBIFS_ATIME_SUPPORT)) 1383 + return generic_update_time(inode, flags); 1386 1384 1387 1385 err = ubifs_budget_space(c, &req); 1388 1386 if (err)
+2 -4
fs/xfs/xfs_iops.c
··· 1197 1197 1198 1198 if (inode->i_sb->s_flags & SB_LAZYTIME) { 1199 1199 if (!((flags & S_VERSION) && 1200 - inode_maybe_inc_iversion(inode, false))) { 1201 - generic_update_time(inode, flags); 1202 - return 0; 1203 - } 1200 + inode_maybe_inc_iversion(inode, false))) 1201 + return generic_update_time(inode, flags); 1204 1202 1205 1203 /* Capture the iversion update that just occurred */ 1206 1204 log_flags |= XFS_ILOG_CORE;
+1 -1
include/linux/fs.h
··· 2399 2399 extern void iput(struct inode *); 2400 2400 void iput_not_last(struct inode *); 2401 2401 int inode_update_timestamps(struct inode *inode, int flags); 2402 - int generic_update_time(struct inode *, int); 2402 + int generic_update_time(struct inode *inode, int flags); 2403 2403 2404 2404 /* /sys/fs */ 2405 2405 extern struct kobject *fs_kobj;