- Ported over BFS to the new cache API - Inode no longer inherits from CachedBlock, and therefore, no longer keeps the whole inode block in memory. It now has a copy of the bfs_inode structure in memory instead. This has a number of advantages but also some disadvantages, so it might be reverted later, even if it's unlikely. - Added a NodeGetter class that can be used whenever the real block needs to be accessed (ie. for attributes) - Changed *transaction to &transaction where possible - Removed support for KEEP_WRONG_DIRENT_RECLEN - Removed support for uncached file access since that's no longer needed - Fixed some endian issues in bfs_write_stat() - Removed the install BFS rules, since they don't make any sense anymore (unless you are running Haiku ;-)) Note, logged streams are not supported anymore right now. Also, the transaction code is pretty simple and slow - it will be improved later on. Attribute code is pretty much untested in the new environment. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10053 a95241bf-73f2-0310-859d-f6bbb57e9c96
58 lines
1.6 KiB
C++
58 lines
1.6 KiB
C++
/* Index - index access functions
|
|
*
|
|
* Copyright 2001-2004, Axel Dörfler, [email protected].
|
|
* This file may be used under the terms of the MIT License.
|
|
*/
|
|
#ifndef INDEX_H
|
|
#define INDEX_H
|
|
|
|
|
|
#include <KernelExport.h>
|
|
|
|
class Transaction;
|
|
class Volume;
|
|
class Inode;
|
|
|
|
|
|
class Index {
|
|
public:
|
|
Index(Volume *volume);
|
|
~Index();
|
|
|
|
status_t SetTo(const char *name);
|
|
void Unset();
|
|
|
|
Inode *Node() const { return fNode; };
|
|
uint32 Type();
|
|
size_t KeySize();
|
|
|
|
status_t Create(Transaction &transaction, const char *name, uint32 type);
|
|
|
|
status_t Update(Transaction &transaction, const char *name, int32 type, const uint8 *oldKey,
|
|
uint16 oldLength, const uint8 *newKey, uint16 newLength, Inode *inode);
|
|
|
|
status_t InsertName(Transaction &transaction, const char *name, Inode *inode);
|
|
status_t RemoveName(Transaction &transaction, const char *name, Inode *inode);
|
|
status_t UpdateName(Transaction &transaction, const char *oldName, const char *newName,
|
|
Inode *inode);
|
|
|
|
status_t InsertSize(Transaction &transaction, Inode *inode);
|
|
status_t RemoveSize(Transaction &transaction, Inode *inode);
|
|
status_t UpdateSize(Transaction &transaction, Inode *inode);
|
|
|
|
status_t InsertLastModified(Transaction &transaction, Inode *inode);
|
|
status_t RemoveLastModified(Transaction &transaction, Inode *inode);
|
|
status_t UpdateLastModified(Transaction &transaction, Inode *inode, off_t modified = -1);
|
|
|
|
private:
|
|
Index(const Index &);
|
|
Index &operator=(const Index &);
|
|
// no implementation
|
|
|
|
Volume *fVolume;
|
|
Inode *fNode;
|
|
const char *fName;
|
|
};
|
|
|
|
#endif /* INDEX_H */
|