Make the launch_speedup module compile again.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26467 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2008-07-17 01:03:12 +00:00
parent d73327e274
commit 51c99056b5
2 changed files with 20 additions and 22 deletions

View File

@ -1,6 +1,6 @@
SubDir HAIKU_TOP src add-ons kernel file_cache ; SubDir HAIKU_TOP src add-ons kernel file_cache ;
UsePrivateHeaders kernel ; UsePrivateKernelHeaders ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_ARCH) ] ; UsePrivateHeaders [ FDirName kernel arch $(TARGET_ARCH) ] ;
UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ; UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ;

View File

@ -66,8 +66,8 @@ struct node {
class Session { class Session {
public: public:
Session(team_id team, const char *name, mount_id device, Session(team_id team, const char *name, dev_t device,
vnode_id node, int32 seconds); ino_t node, int32 seconds);
Session(const char *name); Session(const char *name);
~Session(); ~Session();
@ -80,8 +80,8 @@ class Session {
bool IsMainSession() const; bool IsMainSession() const;
bool IsWorthSaving() const; bool IsWorthSaving() const;
void AddNode(mount_id device, vnode_id node); void AddNode(dev_t device, ino_t node);
void RemoveNode(mount_id device, vnode_id node); void RemoveNode(dev_t device, ino_t node);
void Lock() { mutex_lock(&fLock); } void Lock() { mutex_lock(&fLock); }
void Unlock() { mutex_unlock(&fLock); } void Unlock() { mutex_unlock(&fLock); }
@ -97,7 +97,7 @@ class Session {
static uint32 NextOffset() { return offsetof(Session, fNext); } static uint32 NextOffset() { return offsetof(Session, fNext); }
private: private:
struct node *_FindNode(mount_id device, vnode_id node); struct node *_FindNode(dev_t device, ino_t node);
Session *fNext; Session *fNext;
char fName[B_OS_NAME_LENGTH]; char fName[B_OS_NAME_LENGTH];
@ -118,7 +118,7 @@ class SessionGetter {
SessionGetter(team_id team, Session **_session); SessionGetter(team_id team, Session **_session);
~SessionGetter(); ~SessionGetter();
status_t New(const char *name, mount_id device, vnode_id node, status_t New(const char *name, dev_t device, ino_t node,
Session **_session); Session **_session);
void Stop(); void Stop();
@ -245,7 +245,7 @@ stop_session(Session *session)
static Session * static Session *
start_session(team_id team, mount_id device, vnode_id node, const char *name, start_session(team_id team, dev_t device, ino_t node, const char *name,
int32 seconds = 30) int32 seconds = 30)
{ {
RecursiveLocker locker(&sLock); RecursiveLocker locker(&sLock);
@ -317,7 +317,7 @@ parse_node_ref(const char *string, node_ref &ref, const char **_end = NULL)
static struct node * static struct node *
new_node(mount_id device, vnode_id id) new_node(dev_t device, ino_t id)
{ {
struct node *node = new ::node; struct node *node = new ::node;
if (node == NULL) if (node == NULL)
@ -345,7 +345,7 @@ load_prefetch_data()
Session *session = new Session(dirent->d_name); Session *session = new Session(dirent->d_name);
if (session->LoadFromDirectory(dir->fd) != B_OK) { if (session->LoadFromDirectory(dirfd(dir)) != B_OK) {
delete session; delete session;
continue; continue;
} }
@ -365,8 +365,8 @@ load_prefetch_data()
// #pragma mark - // #pragma mark -
Session::Session(team_id team, const char *name, mount_id device, Session::Session(team_id team, const char *name, dev_t device,
vnode_id node, int32 seconds) ino_t node, int32 seconds)
: :
fNodes(NULL), fNodes(NULL),
fNodeCount(0), fNodeCount(0),
@ -447,9 +447,6 @@ Session::~Session()
status_t status_t
Session::InitCheck() Session::InitCheck()
{ {
if (fLock.sem < B_OK)
return fLock.sem;
if (fNodeHash == NULL) if (fNodeHash == NULL)
return B_NO_MEMORY; return B_NO_MEMORY;
@ -458,7 +455,7 @@ Session::InitCheck()
node * node *
Session::_FindNode(mount_id device, vnode_id node) Session::_FindNode(dev_t device, ino_t node)
{ {
node_ref key; node_ref key;
key.device = device; key.device = device;
@ -469,7 +466,7 @@ Session::_FindNode(mount_id device, vnode_id node)
void void
Session::AddNode(mount_id device, vnode_id id) Session::AddNode(dev_t device, ino_t id)
{ {
struct node *node = _FindNode(device, id); struct node *node = _FindNode(device, id);
if (node != NULL) { if (node != NULL) {
@ -487,7 +484,7 @@ Session::AddNode(mount_id device, vnode_id id)
void void
Session::RemoveNode(mount_id device, vnode_id id) Session::RemoveNode(dev_t device, ino_t id)
{ {
struct node *node = _FindNode(device, id); struct node *node = _FindNode(device, id);
if (node != NULL && --node->ref_count <= 0) { if (node != NULL && --node->ref_count <= 0) {
@ -685,7 +682,7 @@ SessionGetter::~SessionGetter()
status_t status_t
SessionGetter::New(const char *name, mount_id device, vnode_id node, SessionGetter::New(const char *name, dev_t device, ino_t node,
Session **_session) Session **_session)
{ {
struct thread *thread = thread_get_current_thread(); struct thread *thread = thread_get_current_thread();
@ -714,8 +711,8 @@ SessionGetter::Stop()
static void static void
node_opened(void *vnode, int32 fdType, mount_id device, vnode_id parent, node_opened(struct vnode *vnode, int32 fdType, dev_t device, ino_t parent,
vnode_id node, const char *name, off_t size) ino_t node, const char *name, off_t size)
{ {
if (device < gBootDevice) { if (device < gBootDevice) {
// we ignore any access to rootfs, pipefs, and devfs // we ignore any access to rootfs, pipefs, and devfs
@ -749,7 +746,8 @@ node_opened(void *vnode, int32 fdType, mount_id device, vnode_id parent,
static void static void
node_closed(void *vnode, int32 fdType, mount_id device, vnode_id node, int32 accessType) node_closed(struct vnode *vnode, int32 fdType, dev_t device, ino_t node,
int32 accessType)
{ {
Session *session; Session *session;
SessionGetter getter(team_get_current_team_id(), &session); SessionGetter getter(team_get_current_team_id(), &session);