lock.h and cache.h are now C++ friendly.
If renaming failed late, the old name of the inode was restored, but the name index was not. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7835 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
5b168fe639
commit
fcf3d20e94
@ -1,6 +1,6 @@
|
||||
/* kernel_interface - file system interface to BeOS' vnode layer
|
||||
**
|
||||
** Initial version by Axel Dörfler, axeld@pinc-software.de
|
||||
** Copyright 2001-2004, Axel Dörfler, axeld@pinc-software.de
|
||||
** This file may be used under the terms of the OpenBeOS License.
|
||||
*/
|
||||
|
||||
@ -25,11 +25,9 @@
|
||||
#endif
|
||||
|
||||
#include <fsproto.h>
|
||||
|
||||
extern "C" {
|
||||
#include <lock.h>
|
||||
#include <cache.h>
|
||||
}
|
||||
#include <lock.h>
|
||||
|
||||
#include <fs_index.h>
|
||||
#include <fs_query.h>
|
||||
|
||||
@ -1169,6 +1167,8 @@ bfs_rename(void *_ns, void *_oldDir, const char *oldName, void *_newDir, const c
|
||||
return B_OK;
|
||||
}
|
||||
}
|
||||
// If we get here, something has gone wrong already!
|
||||
|
||||
// Those better don't fail, or we switch to a read-only
|
||||
// device for safety reasons (Volume::Panic() does this
|
||||
// for us)
|
||||
@ -1179,8 +1179,17 @@ bfs_rename(void *_ns, void *_oldDir, const char *oldName, void *_newDir, const c
|
||||
movedTree->Replace(&transaction, (const uint8 *)"..", 2, oldDirectory->ID());
|
||||
}
|
||||
}
|
||||
if (bailStatus == B_OK && nameUpdated)
|
||||
|
||||
if (bailStatus == B_OK && nameUpdated) {
|
||||
bailStatus = inode->SetName(&transaction, oldName);
|
||||
if (status == B_OK) {
|
||||
// update inode and index
|
||||
inode->WriteBack(&transaction);
|
||||
|
||||
Index index(volume);
|
||||
index.UpdateName(&transaction, newName, oldName, inode);
|
||||
}
|
||||
}
|
||||
|
||||
if (bailStatus == B_OK)
|
||||
bailStatus = newTree->Remove(&transaction, (const uint8 *)newName, strlen(newName), id);
|
||||
|
Loading…
Reference in New Issue
Block a user