Implemented the new attribute open/close/... FS hooks. The mapping to the
old interface is completely done in userland ATM. It becomes more and more obvious that we probably need to provide the kernel add-on with a bit more information about what the client FS interface supports in the first place, so we can save unnecessary trips to the userland. Opening/closing attributes for a FS using the old style interface could be handled completely in the kernel add-on, for instance (even if we lose a bit of accuracy wrt to open modes etc.). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20258 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -122,6 +122,14 @@ enum {
|
||||
REWIND_ATTR_DIR_REPLY,
|
||||
|
||||
// attributes
|
||||
CREATE_ATTR_REQUEST,
|
||||
CREATE_ATTR_REPLY,
|
||||
OPEN_ATTR_REQUEST,
|
||||
OPEN_ATTR_REPLY,
|
||||
CLOSE_ATTR_REQUEST,
|
||||
CLOSE_ATTR_REPLY,
|
||||
FREE_ATTR_COOKIE_REQUEST,
|
||||
FREE_ATTR_COOKIE_REPLY,
|
||||
READ_ATTR_REQUEST,
|
||||
READ_ATTR_REPLY,
|
||||
WRITE_ATTR_REQUEST,
|
||||
@@ -960,6 +968,67 @@ public:
|
||||
// #pragma mark - attributes
|
||||
|
||||
|
||||
// CreateAttrRequest
|
||||
class CreateAttrRequest : public NodeRequest {
|
||||
public:
|
||||
CreateAttrRequest() : NodeRequest(CREATE_ATTR_REQUEST) {}
|
||||
status_t GetAddressInfos(AddressInfo* infos, int32* count);
|
||||
|
||||
Address name;
|
||||
uint32 type;
|
||||
int openMode;
|
||||
};
|
||||
|
||||
// CreateAttrReply
|
||||
class CreateAttrReply : public ReplyRequest {
|
||||
public:
|
||||
CreateAttrReply() : ReplyRequest(CREATE_ATTR_REPLY) {}
|
||||
|
||||
fs_cookie attrCookie;
|
||||
};
|
||||
|
||||
// OpenAttrRequest
|
||||
class OpenAttrRequest : public NodeRequest {
|
||||
public:
|
||||
OpenAttrRequest() : NodeRequest(OPEN_ATTR_REQUEST) {}
|
||||
status_t GetAddressInfos(AddressInfo* infos, int32* count);
|
||||
|
||||
Address name;
|
||||
int openMode;
|
||||
};
|
||||
|
||||
// OpenAttrReply
|
||||
class OpenAttrReply : public ReplyRequest {
|
||||
public:
|
||||
OpenAttrReply() : ReplyRequest(OPEN_ATTR_REPLY) {}
|
||||
|
||||
fs_cookie attrCookie;
|
||||
};
|
||||
|
||||
// CloseAttrRequest
|
||||
class CloseAttrRequest : public AttributeRequest {
|
||||
public:
|
||||
CloseAttrRequest() : AttributeRequest(CLOSE_ATTR_REQUEST) {}
|
||||
};
|
||||
|
||||
// CloseAttrReply
|
||||
class CloseAttrReply : public ReplyRequest {
|
||||
public:
|
||||
CloseAttrReply() : ReplyRequest(CLOSE_ATTR_REPLY) {}
|
||||
};
|
||||
|
||||
// FreeAttrCookieRequest
|
||||
class FreeAttrCookieRequest : public AttributeRequest {
|
||||
public:
|
||||
FreeAttrCookieRequest() : AttributeRequest(FREE_ATTR_COOKIE_REQUEST) {}
|
||||
};
|
||||
|
||||
// FreeAttrCookieReply
|
||||
class FreeAttrCookieReply : public ReplyRequest {
|
||||
public:
|
||||
FreeAttrCookieReply() : ReplyRequest(FREE_ATTR_COOKIE_REPLY) {}
|
||||
};
|
||||
|
||||
// ReadAttrRequest
|
||||
class ReadAttrRequest : public AttributeRequest {
|
||||
public:
|
||||
@@ -1605,6 +1674,22 @@ do_for_request(Request* request, Task& task)
|
||||
case REWIND_ATTR_DIR_REPLY:
|
||||
return task((RewindAttrDirReply*)request);
|
||||
// attributes
|
||||
case CREATE_ATTR_REQUEST:
|
||||
return task((CreateAttrRequest*)request);
|
||||
case CREATE_ATTR_REPLY:
|
||||
return task((CreateAttrReply*)request);
|
||||
case OPEN_ATTR_REQUEST:
|
||||
return task((OpenAttrRequest*)request);
|
||||
case OPEN_ATTR_REPLY:
|
||||
return task((OpenAttrReply*)request);
|
||||
case CLOSE_ATTR_REQUEST:
|
||||
return task((CloseAttrRequest*)request);
|
||||
case CLOSE_ATTR_REPLY:
|
||||
return task((CloseAttrReply*)request);
|
||||
case FREE_ATTR_COOKIE_REQUEST:
|
||||
return task((FreeAttrCookieRequest*)request);
|
||||
case FREE_ATTR_COOKIE_REPLY:
|
||||
return task((FreeAttrCookieReply*)request);
|
||||
case READ_ATTR_REQUEST:
|
||||
return task((ReadAttrRequest*)request);
|
||||
case READ_ATTR_REPLY:
|
||||
@@ -1834,6 +1919,14 @@ using UserlandFSUtil::ReadAttrDirReply;
|
||||
using UserlandFSUtil::RewindAttrDirRequest;
|
||||
using UserlandFSUtil::RewindAttrDirReply;
|
||||
// attributes
|
||||
using UserlandFSUtil::CreateAttrRequest;
|
||||
using UserlandFSUtil::CreateAttrReply;
|
||||
using UserlandFSUtil::OpenAttrRequest;
|
||||
using UserlandFSUtil::OpenAttrReply;
|
||||
using UserlandFSUtil::CloseAttrRequest;
|
||||
using UserlandFSUtil::CloseAttrReply;
|
||||
using UserlandFSUtil::FreeAttrCookieRequest;
|
||||
using UserlandFSUtil::FreeAttrCookieReply;
|
||||
using UserlandFSUtil::ReadAttrRequest;
|
||||
using UserlandFSUtil::ReadAttrReply;
|
||||
using UserlandFSUtil::WriteAttrRequest;
|
||||
|
||||
@@ -32,6 +32,7 @@ enum {
|
||||
USERLAND_IOCTL_OPEN_FILES,
|
||||
USERLAND_IOCTL_OPEN_DIRECTORIES,
|
||||
USERLAND_IOCTL_OPEN_ATTRIBUTE_DIRECTORIES,
|
||||
USERLAND_IOCTL_OPEN_ATTRIBUTES,
|
||||
USERLAND_IOCTL_OPEN_INDEX_DIRECTORIES,
|
||||
USERLAND_IOCTL_OPEN_QUERIES,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user