lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191202174811.GA31468@infradead.org>
Date:   Mon, 2 Dec 2019 09:48:11 -0800
From:   Christoph Hellwig <hch@...radead.org>
To:     Deepa Dinamani <deepa.kernel@...il.com>
Cc:     viro@...iv.linux.org.uk, linux-kernel@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, arnd@...db.de
Subject: Re: [PATCH 7/7] fs: Do not overload update_time

On Fri, Nov 29, 2019 at 09:30:30PM -0800, Deepa Dinamani wrote:
> -	int (*update_time)(struct inode *, struct timespec64 *, int);
> +	int (*cb)(struct inode *, struct timespec64 *, int);
>  
> -	update_time = inode->i_op->update_time ? inode->i_op->update_time :
> +	cb = inode->i_op->update_time ? inode->i_op->update_time :
>  		generic_update_time;
>  
> -	return update_time(inode, time, flags);
> +	return cb(inode, time, flags);

Just killing the pointless local variable cleans the function op, and
also avoids the expensive indirect call for the common case:

	if (inode->i_op->update_time)
		return inode->i_op->update_time(inode, time, flags);
	return generic_update_time(inode, time, flags);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ