vfs: Introduce the fd closing helper
About this patch, one thing to note: the comment about checking for a NULL filp should go with do_close() (where the resultant goto out_unlock is located) rather than sys_close.
While we're doing minor cleanups, you might add:
SYSCALL_DEFINE1(close, unsigned int, fd)
{
- int retval;
-
- retval = do_close(fd);
+ int retval = do_close(fd);