ocfs2: Rename cleanups
PATCH 9/15 ocfs2: Rename cleanups
ocfs2_rename() does direct manipulation of the dirent it's gotten back from a directory search. Wrap this manipulation inside of a function so that we can transparently change directory update behavior in the future. As an added bonus, this gets rid of an ugly macro.
Signed-off-by Mark Fasheh <[email protected]>
--- fs/ocfs2/dir.c | 22 ++++++++++++++++++++++ fs/ocfs2/dir.h | 3 +++ fs/ocfs2/namei.c | 53 ++++++++++++++++++++++------------------------------- 3 files changed, 47 insertions(+), 31 deletions(-)
fs/ocfs2/dir.c +22 -0
@@ -271,6 +271,28 @@ cleanup_and_exit:return ret; } +int ocfs2_update_entry (struct inode *dir,handle_t *handle, +struct buffer_head *de_bh,struct ocfs2_dir_entry *de, +struct inode *new_entry_inode) +{ +int ret; + + ret =ocfs2_journal_access (handle, dir, de_bh, +OCFS2_JOURNAL_ACCESS_WRITE ); +if (ret) { +mlog_errno (ret); + goto out; + } + + de->inode =cpu_to_le64 (OCFS2_I (new_entry_inode)->ip_blkno); +ocfs2_set_de_type (de, new_entry_inode->i_mode); + +ocfs2_journal_dirty (handle, de_bh); + +out: +return ret; +} +/* * ocfs2_delete_entry deletes a directory entry by merging it with the * previous entry
fs/ocfs2/dir.h +3 -0
@@ -50,6 +50,9 @@ static inline int ocfs2_add_entry(handle_t *handle, dentry->d_name.name, dentry->d_name.len, inode, blkno, parent_fe_bh, insert_bh); } +int ocfs2_update_entry (struct inode *dir,handle_t *handle, +struct buffer_head *de_bh,struct ocfs2_dir_entry *de, +struct inode *new_entry_inode); int ocfs2_check_dir_for_entry(struct inode *dir, const char *name,
fs/ocfs2/namei.c +22 -31
92 lines not on this page · raw message
Signature · 1 line
1.5.0.6
PATCH 9/15 ocfs2: Rename cleanups
Quoted 6 lines · Mark Fasheh
ocfs2_rename()does direct manipulation of the dirent it's gotten back from a directory search. Wrap this manipulation inside of a function so that we can transparently change directory update behavior in the future. As an added bonus, this gets rid of an ugly macro.Signed-off-by Mark Fasheh <[email protected]>
Signed-off-by Joel Becker <[email protected]>
Signature · 10 lines
A good programming language should have features that make the kind of people who use the phrase "software engineering" shake their heads disapprovingly. - Paul Graham Joel Becker Principal Software Developer Oracle E-mail: [email protected] Phone: (650) 506-8127