On Thu, Apr 19, 2018 at 04:35:11PM +0200, Carlos Maiolino wrote: > Reduce some code and local variable allocation on file operations by > using a new helper. > > Signed-off-by: Carlos Maiolino <cmaiolino@xxxxxxxxxx> > --- > > Hi, I though this could be useful instead of keeping allocating file, > address_space and inode structs in several places, just to retrieve the > xfs_inode, what you guys think? > > XFS_FTOINO() isn't really a good name, that's the first one which came to my > mind, if this is useful at all I can change the name to something else, like > XFS_AS_TO_INO() maybe, or something else?! I'd prefer that we don't add more "vfs to xfs structure" macros like this. It doesn't make the code any more readable or correct, especially for non-XFS developers. > Although I think some vfs_wide helper like file_inode() would be more useful, > but, well, it's just an idea that came to my mind. XFS_I(file_inode(file)) would be my preferred solution here, as it uses the correct VFS accessor function to get the VFS inode from the struct file and it's obvious what it does to anyone familiar with typical VFS and filesystem coding conventions. Cheers, Dave. -- Dave Chinner david@xxxxxxxxxxxxx -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html