From ab3d6a3eafbd2e5fe3d66315550ec2231914c585 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 2 Nov 2011 19:09:48 +0000 Subject: [PATCH] Style cleanup. No functional change. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43122 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/cache/vnode_store.cpp | 14 ++++---- src/system/kernel/cache/vnode_store.h | 12 +++---- src/system/kernel/vm/VMAnonymousCache.h | 3 ++ .../kernel/vm/VMAnonymousNoSwapCache.cpp | 10 +++--- src/system/kernel/vm/VMAnonymousNoSwapCache.h | 35 +++++++++++-------- src/system/kernel/vm/VMDeviceCache.cpp | 8 ++--- src/system/kernel/vm/VMDeviceCache.h | 15 ++++---- 7 files changed, 54 insertions(+), 43 deletions(-) diff --git a/src/system/kernel/cache/vnode_store.cpp b/src/system/kernel/cache/vnode_store.cpp index a51e53a36d..9537c92486 100644 --- a/src/system/kernel/cache/vnode_store.cpp +++ b/src/system/kernel/cache/vnode_store.cpp @@ -17,7 +17,7 @@ status_t -VMVnodeCache::Init(struct vnode *vnode, uint32 allocationFlags) +VMVnodeCache::Init(struct vnode* vnode, uint32 allocationFlags) { status_t error = VMCache::Init(CACHE_TYPE_VNODE, allocationFlags); if (error != B_OK) @@ -42,8 +42,8 @@ VMVnodeCache::HasPage(off_t offset) status_t -VMVnodeCache::Read(off_t offset, const generic_io_vec *vecs, size_t count, - uint32 flags, generic_size_t *_numBytes) +VMVnodeCache::Read(off_t offset, const generic_io_vec* vecs, size_t count, + uint32 flags, generic_size_t* _numBytes) { generic_size_t bytesUntouched = *_numBytes; @@ -82,8 +82,8 @@ VMVnodeCache::Read(off_t offset, const generic_io_vec *vecs, size_t count, status_t -VMVnodeCache::Write(off_t offset, const generic_io_vec *vecs, size_t count, - uint32 flags, generic_size_t *_numBytes) +VMVnodeCache::Write(off_t offset, const generic_io_vec* vecs, size_t count, + uint32 flags, generic_size_t* _numBytes) { return vfs_write_pages(fVnode, NULL, offset, vecs, count, flags, _numBytes); } @@ -99,7 +99,7 @@ VMVnodeCache::WriteAsync(off_t offset, const generic_io_vec* vecs, size_t count, status_t -VMVnodeCache::Fault(struct VMAddressSpace *aspace, off_t offset) +VMVnodeCache::Fault(struct VMAddressSpace* aspace, off_t offset) { if (!HasPage(offset)) return B_BAD_ADDRESS; @@ -128,7 +128,7 @@ VMVnodeCache::AcquireUnreferencedStoreRef() if (fVnodeDeleted) return B_BUSY; - struct vnode *vnode; + struct vnode* vnode; status_t status = vfs_get_vnode(fDevice, fInode, false, &vnode); // If successful, update the store's vnode pointer, so that release_ref() diff --git a/src/system/kernel/cache/vnode_store.h b/src/system/kernel/cache/vnode_store.h index dd5de9cc03..bad4179a3b 100644 --- a/src/system/kernel/cache/vnode_store.h +++ b/src/system/kernel/cache/vnode_store.h @@ -15,24 +15,24 @@ struct file_cache_ref; class VMVnodeCache : public VMCache { public: - status_t Init(struct vnode *vnode, + status_t Init(struct vnode* vnode, uint32 allocationFlags); 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, - generic_size_t *_numBytes); - virtual status_t Write(off_t offset, const generic_io_vec *vecs, + generic_size_t* _numBytes); + virtual status_t Write(off_t offset, const generic_io_vec* vecs, size_t count, uint32 flags, - generic_size_t *_numBytes); + generic_size_t* _numBytes); virtual status_t WriteAsync(off_t offset, const generic_io_vec* vecs, size_t count, generic_size_t numBytes, uint32 flags, AsyncIOCallback* callback); virtual bool CanWritePage(off_t offset); - virtual status_t Fault(struct VMAddressSpace *aspace, + virtual status_t Fault(struct VMAddressSpace* aspace, off_t offset); virtual status_t AcquireUnreferencedStoreRef(); diff --git a/src/system/kernel/vm/VMAnonymousCache.h b/src/system/kernel/vm/VMAnonymousCache.h index 934e01eb45..af274c0922 100644 --- a/src/system/kernel/vm/VMAnonymousCache.h +++ b/src/system/kernel/vm/VMAnonymousCache.h @@ -64,6 +64,9 @@ public: virtual void Merge(VMCache* source); +protected: + virtual void DeleteObject(); + private: class WriteCallback; friend class WriteCallback; diff --git a/src/system/kernel/vm/VMAnonymousNoSwapCache.cpp b/src/system/kernel/vm/VMAnonymousNoSwapCache.cpp index 3bb45b0f6c..b6fe895eac 100644 --- a/src/system/kernel/vm/VMAnonymousNoSwapCache.cpp +++ b/src/system/kernel/vm/VMAnonymousNoSwapCache.cpp @@ -99,8 +99,8 @@ VMAnonymousNoSwapCache::HasPage(off_t offset) status_t -VMAnonymousNoSwapCache::Read(off_t offset, const iovec *vecs, size_t count, - uint32 flags, size_t *_numBytes) +VMAnonymousNoSwapCache::Read(off_t offset, const iovec* vecs, size_t count, + uint32 flags, size_t* _numBytes) { panic("anonymous_store: read called. Invalid!\n"); return B_ERROR; @@ -108,8 +108,8 @@ VMAnonymousNoSwapCache::Read(off_t offset, const iovec *vecs, size_t count, status_t -VMAnonymousNoSwapCache::Write(off_t offset, const iovec *vecs, size_t count, - uint32 flags, size_t *_numBytes) +VMAnonymousNoSwapCache::Write(off_t offset, const iovec* vecs, size_t count, + uint32 flags, size_t* _numBytes) { // no place to write, this will cause the page daemon to skip this store return B_ERROR; @@ -117,7 +117,7 @@ VMAnonymousNoSwapCache::Write(off_t offset, const iovec *vecs, size_t count, status_t -VMAnonymousNoSwapCache::Fault(struct VMAddressSpace *aspace, off_t offset) +VMAnonymousNoSwapCache::Fault(struct VMAddressSpace* aspace, off_t offset) { if (fCanOvercommit) { if (fGuardedSize > 0) { diff --git a/src/system/kernel/vm/VMAnonymousNoSwapCache.h b/src/system/kernel/vm/VMAnonymousNoSwapCache.h index 9269801be7..07a04762de 100644 --- a/src/system/kernel/vm/VMAnonymousNoSwapCache.h +++ b/src/system/kernel/vm/VMAnonymousNoSwapCache.h @@ -15,28 +15,33 @@ class VMAnonymousNoSwapCache : public VMCache { public: - virtual ~VMAnonymousNoSwapCache(); + virtual ~VMAnonymousNoSwapCache(); - status_t Init(bool canOvercommit, int32 numPrecommittedPages, - int32 numGuardPages, uint32 allocationFlags); + status_t Init(bool canOvercommit, + int32 numPrecommittedPages, + int32 numGuardPages, + uint32 allocationFlags); - virtual status_t Commit(off_t size, int priority); - virtual bool HasPage(off_t offset); + virtual status_t Commit(off_t size, int priority); + virtual bool HasPage(off_t offset); - virtual status_t Read(off_t offset, const iovec *vecs, size_t count, - uint32 flags, size_t *_numBytes); - virtual status_t Write(off_t offset, const iovec *vecs, size_t count, - uint32 flags, size_t *_numBytes); + virtual status_t Read(off_t offset, const iovec* vecs, + size_t count, uint32 flags, + size_t* _numBytes); + virtual status_t Write(off_t offset, const iovec* vecs, + size_t count, uint32 flags, + size_t* _numBytes); - virtual status_t Fault(struct VMAddressSpace *aspace, off_t offset); + virtual status_t Fault(struct VMAddressSpace* aspace, + off_t offset); - virtual void MergeStore(VMCache* source); + virtual void MergeStore(VMCache* source); private: - bool fCanOvercommit; - bool fHasPrecommitted; - uint8 fPrecommittedPages; - int32 fGuardedSize; + bool fCanOvercommit; + bool fHasPrecommitted; + uint8 fPrecommittedPages; + int32 fGuardedSize; }; diff --git a/src/system/kernel/vm/VMDeviceCache.cpp b/src/system/kernel/vm/VMDeviceCache.cpp index 07349704da..bff9baebed 100644 --- a/src/system/kernel/vm/VMDeviceCache.cpp +++ b/src/system/kernel/vm/VMDeviceCache.cpp @@ -19,8 +19,8 @@ VMDeviceCache::Init(addr_t baseAddress, uint32 allocationFlags) status_t -VMDeviceCache::Read(off_t offset, const iovec *vecs, size_t count, - uint32 flags, size_t *_numBytes) +VMDeviceCache::Read(off_t offset, const iovec* vecs, size_t count, + uint32 flags, size_t* _numBytes) { panic("device_store: read called. Invalid!\n"); return B_ERROR; @@ -28,8 +28,8 @@ VMDeviceCache::Read(off_t offset, const iovec *vecs, size_t count, status_t -VMDeviceCache::Write(off_t offset, const iovec *vecs, size_t count, - uint32 flags, size_t *_numBytes) +VMDeviceCache::Write(off_t offset, const iovec* vecs, size_t count, + uint32 flags, size_t* _numBytes) { // no place to write, this will cause the page daemon to skip this store return B_OK; diff --git a/src/system/kernel/vm/VMDeviceCache.h b/src/system/kernel/vm/VMDeviceCache.h index 575535ff16..8957198bb6 100644 --- a/src/system/kernel/vm/VMDeviceCache.h +++ b/src/system/kernel/vm/VMDeviceCache.h @@ -15,15 +15,18 @@ class VMDeviceCache : public VMCache { public: - status_t Init(addr_t baseAddress, uint32 allocationFlags); + status_t Init(addr_t baseAddress, + uint32 allocationFlags); - virtual status_t Read(off_t offset, const iovec *vecs, size_t count, - uint32 flags, size_t *_numBytes); - virtual status_t Write(off_t offset, const iovec *vecs, size_t count, - uint32 flags, size_t *_numBytes); + virtual status_t Read(off_t offset, const iovec* vecs, + size_t count, uint32 flags, + size_t* _numBytes); + virtual status_t Write(off_t offset, const iovec* vecs, + size_t count, uint32 flags, + size_t* _numBytes); private: - addr_t fBaseAddress; + addr_t fBaseAddress; };