From 17d039eee41b25bde4014fba7ccf0efb2b3de70f Mon Sep 17 00:00:00 2001 From: Tomohiro Kusumi Date: Sun, 28 Feb 2016 19:30:55 +0900 Subject: [PATCH] sys/vfs/hammer: Rename hammer_ip_del_directory() to hammer_ip_del_direntry() 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 | 2 +- sys/vfs/hammer/hammer_object.c | 2 +- sys/vfs/hammer/hammer_vnops.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/vfs/hammer/hammer.h b/sys/vfs/hammer/hammer.h index deace9d1cd..be55605e2c 100644 --- a/sys/vfs/hammer/hammer.h +++ b/sys/vfs/hammer/hammer.h @@ -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); diff --git a/sys/vfs/hammer/hammer_object.c b/sys/vfs/hammer/hammer_object.c index 6eee3847d9..8a43436502 100644 --- a/sys/vfs/hammer/hammer_object.c +++ b/sys/vfs/hammer/hammer_object.c @@ -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) { diff --git a/sys/vfs/hammer/hammer_vnops.c b/sys/vfs/hammer/hammer_vnops.c index ea4d3f4471..e10d6f813f 100644 --- a/sys/vfs/hammer/hammer_vnops.c +++ b/sys/vfs/hammer/hammer_vnops.c @@ -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); -- 2.41.0