We do now store a VNode object per node in a hash table. This allowed us to get
rid of the vnode count hash map and the mount vnode maps. Furthermore it will allows us to easily associate a file cache with each node. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29435 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
#include <Referenceable.h>
|
#include <Referenceable.h>
|
||||||
|
|
||||||
|
#include <kernel/lock.h>
|
||||||
|
|
||||||
#include "FSCapabilities.h"
|
#include "FSCapabilities.h"
|
||||||
|
|
||||||
namespace UserlandFSUtil {
|
namespace UserlandFSUtil {
|
||||||
@@ -40,12 +42,9 @@ public:
|
|||||||
inline dev_t GetID() const;
|
inline dev_t GetID() const;
|
||||||
|
|
||||||
inline bool HasCapability(int capability) const;
|
inline bool HasCapability(int capability) const;
|
||||||
inline bool HasVNodeCapability(void* vnode,
|
|
||||||
int capability) const;
|
|
||||||
|
|
||||||
void* GetUserlandVolume() const;
|
void* GetUserlandVolume() const;
|
||||||
ino_t GetRootID() const;
|
ino_t GetRootID() const;
|
||||||
bool IsMounting() const;
|
|
||||||
|
|
||||||
// client methods
|
// client methods
|
||||||
status_t GetVNode(ino_t vnid, void** node);
|
status_t GetVNode(ino_t vnid, void** node);
|
||||||
@@ -202,6 +201,13 @@ public:
|
|||||||
uint32* countRead);
|
uint32* countRead);
|
||||||
status_t RewindQuery(void* cookie);
|
status_t RewindQuery(void* cookie);
|
||||||
|
|
||||||
|
private:
|
||||||
|
struct VNode;
|
||||||
|
struct VNodeHashDefinition;
|
||||||
|
struct VNodeMap;
|
||||||
|
|
||||||
|
class AutoIncrementer;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
status_t _Mount(const char* device, uint32 flags,
|
status_t _Mount(const char* device, uint32 flags,
|
||||||
const char* parameters);
|
const char* parameters);
|
||||||
@@ -239,28 +245,24 @@ private:
|
|||||||
|
|
||||||
status_t _PutAllPendingVNodes();
|
status_t _PutAllPendingVNodes();
|
||||||
|
|
||||||
private:
|
inline bool HasVNodeCapability(VNode* vnode,
|
||||||
struct MountVNodeMap;
|
int capability) const;
|
||||||
struct VNodeCountMap;
|
|
||||||
class AutoIncrementer;
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
mutex fLock;
|
||||||
FileSystem* fFileSystem;
|
FileSystem* fFileSystem;
|
||||||
fs_volume* fFSVolume;
|
fs_volume* fFSVolume;
|
||||||
FSVolumeCapabilities fCapabilities;
|
FSVolumeCapabilities fCapabilities;
|
||||||
void* fUserlandVolume;
|
void* fUserlandVolume;
|
||||||
ino_t fRootID;
|
ino_t fRootID;
|
||||||
void* fRootNode;
|
VNode* fRootNode;
|
||||||
MountVNodeMap* fMountVNodes;
|
|
||||||
vint32 fOpenFiles;
|
vint32 fOpenFiles;
|
||||||
vint32 fOpenDirectories;
|
vint32 fOpenDirectories;
|
||||||
vint32 fOpenAttributeDirectories;
|
vint32 fOpenAttributeDirectories;
|
||||||
vint32 fOpenAttributes;
|
vint32 fOpenAttributes;
|
||||||
vint32 fOpenIndexDirectories;
|
vint32 fOpenIndexDirectories;
|
||||||
vint32 fOpenQueries;
|
vint32 fOpenQueries;
|
||||||
VNodeCountMap* fVNodeCountMap;
|
VNodeMap* fVNodes;
|
||||||
// Tracks the number of new/get_vnode()
|
|
||||||
// calls to be balanced by the FS by
|
|
||||||
// corresponding put_vnode()s.
|
|
||||||
volatile bool fVNodeCountingEnabled;
|
volatile bool fVNodeCountingEnabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -281,7 +283,7 @@ Volume::HasCapability(int capability) const
|
|||||||
|
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
Volume::HasVNodeCapability(void* vnode, int capability) const
|
Volume::HasVNodeCapability(VNode* vnode, int capability) const
|
||||||
{
|
{
|
||||||
// TODO: Implement for real!
|
// TODO: Implement for real!
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user