sys/vfs/hammer: Rename hammer_ip_add_directory() to hammer_ip_add_direntry()
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 28 Feb 2016 10:28:46 +0000 (19:28 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 28 Feb 2016 10:52:29 +0000 (19:52 +0900)
The name "hammer_ip_add_directory" is confusing in the sense that
it sounds like the function adds a directory as an object type.
What this function actually does is add a directory entry which
is different from a directory as an object type.
(Note that rectype for directory entry is HAMMER_RECTYPE_DIRENTRY)

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

index 3ab5237..deace9d 100644 (file)
@@ -1382,7 +1382,7 @@ void hammer_test_inode(hammer_inode_t dip);
 void hammer_inode_unloadable_check(hammer_inode_t ip, int getvp);
 int hammer_update_atime_quick(hammer_inode_t ip);
 
-int  hammer_ip_add_directory(struct hammer_transaction *trans,
+int  hammer_ip_add_direntry(struct hammer_transaction *trans,
                        hammer_inode_t dip, const char *name, int bytes,
                        hammer_inode_t nip);
 int  hammer_ip_del_directory(struct hammer_transaction *trans,
index a1b171e..6eee384 100644 (file)
@@ -656,7 +656,7 @@ hammer_mem_first(hammer_cursor_t cursor)
  * not be terminated.
  */
 int
-hammer_ip_add_directory(struct hammer_transaction *trans,
+hammer_ip_add_direntry(struct hammer_transaction *trans,
                     struct hammer_inode *dip, const char *name, int bytes,
                     struct hammer_inode *ip)
 {
index cff636d..ea4d3f4 100644 (file)
@@ -946,11 +946,11 @@ hammer_vop_ncreate(struct vop_ncreate_args *ap)
         * Add the new filesystem object to the directory.  This will also
         * bump the inode's link count.
         */
-       error = hammer_ip_add_directory(&trans, dip,
+       error = hammer_ip_add_direntry(&trans, dip,
                                        nch->ncp->nc_name, nch->ncp->nc_nlen,
                                        nip);
        if (error)
-               hkprintf("hammer_ip_add_directory error %d\n", error);
+               hkprintf("hammer_ip_add_direntry error %d\n", error);
 
        /*
         * Finish up.
@@ -1406,7 +1406,7 @@ hammer_vop_nlink(struct vop_nlink_args *ap)
         * dip nor ip are referenced or locked, but their vnodes are
         * referenced.  This function will bump the inode's link count.
         */
-       error = hammer_ip_add_directory(&trans, dip,
+       error = hammer_ip_add_direntry(&trans, dip,
                                        nch->ncp->nc_name, nch->ncp->nc_nlen,
                                        ip);
 
@@ -1474,7 +1474,7 @@ hammer_vop_nmkdir(struct vop_nmkdir_args *ap)
         * Add the new filesystem object to the directory.  This will also
         * bump the inode's link count.
         */
-       error = hammer_ip_add_directory(&trans, dip,
+       error = hammer_ip_add_direntry(&trans, dip,
                                        nch->ncp->nc_name, nch->ncp->nc_nlen,
                                        nip);
        if (error)
@@ -1554,7 +1554,7 @@ hammer_vop_nmknod(struct vop_nmknod_args *ap)
         * Add the new filesystem object to the directory.  This will also
         * bump the inode's link count.
         */
-       error = hammer_ip_add_directory(&trans, dip,
+       error = hammer_ip_add_direntry(&trans, dip,
                                        nch->ncp->nc_name, nch->ncp->nc_nlen,
                                        nip);
 
@@ -1972,7 +1972,7 @@ hammer_vop_nrename(struct vop_nrename_args *ap)
        error = hammer_dounlink(&trans, ap->a_tnch, ap->a_tdvp,
                                ap->a_cred, 0, -1);
        if (error == 0 || error == ENOENT) {
-               error = hammer_ip_add_directory(&trans, tdip,
+               error = hammer_ip_add_direntry(&trans, tdip,
                                                tncp->nc_name, tncp->nc_nlen,
                                                ip);
                if (error == 0) {
@@ -2455,7 +2455,7 @@ hammer_vop_nsymlink(struct vop_nsymlink_args *ap)
                }
        }
        if (error == 0)
-               error = hammer_ip_add_directory(&trans, dip, nch->ncp->nc_name,
+               error = hammer_ip_add_direntry(&trans, dip, nch->ncp->nc_name,
                                                nch->ncp->nc_nlen, nip);
 
        /*