sys/vfs/hammer: Rename hammer_directory_namekey() to hammer_direntry_namekey()
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 28 Feb 2016 10:32:58 +0000 (19:32 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 28 Feb 2016 10:52:29 +0000 (19:52 +0900)
The name of this function should be hammer_direntry_namekey()
since it's only used with directory entry rectype, but not
directories as an object type.
(Note that rectype for directory entry is HAMMER_RECTYPE_DIRENTRY)

sys/vfs/hammer/hammer.h
sys/vfs/hammer/hammer_inode.c
sys/vfs/hammer/hammer_object.c
sys/vfs/hammer/hammer_subs.c
sys/vfs/hammer/hammer_vnops.c

index be55605..963692d 100644 (file)
@@ -1181,7 +1181,7 @@ void hammer_clear_undo_history(hammer_mount_t hmp);
 enum vtype hammer_get_vnode_type(uint8_t obj_type);
 int hammer_get_dtype(uint8_t obj_type);
 uint8_t hammer_get_obj_type(enum vtype vtype);
-int64_t hammer_directory_namekey(hammer_inode_t dip, const void *name, int len,
+int64_t hammer_direntry_namekey(hammer_inode_t dip, const void *name, int len,
                        uint32_t *max_iterationsp);
 int    hammer_nohistory(hammer_inode_t ip);
 
index 4df345d..988bc7c 100644 (file)
@@ -794,7 +794,7 @@ hammer_create_inode(hammer_transaction_t trans, struct vattr *vap,
                ip->obj_localization = pfsm->localization;
        } else {
                KKASSERT(dip != NULL);
-               namekey = hammer_directory_namekey(dip, name, namelen, &dummy);
+               namekey = hammer_direntry_namekey(dip, name, namelen, &dummy);
                ip->obj_id = hammer_alloc_objid(hmp, dip, namekey);
                ip->obj_localization = dip->obj_localization;
        }
index 8a43436..b0507a1 100644 (file)
@@ -673,7 +673,7 @@ hammer_ip_add_direntry(struct hammer_transaction *trans,
        record->leaf.base.localization = dip->obj_localization |
                                         hammer_dir_localization(dip);
        record->leaf.base.obj_id = dip->obj_id;
-       record->leaf.base.key = hammer_directory_namekey(dip, name, bytes,
+       record->leaf.base.key = hammer_direntry_namekey(dip, name, bytes,
                                                         &max_iterations);
        record->leaf.base.rec_type = HAMMER_RECTYPE_DIRENTRY;
        record->leaf.base.obj_type = ip->ino_leaf.base.obj_type;
index 5a3b1cb..b53c9c3 100644 (file)
@@ -941,7 +941,7 @@ hammer_nohistory(hammer_inode_t ip)
  * artificial directory entries such as "." and "..".
  */
 int64_t
-hammer_directory_namekey(hammer_inode_t dip, const void *name, int len,
+hammer_direntry_namekey(hammer_inode_t dip, const void *name, int len,
                         uint32_t *max_iterationsp)
 {
        const char *aname = name;
index e10d6f8..471ee8f 100644 (file)
@@ -1201,7 +1201,7 @@ hammer_vop_nresolve(struct vop_nresolve_args *ap)
         *
         * The key range is inclusive of both key_beg and key_end.
         */
-       namekey = hammer_directory_namekey(dip, ncp->nc_name, nlen,
+       namekey = hammer_direntry_namekey(dip, ncp->nc_name, nlen,
                                           &max_iterations);
 
        error = hammer_init_cursor(&trans, &cursor, &dip->cache[1], dip);
@@ -1993,7 +1993,7 @@ hammer_vop_nrename(struct vop_nrename_args *ap)
         *
         * The key range is inclusive of both key_beg and key_end.
         */
-       namekey = hammer_directory_namekey(fdip, fncp->nc_name, fncp->nc_nlen,
+       namekey = hammer_direntry_namekey(fdip, fncp->nc_name, fncp->nc_nlen,
                                           &max_iterations);
 retry:
        hammer_init_cursor(&trans, &cursor, &fdip->cache[1], fdip);
@@ -3341,7 +3341,7 @@ hammer_dounlink(hammer_transaction_t trans, struct nchandle *nch,
        if (dip->flags & HAMMER_INODE_RO)
                return (EROFS);
 
-       namekey = hammer_directory_namekey(dip, ncp->nc_name, ncp->nc_nlen,
+       namekey = hammer_direntry_namekey(dip, ncp->nc_name, ncp->nc_nlen,
                                           &max_iterations);
 retry:
        hammer_init_cursor(trans, &cursor, &dip->cache[1], dip);