packagefs: PackagesDirectory: Use node_ref
This commit is contained in:
@@ -18,7 +18,9 @@
|
|||||||
PackagesDirectory::PackagesDirectory()
|
PackagesDirectory::PackagesDirectory()
|
||||||
:
|
:
|
||||||
fPath(NULL),
|
fPath(NULL),
|
||||||
fDirFD(-1)
|
fDirFD(-1),
|
||||||
|
fNodeRef(),
|
||||||
|
fHashNext(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,8 +74,8 @@ status_t PackagesDirectory::Init(const char* path, dev_t mountPointDeviceID,
|
|||||||
if (fstat(fDirFD, &st) < 0)
|
if (fstat(fDirFD, &st) < 0)
|
||||||
RETURN_ERROR(errno);
|
RETURN_ERROR(errno);
|
||||||
|
|
||||||
fDeviceID = st.st_dev;
|
fNodeRef.device = st.st_dev;
|
||||||
fNodeID = st.st_ino;
|
fNodeRef.node = st.st_ino;
|
||||||
|
|
||||||
// get a normalized path
|
// get a normalized path
|
||||||
KPath normalizedPath;
|
KPath normalizedPath;
|
||||||
@@ -81,7 +83,7 @@ status_t PackagesDirectory::Init(const char* path, dev_t mountPointDeviceID,
|
|||||||
RETURN_ERROR(normalizedPath.InitCheck());
|
RETURN_ERROR(normalizedPath.InitCheck());
|
||||||
|
|
||||||
char* normalizedPathBuffer = normalizedPath.LockBuffer();
|
char* normalizedPathBuffer = normalizedPath.LockBuffer();
|
||||||
error = vfs_entry_ref_to_path(fDeviceID, fNodeID, NULL, true,
|
error = vfs_entry_ref_to_path(fNodeRef.device, fNodeRef.node, NULL, true,
|
||||||
normalizedPathBuffer, normalizedPath.BufferSize());
|
normalizedPathBuffer, normalizedPath.BufferSize());
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
RETURN_ERROR(error);
|
RETURN_ERROR(error);
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
#include <Referenceable.h>
|
#include <Referenceable.h>
|
||||||
|
|
||||||
|
#include "NodeRef.h"
|
||||||
|
|
||||||
|
|
||||||
class PackagesDirectory : public BReferenceable {
|
class PackagesDirectory : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
@@ -20,10 +22,12 @@ public:
|
|||||||
{ return fPath; }
|
{ return fPath; }
|
||||||
int DirectoryFD() const
|
int DirectoryFD() const
|
||||||
{ return fDirFD; }
|
{ return fDirFD; }
|
||||||
|
const node_ref& NodeRef() const
|
||||||
|
{ return fNodeRef; }
|
||||||
dev_t DeviceID() const
|
dev_t DeviceID() const
|
||||||
{ return fDeviceID; }
|
{ return fNodeRef.device; }
|
||||||
ino_t NodeID() const
|
ino_t NodeID() const
|
||||||
{ return fNodeID; }
|
{ return fNodeRef.node; }
|
||||||
|
|
||||||
status_t Init(const char* path, dev_t mountPointDeviceID,
|
status_t Init(const char* path, dev_t mountPointDeviceID,
|
||||||
ino_t mountPointNodeID, struct stat& _st);
|
ino_t mountPointNodeID, struct stat& _st);
|
||||||
@@ -31,8 +35,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
char* fPath;
|
char* fPath;
|
||||||
int fDirFD;
|
int fDirFD;
|
||||||
dev_t fDeviceID;
|
node_ref fNodeRef;
|
||||||
ino_t fNodeID;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user