Messages in this thread | | | Date | Mon, 30 Nov 2009 01:04:13 -0500 | From | Erez Zadok <> | Subject | Re: [PATCH 03/41] VFS: Make lookup_hash() return a struct path |
| |
In message <1256152779-10054-4-git-send-email-vaurora@redhat.com>, Valerie Aurora writes:
> @@ -1937,7 +1942,8 @@ EXPORT_SYMBOL(filp_open); > */ > struct dentry *lookup_create(struct nameidata *nd, int is_dir) > { > - struct dentry *dentry = ERR_PTR(-EEXIST); > + struct path path = { .dentry = ERR_PTR(-EEXIST) } ;
I assume the compiler will initialize path.mnt to NULL. Is NULL what you want? Even if the compiler guarantees it, I think you should either explicitly init .mnt to NULL or leave a comment explaining what's going on -- so no future code reader will think that this was omitted; a comment can clarify your intentions more explicitly.
A struct path often requires both .mnt and .dentry to be set; it's not like, say, inode_operations, where clearly some fields can be initialized to NULL just fine.
Erez.
| |