Re: [RFC PATCH v4 10/17] fs: Split off file_needs_update_time and __file_update_time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 20, 2022 at 11:36:39AM -0700, Stefan Roesch wrote:
> +static int file_needs_update_time(struct inode *inode, struct file *file,
> +				struct timespec64 *now)
>  {
>  	int sync_it = 0;

No need to pass both and inode and a file as the former can be trivially
derived from the latter.  But if I'm not misreading the patch, file is
entirely unused here anyway, so can't we just drop it and rename the
function to inode_needs_update_time?

> +static int __file_update_time(struct inode *inode, struct file *file,
> +			struct timespec64 *now, int sync_mode)
> +{
> +	int ret = 0;
>  
> +	/* try to update time settings */
> +	if (!__mnt_want_write_file(file)) {
> +		ret = inode_update_time(inode, now, sync_mode);
> +		__mnt_drop_write_file(file);
> +	}

I'd be tempted to just open code this in the two callers, but either
way works for me.  If we keep the function please don't pass the
inode separately.



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux