sys/vfs/hammer: Rename hammer_ip_del_directory() to hammer_ip_del_direntry()
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 28 Feb 2016 10:30:55 +0000 (19:30 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 28 Feb 2016 10:52:29 +0000 (19:52 +0900)
The name "hammer_ip_del_directory" is confusing in the sense that
it sounds like the function deletes a directory as an object type.
What this function actually does is delete 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 deace9d..be55605 100644 (file)
@@ -1385,7 +1385,7 @@ int hammer_update_atime_quick(hammer_inode_t ip);
 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,
+int  hammer_ip_del_direntry(struct hammer_transaction *trans,
                        hammer_cursor_t cursor, hammer_inode_t dip,
                        hammer_inode_t ip);
 void hammer_ip_replace_bulk(hammer_mount_t hmp, hammer_record_t record);
index 6eee384..8a43436 100644 (file)
@@ -758,7 +758,7 @@ failed:
  * the cursor, any locks, wait on the returned record, and retry.
  */
 int
-hammer_ip_del_directory(struct hammer_transaction *trans,
+hammer_ip_del_direntry(struct hammer_transaction *trans,
                     hammer_cursor_t cursor, struct hammer_inode *dip,
                     struct hammer_inode *ip)
 {
index ea4d3f4..e10d6f8 100644 (file)
@@ -2034,12 +2034,12 @@ retry:
        /*
         * If all is ok we have to get the inode so we can adjust nlinks.
         *
-        * WARNING: hammer_ip_del_directory() may have to terminate the
+        * WARNING: hammer_ip_del_direntry() may have to terminate the
         * cursor to avoid a recursion.  It's ok to call hammer_done_cursor()
         * twice.
         */
        if (error == 0)
-               error = hammer_ip_del_directory(&trans, &cursor, fdip, ip);
+               error = hammer_ip_del_direntry(&trans, &cursor, fdip, ip);
 
        /*
         * XXX A deadlock here will break rename's atomicy for the purposes
@@ -3451,12 +3451,12 @@ retry:
                /*
                 * Delete the directory entry.
                 *
-                * WARNING: hammer_ip_del_directory() may have to terminate
+                * WARNING: hammer_ip_del_direntry() may have to terminate
                 * the cursor to avoid a deadlock.  It is ok to call
                 * hammer_done_cursor() twice.
                 */
                if (error == 0) {
-                       error = hammer_ip_del_directory(trans, &cursor,
+                       error = hammer_ip_del_direntry(trans, &cursor,
                                                        dip, ip);
                }
                hammer_done_cursor(&cursor);