Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/fs/puffs comments



details:   https://anonhg.NetBSD.org/src/rev/f77848cc15de
branches:  trunk
changeset: 785265:f77848cc15de
user:      yamt <yamt%NetBSD.org@localhost>
date:      Wed Mar 06 11:40:22 2013 +0000

description:
comments
use sizeof(var) instead of sizeof(type) where possibly confusing

diffstat:

 sys/fs/puffs/puffs_node.c |  15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (47 lines):

diff -r 89301bc68bbd -r f77848cc15de sys/fs/puffs/puffs_node.c
--- a/sys/fs/puffs/puffs_node.c Wed Mar 06 11:39:37 2013 +0000
+++ b/sys/fs/puffs/puffs_node.c Wed Mar 06 11:40:22 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs_node.c,v 1.28 2012/11/05 17:27:38 dholland Exp $ */
+/*     $NetBSD: puffs_node.c,v 1.29 2013/03/06 11:40:22 yamt Exp $     */
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_node.c,v 1.28 2012/11/05 17:27:38 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_node.c,v 1.29 2013/03/06 11:40:22 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/hash.h>
@@ -279,7 +279,7 @@
 {
        uint32_t hash;
 
-       hash = hash32_buf(&ck, sizeof(void *), HASH32_BUF_INIT);
+       hash = hash32_buf(&ck, sizeof(ck), HASH32_BUF_INIT);
        return &pmp->pmp_pnodehash[hash % pmp->pmp_npnodehash];
 }
 
@@ -366,11 +366,18 @@
 
 /*
  * Locate the in-kernel vnode based on the cookie received given
- * from userspace.  Returns a vnode, if found, NULL otherwise.
+ * from userspace.
  * The parameter "lock" control whether to lock the possible or
  * not.  Locking always might cause us to lock against ourselves
  * in situations where we want the vnode but don't care for the
  * vnode lock, e.g. file server issued putpages.
+ *
+ * returns 0 on success.  otherwise returns an errno or PUFFS_NOSUCHCOOKIE.
+ *
+ * returns PUFFS_NOSUCHCOOKIE if no vnode for the cookie is found.
+ * in that case, if willcreate=true, the pmp_newcookie list is populated with
+ * the given cookie.  it's the caller's responsibility to consume the entry
+ * with calling puffs_getvnode.
  */
 int
 puffs_cookie2vnode(struct puffs_mount *pmp, puffs_cookie_t ck, int lock,



Home | Main Index | Thread Index | Old Index