From 1d5f9787e82c1d9b454caa0a4625620dc6e68ecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 6 Dec 2002 04:32:48 +0000 Subject: [PATCH] Added a few comments and ToDo items. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2167 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/Inode.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/add-ons/kernel/file_systems/bfs/Inode.cpp b/src/add-ons/kernel/file_systems/bfs/Inode.cpp index ea341bcb96..c59b53d480 100644 --- a/src/add-ons/kernel/file_systems/bfs/Inode.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Inode.cpp @@ -689,6 +689,10 @@ Inode::WriteAttribute(Transaction *transaction, const char *name, int32 type, of uint8 oldBuffer[BPLUSTREE_MAX_KEY_LENGTH], *oldData = NULL; size_t oldLength = 0; + // ToDo: we actually depend on that the contents of "buffer" are constant + // if they get changed during the write (hey, user programs), we may mess + // up our index trees! + Index index(fVolume); bool hasIndex = index.SetTo(name) == B_OK; @@ -729,8 +733,9 @@ Inode::WriteAttribute(Transaction *transaction, const char *name, int32 type, of if (attribute->ReadAt(0, oldBuffer, &oldLength) == B_OK) oldData = oldBuffer; } + // ToDo: check if the data fits in the inode now and delete the file if so status = attribute->WriteAt(transaction, pos, buffer, _length); - + attribute->Lock().UnlockWrite(); } else status = B_ERROR;