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 Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux