kernel/vm: Correct virtual function declarations.

The base VMCache class changed to the generic_ types with their
introduction in in *2011* (435c43f591),
but these classes were never properly adapted. These functions should not
be called here (they panic() -- but the base class only returns B_ERROR,
so that is a difference at least.)

Found by Clang's -Woverloaded-virtual.
This commit is contained in:
Augustin Cavalier
2017-12-02 21:42:50 -05:00
parent e33d3563dc
commit bf77c15232
5 changed files with 21 additions and 21 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ public:
virtual bool HasPage(off_t offset); virtual bool HasPage(off_t offset);
virtual status_t Read(off_t offset, const generic_io_vec *vecs, virtual status_t Read(off_t offset, const generic_io_vec *vecs,
size_t count,uint32 flags, size_t count, uint32 flags,
generic_size_t *_numBytes); generic_size_t *_numBytes);
virtual status_t Write(off_t offset, const generic_io_vec *vecs, virtual status_t Write(off_t offset, const generic_io_vec *vecs,
size_t count, uint32 flags, size_t count, uint32 flags,
@@ -100,8 +100,8 @@ VMAnonymousNoSwapCache::HasPage(off_t offset)
status_t status_t
VMAnonymousNoSwapCache::Read(off_t offset, const iovec* vecs, size_t count, VMAnonymousNoSwapCache::Read(off_t offset, const generic_io_vec* vecs, size_t count,
uint32 flags, size_t* _numBytes) uint32 flags, generic_size_t* _numBytes)
{ {
panic("anonymous_store: read called. Invalid!\n"); panic("anonymous_store: read called. Invalid!\n");
return B_ERROR; return B_ERROR;
@@ -109,8 +109,8 @@ VMAnonymousNoSwapCache::Read(off_t offset, const iovec* vecs, size_t count,
status_t status_t
VMAnonymousNoSwapCache::Write(off_t offset, const iovec* vecs, size_t count, VMAnonymousNoSwapCache::Write(off_t offset, const generic_io_vec* vecs, size_t count,
uint32 flags, size_t* _numBytes) uint32 flags, generic_size_t* _numBytes)
{ {
// no place to write, this will cause the page daemon to skip this store // no place to write, this will cause the page daemon to skip this store
return B_ERROR; return B_ERROR;
@@ -27,12 +27,12 @@ public:
virtual int32 GuardSize() { return fGuardedSize; } virtual int32 GuardSize() { return fGuardedSize; }
virtual status_t Read(off_t offset, const iovec* vecs, virtual status_t Read(off_t offset, const generic_io_vec *vecs,
size_t count, uint32 flags, size_t count,uint32 flags,
size_t* _numBytes); generic_size_t *_numBytes);
virtual status_t Write(off_t offset, const iovec* vecs, virtual status_t Write(off_t offset, const generic_io_vec *vecs,
size_t count, uint32 flags, size_t count, uint32 flags,
size_t* _numBytes); generic_size_t *_numBytes);
virtual status_t Fault(struct VMAddressSpace* aspace, virtual status_t Fault(struct VMAddressSpace* aspace,
off_t offset); off_t offset);
+4 -4
View File
@@ -21,8 +21,8 @@ VMDeviceCache::Init(addr_t baseAddress, uint32 allocationFlags)
status_t status_t
VMDeviceCache::Read(off_t offset, const iovec* vecs, size_t count, VMDeviceCache::Read(off_t offset, const generic_io_vec *vecs, size_t count,
uint32 flags, size_t* _numBytes) uint32 flags, generic_size_t *_numBytes)
{ {
panic("device_store: read called. Invalid!\n"); panic("device_store: read called. Invalid!\n");
return B_ERROR; return B_ERROR;
@@ -30,8 +30,8 @@ VMDeviceCache::Read(off_t offset, const iovec* vecs, size_t count,
status_t status_t
VMDeviceCache::Write(off_t offset, const iovec* vecs, size_t count, VMDeviceCache::Write(off_t offset, const generic_io_vec* vecs, size_t count,
uint32 flags, size_t* _numBytes) uint32 flags, generic_size_t* _numBytes)
{ {
// no place to write, this will cause the page daemon to skip this store // no place to write, this will cause the page daemon to skip this store
return B_OK; return B_OK;
+6 -6
View File
@@ -18,12 +18,12 @@ public:
status_t Init(addr_t baseAddress, status_t Init(addr_t baseAddress,
uint32 allocationFlags); uint32 allocationFlags);
virtual status_t Read(off_t offset, const iovec* vecs, virtual status_t Read(off_t offset, const generic_io_vec *vecs,
size_t count, uint32 flags, size_t count, uint32 flags,
size_t* _numBytes); generic_size_t *_numBytes);
virtual status_t Write(off_t offset, const iovec* vecs, virtual status_t Write(off_t offset, const generic_io_vec *vecs,
size_t count, uint32 flags, size_t count, uint32 flags,
size_t* _numBytes); generic_size_t *_numBytes);
protected: protected:
virtual void DeleteObject(); virtual void DeleteObject();