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
|
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);
|
status_t error = VMCache::Init(CACHE_TYPE_VNODE, allocationFlags);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
@ -42,8 +42,8 @@ VMVnodeCache::HasPage(off_t offset)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
VMVnodeCache::Read(off_t offset, const generic_io_vec *vecs, size_t count,
|
VMVnodeCache::Read(off_t offset, const generic_io_vec* vecs, size_t count,
|
||||||
uint32 flags, generic_size_t *_numBytes)
|
uint32 flags, generic_size_t* _numBytes)
|
||||||
{
|
{
|
||||||
generic_size_t bytesUntouched = *_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
|
status_t
|
||||||
VMVnodeCache::Write(off_t offset, const generic_io_vec *vecs, size_t count,
|
VMVnodeCache::Write(off_t offset, const generic_io_vec* vecs, size_t count,
|
||||||
uint32 flags, generic_size_t *_numBytes)
|
uint32 flags, generic_size_t* _numBytes)
|
||||||
{
|
{
|
||||||
return vfs_write_pages(fVnode, NULL, offset, vecs, count, flags, _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
|
status_t
|
||||||
VMVnodeCache::Fault(struct VMAddressSpace *aspace, off_t offset)
|
VMVnodeCache::Fault(struct VMAddressSpace* aspace, off_t offset)
|
||||||
{
|
{
|
||||||
if (!HasPage(offset))
|
if (!HasPage(offset))
|
||||||
return B_BAD_ADDRESS;
|
return B_BAD_ADDRESS;
|
||||||
@ -128,7 +128,7 @@ VMVnodeCache::AcquireUnreferencedStoreRef()
|
|||||||
if (fVnodeDeleted)
|
if (fVnodeDeleted)
|
||||||
return B_BUSY;
|
return B_BUSY;
|
||||||
|
|
||||||
struct vnode *vnode;
|
struct vnode* vnode;
|
||||||
status_t status = vfs_get_vnode(fDevice, fInode, false, &vnode);
|
status_t status = vfs_get_vnode(fDevice, fInode, false, &vnode);
|
||||||
|
|
||||||
// If successful, update the store's vnode pointer, so that release_ref()
|
// 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 {
|
class VMVnodeCache : public VMCache {
|
||||||
public:
|
public:
|
||||||
status_t Init(struct vnode *vnode,
|
status_t Init(struct vnode* vnode,
|
||||||
uint32 allocationFlags);
|
uint32 allocationFlags);
|
||||||
|
|
||||||
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,
|
||||||
generic_size_t *_numBytes);
|
generic_size_t* _numBytes);
|
||||||
virtual status_t WriteAsync(off_t offset,
|
virtual status_t WriteAsync(off_t offset,
|
||||||
const generic_io_vec* vecs, size_t count,
|
const generic_io_vec* vecs, size_t count,
|
||||||
generic_size_t numBytes, uint32 flags,
|
generic_size_t numBytes, uint32 flags,
|
||||||
AsyncIOCallback* callback);
|
AsyncIOCallback* callback);
|
||||||
virtual bool CanWritePage(off_t offset);
|
virtual bool CanWritePage(off_t offset);
|
||||||
|
|
||||||
virtual status_t Fault(struct VMAddressSpace *aspace,
|
virtual status_t Fault(struct VMAddressSpace* aspace,
|
||||||
off_t offset);
|
off_t offset);
|
||||||
|
|
||||||
virtual status_t AcquireUnreferencedStoreRef();
|
virtual status_t AcquireUnreferencedStoreRef();
|
||||||
|
@ -64,6 +64,9 @@ public:
|
|||||||
|
|
||||||
virtual void Merge(VMCache* source);
|
virtual void Merge(VMCache* source);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void DeleteObject();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class WriteCallback;
|
class WriteCallback;
|
||||||
friend class WriteCallback;
|
friend class WriteCallback;
|
||||||
|
@ -99,8 +99,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 iovec* vecs, size_t count,
|
||||||
uint32 flags, size_t *_numBytes)
|
uint32 flags, size_t* _numBytes)
|
||||||
{
|
{
|
||||||
panic("anonymous_store: read called. Invalid!\n");
|
panic("anonymous_store: read called. Invalid!\n");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
@ -108,8 +108,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 iovec* vecs, size_t count,
|
||||||
uint32 flags, size_t *_numBytes)
|
uint32 flags, 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;
|
||||||
@ -117,7 +117,7 @@ VMAnonymousNoSwapCache::Write(off_t offset, const iovec *vecs, size_t count,
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
VMAnonymousNoSwapCache::Fault(struct VMAddressSpace *aspace, off_t offset)
|
VMAnonymousNoSwapCache::Fault(struct VMAddressSpace* aspace, off_t offset)
|
||||||
{
|
{
|
||||||
if (fCanOvercommit) {
|
if (fCanOvercommit) {
|
||||||
if (fGuardedSize > 0) {
|
if (fGuardedSize > 0) {
|
||||||
|
@ -15,28 +15,33 @@
|
|||||||
|
|
||||||
class VMAnonymousNoSwapCache : public VMCache {
|
class VMAnonymousNoSwapCache : public VMCache {
|
||||||
public:
|
public:
|
||||||
virtual ~VMAnonymousNoSwapCache();
|
virtual ~VMAnonymousNoSwapCache();
|
||||||
|
|
||||||
status_t Init(bool canOvercommit, int32 numPrecommittedPages,
|
status_t Init(bool canOvercommit,
|
||||||
int32 numGuardPages, uint32 allocationFlags);
|
int32 numPrecommittedPages,
|
||||||
|
int32 numGuardPages,
|
||||||
|
uint32 allocationFlags);
|
||||||
|
|
||||||
virtual status_t Commit(off_t size, int priority);
|
virtual status_t Commit(off_t size, int priority);
|
||||||
virtual bool HasPage(off_t offset);
|
virtual bool HasPage(off_t offset);
|
||||||
|
|
||||||
virtual status_t Read(off_t offset, const iovec *vecs, size_t count,
|
virtual status_t Read(off_t offset, const iovec* vecs,
|
||||||
uint32 flags, size_t *_numBytes);
|
size_t count, uint32 flags,
|
||||||
virtual status_t Write(off_t offset, const iovec *vecs, size_t count,
|
size_t* _numBytes);
|
||||||
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:
|
private:
|
||||||
bool fCanOvercommit;
|
bool fCanOvercommit;
|
||||||
bool fHasPrecommitted;
|
bool fHasPrecommitted;
|
||||||
uint8 fPrecommittedPages;
|
uint8 fPrecommittedPages;
|
||||||
int32 fGuardedSize;
|
int32 fGuardedSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,8 +19,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 iovec* vecs, size_t count,
|
||||||
uint32 flags, size_t *_numBytes)
|
uint32 flags, size_t* _numBytes)
|
||||||
{
|
{
|
||||||
panic("device_store: read called. Invalid!\n");
|
panic("device_store: read called. Invalid!\n");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
@ -28,8 +28,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 iovec* vecs, size_t count,
|
||||||
uint32 flags, size_t *_numBytes)
|
uint32 flags, 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;
|
||||||
|
@ -15,15 +15,18 @@
|
|||||||
|
|
||||||
class VMDeviceCache : public VMCache {
|
class VMDeviceCache : public VMCache {
|
||||||
public:
|
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,
|
virtual status_t Read(off_t offset, const iovec* vecs,
|
||||||
uint32 flags, size_t *_numBytes);
|
size_t count, uint32 flags,
|
||||||
virtual status_t Write(off_t offset, const iovec *vecs, size_t count,
|
size_t* _numBytes);
|
||||||
uint32 flags, size_t *_numBytes);
|
virtual status_t Write(off_t offset, const iovec* vecs,
|
||||||
|
size_t count, uint32 flags,
|
||||||
|
size_t* _numBytes);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
addr_t fBaseAddress;
|
addr_t fBaseAddress;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user