Re: [PATCH/RFC 1/2] anon-inodes: Remove fd_install() from anon_inode_getfd()

From: Avi Kivity
Date: Wed Feb 27 2008 - 14:22:21 EST


Roland Dreier wrote:
The anonymous inodes interface anon_inode_getfd() calls fd_install()
for the newly created fd, which does not work for some use cases where
the caller must do futher initialization before exposing the file to
userspace. This is also probably not the safest interface, since the
caller must be sure that it is OK if userspace closes the fd before
anon_inode_getfd() even returns.

Therefore, change the anonymous inodes interface so that the caller is
responsible for calling fd_install(), and change the name of the
function from anon_inode_getfd() to anon_inode_allocfd() so that any
code using the old interface breaks at compilation rather than failing
in a strange way. Fix up all the in-kernel users to use the new
interface.


The kvm changes are

Acked-by: Avi Kivity <avi@xxxxxxxxxxxx>


--
Any sufficiently difficult bug is indistinguishable from a feature.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/