diff options
Diffstat (limited to 'fs/ocfs2/dir.c')
-rw-r--r-- | fs/ocfs2/dir.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 4791683a119c..31db7e3881b1 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c | |||
@@ -271,6 +271,28 @@ cleanup_and_exit: | |||
271 | return ret; | 271 | return ret; |
272 | } | 272 | } |
273 | 273 | ||
274 | int ocfs2_update_entry(struct inode *dir, handle_t *handle, | ||
275 | struct buffer_head *de_bh, struct ocfs2_dir_entry *de, | ||
276 | struct inode *new_entry_inode) | ||
277 | { | ||
278 | int ret; | ||
279 | |||
280 | ret = ocfs2_journal_access(handle, dir, de_bh, | ||
281 | OCFS2_JOURNAL_ACCESS_WRITE); | ||
282 | if (ret) { | ||
283 | mlog_errno(ret); | ||
284 | goto out; | ||
285 | } | ||
286 | |||
287 | de->inode = cpu_to_le64(OCFS2_I(new_entry_inode)->ip_blkno); | ||
288 | ocfs2_set_de_type(de, new_entry_inode->i_mode); | ||
289 | |||
290 | ocfs2_journal_dirty(handle, de_bh); | ||
291 | |||
292 | out: | ||
293 | return ret; | ||
294 | } | ||
295 | |||
274 | /* | 296 | /* |
275 | * ocfs2_delete_entry deletes a directory entry by merging it with the | 297 | * ocfs2_delete_entry deletes a directory entry by merging it with the |
276 | * previous entry | 298 | * previous entry |