On Fri, Apr 20, 2018 at 08:50:02AM +1000, Dave Chinner wrote: > 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. > Ok. > > 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. > I think keep nesting function calls to reduce a few lines of code if harder to read indeed, and I would stay with the current way and pretend I've never submitted this patch :) > Cheers, > > Dave. > -- > Dave Chinner > david@xxxxxxxxxxxxx -- Carlos -- 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