han = hancnt;
*handle = han;
break;
- case DIROP_REN_NEW_TARGET:
- case DIROP_REN_OLD_TARGET:
+ case DIROP_REN_TARGET:
han = *handle;
break;
default:
dir_log_commit(&old_uh, fs, old_dir, &old_dentry->d_name,
old_inode->i_ino, DIROP_REN_SOURCE, &renhandle);
dir_log_commit(&new_uh, fs, new_dir, &new_dentry->d_name,
- 0,
- new_inode ? DIROP_REN_OLD_TARGET : DIROP_REN_NEW_TARGET,
+ new_inode ? new_inode->i_ino : 0,
+ DIROP_REN_TARGET,
&renhandle);
if (S_ISDIR(old_inode->i_mode)) {
inode_dec_link_count(old_dir);
#define DIROP_LINK 0
#define DIROP_UNLINK 1
#define DIROP_REN_SOURCE 2
-#define DIROP_REN_NEW_TARGET 3
-#define DIROP_REN_OLD_TARGET 4
+#define DIROP_REN_TARGET 3
/*
* The orphan file has a very simple structure with
* different objects.
*
* inode-files: meta-data updates, including size, are allowed.
- * index update and data update are not (data update must
+ * index update and data update are not (data update must
* go through the file). Implied creation requires
* orphan handling
- * regular-files: just over-write data, possibly extending size
+ * regular-files: could just over-write data, possibly extending size
+ * but there doesn't seem to be any reason to create such updates
+ * so we don't bother to try handling them.
* symlink,dev,pipe: as with reg-files
- * directory: add/remove entries.
+ * directory: add/remove entries. Each miniblock has an address and
+ * identifies a name, an inode number, and one of:
+ * LINK - create a link with this name to the inode
+ * UNLINK - remove the link
+ * REN_SOURCE - record this info against the 'address' which must
+ * be unique in this checkpoint across all directories
+ * REN_TARGET - The source with matching 'address' is being
+ * renamed to here. So unlink the source and either create the
+ * target (if inode is zero) or replace the target. This
+ * miniblock could be in a different directory to the matching
+ * REN_SOURCE.
*/
inode = lafs_iget_fs(fs, fsnum, inum, SYNC);