Re: [PATCH 00/21] vfs: atomic open v6 (part 2)

From: Miklos Szeredi
Date: Mon Jun 11 2012 - 11:17:59 EST


Al Viro <viro@xxxxxxxxxxxxxxxxxx> writes:

>
> I'm more or less OK with that; one major exception is your struct opendata.
> I think it needs to go. Really. You are using it to store three references -
> file, vfsmount and dentry.

That's not the real purpose. We can store those in struct file, I can
see that.

The real reason I went with a separate and opaque type there is that
that thing is simply not an open file. If it was a struct file and the
filesystem would do an fput() on it by accident it would lead to really
ugly problems, and the complier would have no chance at detecting it.

If it's a separate type (and it can have just that struct file embedded
into it) then such mistakes are instantly detected by the compiler

So I really don't see the downsides of having a new type for that.

Thanks,
Miklos
--
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/