sys/vfs/hammer: cleanup using existing macro
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Fri, 26 Dec 2014 20:38:02 +0000 (05:38 +0900)
committerAntonio Huete Jimenez <tuxillo@quantumachine.net>
Sat, 17 Jan 2015 16:06:56 +0000 (17:06 +0100)
- This patch is a cleanup with no change to behavior of
  hammer_ip_check_directory_empty().
- Using existing macro as well as a new macro HAMMER_RECTYPE_ENTRY_START
  (in the same fashion as HAMMER_RECTYPE_CLEAN_START) makes it easier to
  understand what this function is doing (just like other functions that
  use both key_beg/key_end do).

Closes: #2752

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

index d0fed5a..136aa1c 100644 (file)
@@ -676,6 +676,7 @@ typedef struct hammer_volume_ondisk *hammer_volume_ondisk_t;
 #define HAMMER_RECTYPE_MOVED           0x8000  /* special recovery flag */
 #define HAMMER_RECTYPE_MAX             0xFFFF
 
+#define HAMMER_RECTYPE_ENTRY_START     (HAMMER_RECTYPE_INODE + 1)
 #define HAMMER_RECTYPE_CLEAN_START     HAMMER_RECTYPE_EXT
 
 #define HAMMER_FIXKEY_SYMLINK          1
index e3b29d8..cc09b8d 100644 (file)
@@ -2640,11 +2640,11 @@ hammer_ip_check_directory_empty(hammer_transaction_t trans, hammer_inode_t ip)
        cursor.key_beg.create_tid = 0;
        cursor.key_beg.delete_tid = 0;
        cursor.key_beg.obj_type = 0;
-       cursor.key_beg.rec_type = HAMMER_RECTYPE_INODE + 1;
+       cursor.key_beg.rec_type = HAMMER_RECTYPE_ENTRY_START;
        cursor.key_beg.key = HAMMER_MIN_KEY;
 
        cursor.key_end = cursor.key_beg;
-       cursor.key_end.rec_type = 0xFFFF;
+       cursor.key_end.rec_type = HAMMER_RECTYPE_MAX;
        cursor.key_end.key = HAMMER_MAX_KEY;
 
        cursor.asof = ip->obj_asof;