From a83fe53dcebb1ea7b96f714ab8f51bae636a3823 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 26 Jun 2011 04:37:30 +0200 Subject: [PATCH] Added default cookie Close() implementation Added trivial implementation for AttributeCookie::Close() and AttributeDirectoryCookie::Close() and removed the identical Close() implementations in derived classes. --- .../kernel/file_systems/packagefs/AttributeCookie.cpp | 7 +++++++ .../kernel/file_systems/packagefs/AttributeCookie.h | 2 +- .../file_systems/packagefs/AttributeDirectoryCookie.cpp | 7 +++++++ .../file_systems/packagefs/AttributeDirectoryCookie.h | 2 +- .../packagefs/EmptyAttributeDirectoryCookie.cpp | 7 ------- .../file_systems/packagefs/EmptyAttributeDirectoryCookie.h | 1 - .../file_systems/packagefs/UnpackingAttributeCookie.cpp | 7 ------- .../file_systems/packagefs/UnpackingAttributeCookie.h | 1 - .../packagefs/UnpackingAttributeDirectoryCookie.cpp | 7 ------- .../packagefs/UnpackingAttributeDirectoryCookie.h | 1 - 10 files changed, 16 insertions(+), 26 deletions(-) diff --git a/src/add-ons/kernel/file_systems/packagefs/AttributeCookie.cpp b/src/add-ons/kernel/file_systems/packagefs/AttributeCookie.cpp index 2df7b99c4b..7a89ca4a0f 100644 --- a/src/add-ons/kernel/file_systems/packagefs/AttributeCookie.cpp +++ b/src/add-ons/kernel/file_systems/packagefs/AttributeCookie.cpp @@ -10,3 +10,10 @@ AttributeCookie::~AttributeCookie() { } + + +status_t +AttributeCookie::Close() +{ + return B_OK; +} diff --git a/src/add-ons/kernel/file_systems/packagefs/AttributeCookie.h b/src/add-ons/kernel/file_systems/packagefs/AttributeCookie.h index 40ee92c18f..142bdb9268 100644 --- a/src/add-ons/kernel/file_systems/packagefs/AttributeCookie.h +++ b/src/add-ons/kernel/file_systems/packagefs/AttributeCookie.h @@ -15,7 +15,7 @@ class AttributeCookie { public: virtual ~AttributeCookie(); - virtual status_t Close() = 0; + virtual status_t Close(); virtual status_t ReadAttribute(off_t offset, void* buffer, size_t* bufferSize) = 0; virtual status_t ReadAttributeStat(struct stat* st) = 0; diff --git a/src/add-ons/kernel/file_systems/packagefs/AttributeDirectoryCookie.cpp b/src/add-ons/kernel/file_systems/packagefs/AttributeDirectoryCookie.cpp index adbdc629f0..069e465c63 100644 --- a/src/add-ons/kernel/file_systems/packagefs/AttributeDirectoryCookie.cpp +++ b/src/add-ons/kernel/file_systems/packagefs/AttributeDirectoryCookie.cpp @@ -10,3 +10,10 @@ AttributeDirectoryCookie::~AttributeDirectoryCookie() { } + + +status_t +AttributeDirectoryCookie::Close() +{ + return B_OK; +} diff --git a/src/add-ons/kernel/file_systems/packagefs/AttributeDirectoryCookie.h b/src/add-ons/kernel/file_systems/packagefs/AttributeDirectoryCookie.h index eb5d271e16..3e1f766b29 100644 --- a/src/add-ons/kernel/file_systems/packagefs/AttributeDirectoryCookie.h +++ b/src/add-ons/kernel/file_systems/packagefs/AttributeDirectoryCookie.h @@ -15,7 +15,7 @@ class AttributeDirectoryCookie { public: virtual ~AttributeDirectoryCookie(); - virtual status_t Close() = 0; + virtual status_t Close(); virtual status_t Read(dev_t volumeID, ino_t nodeID, struct dirent* buffer, size_t bufferSize, uint32* _count) = 0; diff --git a/src/add-ons/kernel/file_systems/packagefs/EmptyAttributeDirectoryCookie.cpp b/src/add-ons/kernel/file_systems/packagefs/EmptyAttributeDirectoryCookie.cpp index dd0da85c5f..98a8eade0d 100644 --- a/src/add-ons/kernel/file_systems/packagefs/EmptyAttributeDirectoryCookie.cpp +++ b/src/add-ons/kernel/file_systems/packagefs/EmptyAttributeDirectoryCookie.cpp @@ -7,13 +7,6 @@ #include "EmptyAttributeDirectoryCookie.h" -status_t -EmptyAttributeDirectoryCookie::Close() -{ - return B_OK; -} - - status_t EmptyAttributeDirectoryCookie::Read(dev_t volumeID, ino_t nodeID, struct dirent* buffer, size_t bufferSize, uint32* _count) diff --git a/src/add-ons/kernel/file_systems/packagefs/EmptyAttributeDirectoryCookie.h b/src/add-ons/kernel/file_systems/packagefs/EmptyAttributeDirectoryCookie.h index 699b3d5687..5616591a60 100644 --- a/src/add-ons/kernel/file_systems/packagefs/EmptyAttributeDirectoryCookie.h +++ b/src/add-ons/kernel/file_systems/packagefs/EmptyAttributeDirectoryCookie.h @@ -11,7 +11,6 @@ class EmptyAttributeDirectoryCookie : public AttributeDirectoryCookie { public: - virtual status_t Close(); virtual status_t Read(dev_t volumeID, ino_t nodeID, struct dirent* buffer, size_t bufferSize, uint32* _count); diff --git a/src/add-ons/kernel/file_systems/packagefs/UnpackingAttributeCookie.cpp b/src/add-ons/kernel/file_systems/packagefs/UnpackingAttributeCookie.cpp index 212979cbdd..632038d887 100644 --- a/src/add-ons/kernel/file_systems/packagefs/UnpackingAttributeCookie.cpp +++ b/src/add-ons/kernel/file_systems/packagefs/UnpackingAttributeCookie.cpp @@ -100,13 +100,6 @@ UnpackingAttributeCookie::Open(PackageNode* packageNode, const char* name, } -status_t -UnpackingAttributeCookie::Close() -{ - return B_OK; -} - - status_t UnpackingAttributeCookie::ReadAttribute(off_t offset, void* buffer, size_t* bufferSize) diff --git a/src/add-ons/kernel/file_systems/packagefs/UnpackingAttributeCookie.h b/src/add-ons/kernel/file_systems/packagefs/UnpackingAttributeCookie.h index 27fec3dbe2..9dda846775 100644 --- a/src/add-ons/kernel/file_systems/packagefs/UnpackingAttributeCookie.h +++ b/src/add-ons/kernel/file_systems/packagefs/UnpackingAttributeCookie.h @@ -25,7 +25,6 @@ public: static status_t Open(PackageNode* packageNode, const char* name, int openMode, AttributeCookie*& _cookie); - virtual status_t Close(); virtual status_t ReadAttribute(off_t offset, void* buffer, size_t* bufferSize); virtual status_t ReadAttributeStat(struct stat* st); diff --git a/src/add-ons/kernel/file_systems/packagefs/UnpackingAttributeDirectoryCookie.cpp b/src/add-ons/kernel/file_systems/packagefs/UnpackingAttributeDirectoryCookie.cpp index 3a95440637..05f9b528f8 100644 --- a/src/add-ons/kernel/file_systems/packagefs/UnpackingAttributeDirectoryCookie.cpp +++ b/src/add-ons/kernel/file_systems/packagefs/UnpackingAttributeDirectoryCookie.cpp @@ -45,13 +45,6 @@ UnpackingAttributeDirectoryCookie::Open(PackageNode* packageNode, } -status_t -UnpackingAttributeDirectoryCookie::Close() -{ - return B_OK; -} - - status_t UnpackingAttributeDirectoryCookie::Read(dev_t volumeID, ino_t nodeID, struct dirent* buffer, size_t bufferSize, uint32* _count) diff --git a/src/add-ons/kernel/file_systems/packagefs/UnpackingAttributeDirectoryCookie.h b/src/add-ons/kernel/file_systems/packagefs/UnpackingAttributeDirectoryCookie.h index 0f6bc1baf0..a0ce184c90 100644 --- a/src/add-ons/kernel/file_systems/packagefs/UnpackingAttributeDirectoryCookie.h +++ b/src/add-ons/kernel/file_systems/packagefs/UnpackingAttributeDirectoryCookie.h @@ -24,7 +24,6 @@ public: static status_t Open(PackageNode* packageNode, AttributeDirectoryCookie*& _cookie); - virtual status_t Close(); virtual status_t Read(dev_t volumeID, ino_t nodeID, struct dirent* buffer, size_t bufferSize, uint32* _count);