Style cleanup. No functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43122 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
bbc851098d
commit
ab3d6a3eaf
14
src/system/kernel/cache/vnode_store.cpp
vendored
14
src/system/kernel/cache/vnode_store.cpp
vendored
@ -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()
|
||||
|
12
src/system/kernel/cache/vnode_store.h
vendored
12
src/system/kernel/cache/vnode_store.h
vendored
@ -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();
|
||||
|
@ -64,6 +64,9 @@ public:
|
||||
|
||||
virtual void Merge(VMCache* source);
|
||||
|
||||
protected:
|
||||
virtual void DeleteObject();
|
||||
|
||||
private:
|
||||
class WriteCallback;
|
||||
friend class WriteCallback;
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user