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 5/22/22 12:29 AM, Christoph Hellwig wrote:
> 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?
> 

I renamed the function to inode_needs_update_time and only pass the inode
pointer.

>> +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.

The inode is no longer passed in.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux