From: Bastian Blank <bastian@waldi.eu.org>
To: John Ogness <dazukocode@ogness.net>
Cc: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk,
malware-list@lists.printk.net, eparis@redhat.com,
hch@infradead.org, alan@lxorguk.ukuu.org.uk
Subject: Re: [PATCH 1/5] VFS: DazukoFS, stackable-fs, file access control
Date: Sun, 21 Dec 2008 16:48:37 +0100 [thread overview]
Message-ID: <20081221154837.GA1940@wavehammer.waldi.eu.org> (raw)
In-Reply-To: <868wq9h905.fsf@johno-ibook.fn.ogness.net>
On Sun, Dec 21, 2008 at 03:56:42PM +0100, John Ogness wrote:
> +#ifndef __DAZUKOFS_FS_H
> +#define __DAZUKOFS_FS_H
There are several (okay, all) includes missing.
> +static inline
> +struct dazukofs_sb_info *GET_SB_INFO(struct super_block *upper_sb)
Coding-style.
> +static inline void SET_LOWER_INODE(struct inode *upper_inode,
> + struct inode *lower_inode)
> +{
> + ((struct dazukofs_inode_info *)
> + container_of(upper_inode, struct dazukofs_inode_info,
> + vfs_inode))->lower_inode = lower_inode;
> +}
Please make such cast cascades explicit:
| struct dazukofs_inode_info *info = container_of(...);
| info->lower_inode = lower_inode;
There are other people which want to read the code.
> +static int dazukofs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
> +{
> + struct vfsmount *lower_mnt;
> + struct dentry *lower_dentry;
> + struct vfsmount *vfsmount_save;
> + struct dentry *dentry_save;
> + int valid;
> +
> + valid = 1;
> +
> + lower_dentry = GET_LOWER_DENTRY(dentry);
> +
> + if (!lower_dentry->d_op || !lower_dentry->d_op->d_revalidate)
> + goto out;
Why do you use goto instead of return?
> +static int dazukofs_d_hash(struct dentry *dentry, struct qstr *name)
> +{
> + struct dentry *lower_dentry = GET_LOWER_DENTRY(dentry);
> +
> + if (!lower_dentry || !lower_dentry->d_op ||
> + !lower_dentry->d_op->d_hash) {
> + return 0;
> + }
You mix rather different coding styles through the whole code. Also why
do you say that lower_dentry can be 0 in _hash, but not in _revalidate?
> +static void dazukofs_d_release(struct dentry *dentry)
> +{
> + if (GET_DENTRY_INFO(dentry)) {
> + dput(GET_LOWER_DENTRY(dentry));
> + mntput(GET_LOWER_MNT(dentry));
Why do you push anything out in other functions while making it explicit
would make it much easier readable?
Bastian
--
Killing is stupid; useless!
-- McCoy, "A Private Little War", stardate 4211.8
next prev parent reply other threads:[~2008-12-21 15:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-21 14:52 [PATCH 0/5] VFS: DazukoFS, stackable-fs, file access control John Ogness
2008-12-21 14:56 ` [PATCH 1/5] " John Ogness
2008-12-21 14:57 ` [PATCH 2/5] " John Ogness
2008-12-21 14:59 ` [PATCH 3/5] " John Ogness
2008-12-21 15:00 ` [PATCH 4/5] " John Ogness
2008-12-21 15:01 ` [PATCH 5/5] " John Ogness
2008-12-21 15:48 ` Bastian Blank [this message]
2008-12-21 17:56 ` [PATCH 1/5] " John Ogness
2008-12-23 11:54 ` [PATCH 0/5] " Pavel Machek
2008-12-23 18:55 ` John Ogness
2008-12-24 8:53 ` Pavel Machek
2008-12-24 12:11 ` John Ogness
2008-12-26 18:30 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081221154837.GA1940@wavehammer.waldi.eu.org \
--to=bastian@waldi.eu.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=dazukocode@ogness.net \
--cc=eparis@redhat.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=malware-list@lists.printk.net \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox