Re: [PATCH 6/12: eCryptfs] Superblock operations

Michael Thompson
2005-11-21T15:57:08Z

On 11/19/05, Pekka Enberg <penberg@cs.helsinki.fi> wrote:
> On 11/19/05, Phillip Hellewell <phillip@hellewell.homeip.net> wrote:
> > +/**
> > + * This is called through iput_final().
> > + * This is function will replace generic_drop_inode. The end result of which
> > + * is we are skipping the check in inode->i_nlink, which we do not use.
> > + */
> > +static void ecryptfs_drop_inode(struct inode *inode) {
> > + generic_delete_inode(inode);
> > +}
>
> Please drop this useless wrapper and introduce it when it actually
> does something.

It does do something. By providing this function, we over-ride the
default flow of execution.

If we did not provide this function, the flow would be the following:

iput_final -> generic_drop_inode -> generic_delete_inode (or
generic_forget_inode).

However, since we do not care about the i_nlink value, which
generic_drop_inode checks in order to call generic_delete_inode, we
simply circumvent the check by redirecting the flow thusly:

iput_final -> ecryptfs_drop_inode -> generic_delete_inode

I don't see a problem with doing that, but perhaps there is? Please
elaborate if so.

>
> Pekka
> -
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

--
Michael C. Thompson <mcthomps@us.ibm.com>
Software-Engineer, IBM LTC Security