* bfs_fsync() was the only place which could cause the
fs_vnode_ops::write_pages() to be called with fsReenter = true. Since this is no longer the case, the argument has become superfluous. For read_pages() it always was. Removed the argument from the functions and all functions that propagated it. * Some whitespace at the end of lines was removed. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26579 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -119,11 +119,10 @@ struct fs_vnode_ops {
|
||||
/* VM file access */
|
||||
bool (*can_page)(fs_volume *volume, fs_vnode *vnode, void *cookie);
|
||||
status_t (*read_pages)(fs_volume *volume, fs_vnode *vnode, void *cookie,
|
||||
off_t pos, const iovec *vecs, size_t count, size_t *_numBytes,
|
||||
bool reenter);
|
||||
off_t pos, const iovec *vecs, size_t count, size_t *_numBytes);
|
||||
status_t (*write_pages)(fs_volume *volume, fs_vnode *vnode,
|
||||
void *cookie, off_t pos, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool reenter);
|
||||
size_t *_numBytes);
|
||||
|
||||
/* cache file access */
|
||||
status_t (*get_file_map)(fs_volume *volume, fs_vnode *vnode, off_t offset,
|
||||
@@ -299,9 +298,9 @@ extern status_t get_vnode_removed(fs_volume *volume, ino_t vnodeID,
|
||||
bool *removed);
|
||||
|
||||
extern status_t read_pages(int fd, off_t pos, const struct iovec *vecs,
|
||||
size_t count, size_t *_numBytes, bool fsReenter);
|
||||
size_t count, size_t *_numBytes);
|
||||
extern status_t write_pages(int fd, off_t pos, const struct iovec *vecs,
|
||||
size_t count, size_t *_numBytes, bool fsReenter);
|
||||
size_t count, size_t *_numBytes);
|
||||
extern status_t read_file_io_vec_pages(int fd,
|
||||
const struct file_io_vec *fileVecs, size_t fileVecCount,
|
||||
const struct iovec *vecs, size_t vecCount,
|
||||
|
||||
@@ -137,10 +137,10 @@ struct fssh_fs_vnode_ops {
|
||||
fssh_fs_cookie cookie);
|
||||
fssh_status_t (*read_pages)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
|
||||
fssh_fs_cookie cookie, fssh_off_t pos, const fssh_iovec *vecs,
|
||||
fssh_size_t count, fssh_size_t *_numBytes, bool reenter);
|
||||
fssh_size_t count, fssh_size_t *_numBytes);
|
||||
fssh_status_t (*write_pages)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
|
||||
fssh_fs_cookie cookie, fssh_off_t pos, const fssh_iovec *vecs,
|
||||
fssh_size_t count, fssh_size_t *_numBytes, bool reenter);
|
||||
fssh_size_t count, fssh_size_t *_numBytes);
|
||||
|
||||
/* cache file access */
|
||||
fssh_status_t (*get_file_map)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
|
||||
@@ -339,10 +339,10 @@ extern fssh_status_t fssh_get_vnode_removed(fssh_fs_volume *volume,
|
||||
|
||||
extern fssh_status_t fssh_read_pages(int fd, fssh_off_t pos,
|
||||
const struct fssh_iovec *vecs, fssh_size_t count,
|
||||
fssh_size_t *_numBytes, bool fsReenter);
|
||||
fssh_size_t *_numBytes);
|
||||
extern fssh_status_t fssh_write_pages(int fd, fssh_off_t pos,
|
||||
const struct fssh_iovec *vecs, fssh_size_t count,
|
||||
fssh_size_t *_numBytes, bool fsReenter);
|
||||
fssh_size_t *_numBytes);
|
||||
extern fssh_status_t fssh_read_file_io_vec_pages(int fd,
|
||||
const struct fssh_file_io_vec *fileVecs,
|
||||
fssh_size_t fileVecCount, const struct fssh_iovec *vecs,
|
||||
|
||||
@@ -94,9 +94,9 @@ void vfs_acquire_vnode(struct vnode *vnode);
|
||||
status_t vfs_get_cookie_from_fd(int fd, void **_cookie);
|
||||
bool vfs_can_page(struct vnode *vnode, void *cookie);
|
||||
status_t vfs_read_pages(struct vnode *vnode, void *cookie, off_t pos,
|
||||
const iovec *vecs, size_t count, size_t *_numBytes, bool fsReenter);
|
||||
const iovec *vecs, size_t count, size_t *_numBytes);
|
||||
status_t vfs_write_pages(struct vnode *vnode, void *cookie, off_t pos,
|
||||
const iovec *vecs, size_t count, size_t *_numBytes, bool fsReenter);
|
||||
const iovec *vecs, size_t count, size_t *_numBytes);
|
||||
status_t vfs_get_vnode_cache(struct vnode *vnode, struct VMCache **_cache,
|
||||
bool allocate);
|
||||
status_t vfs_get_file_map(struct vnode *vnode, off_t offset, size_t size,
|
||||
|
||||
@@ -36,8 +36,8 @@ size_t vm_page_num_free_pages(void);
|
||||
size_t vm_page_num_available_pages(void);
|
||||
|
||||
status_t vm_page_write_modified_page_range(struct VMCache *cache,
|
||||
uint32 firstPage, uint32 endPage, bool fsReenter);
|
||||
status_t vm_page_write_modified_pages(struct VMCache *cache, bool fsReenter);
|
||||
uint32 firstPage, uint32 endPage);
|
||||
status_t vm_page_write_modified_pages(struct VMCache *cache);
|
||||
void vm_page_schedule_write_page(struct vm_page *page);
|
||||
void vm_page_schedule_write_page_range(struct VMCache *cache,
|
||||
uint32 firstPage, uint32 endPage);
|
||||
|
||||
@@ -202,7 +202,7 @@ public:
|
||||
status_t InsertAreaLocked(vm_area* area);
|
||||
status_t RemoveArea(vm_area* area);
|
||||
|
||||
status_t WriteModified(bool fsReenter);
|
||||
status_t WriteModified();
|
||||
status_t SetMinimalCommitment(off_t commitment);
|
||||
status_t Resize(off_t newSize);
|
||||
|
||||
@@ -217,9 +217,9 @@ public:
|
||||
virtual bool HasPage(off_t offset);
|
||||
|
||||
virtual status_t Read(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter);
|
||||
size_t *_numBytes);
|
||||
virtual status_t Write(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter);
|
||||
size_t *_numBytes);
|
||||
|
||||
virtual status_t Fault(struct vm_address_space *aspace, off_t offset);
|
||||
|
||||
|
||||
@@ -332,7 +332,7 @@ bfs_can_page(fs_volume *_volume, fs_vnode *_v, void *_cookie)
|
||||
|
||||
static status_t
|
||||
bfs_read_pages(fs_volume *_volume, fs_vnode *_node, void *_cookie,
|
||||
off_t pos, const iovec *vecs, size_t count, size_t *_numBytes, bool reenter)
|
||||
off_t pos, const iovec *vecs, size_t count, size_t *_numBytes)
|
||||
{
|
||||
Volume *volume = (Volume *)_volume->private_volume;
|
||||
Inode *inode = (Inode *)_node->private_node;
|
||||
@@ -340,8 +340,7 @@ bfs_read_pages(fs_volume *_volume, fs_vnode *_node, void *_cookie,
|
||||
if (inode->FileCache() == NULL)
|
||||
RETURN_ERROR(B_BAD_VALUE);
|
||||
|
||||
if (!reenter)
|
||||
rw_lock_read_lock(&inode->Lock());
|
||||
rw_lock_read_lock(&inode->Lock());
|
||||
|
||||
uint32 vecIndex = 0;
|
||||
size_t vecOffset = 0;
|
||||
@@ -369,8 +368,7 @@ bfs_read_pages(fs_volume *_volume, fs_vnode *_node, void *_cookie,
|
||||
bytesLeft -= bytes;
|
||||
}
|
||||
|
||||
if (!reenter)
|
||||
rw_lock_read_unlock(&inode->Lock());
|
||||
rw_lock_read_unlock(&inode->Lock());
|
||||
|
||||
return status;
|
||||
}
|
||||
@@ -378,7 +376,7 @@ bfs_read_pages(fs_volume *_volume, fs_vnode *_node, void *_cookie,
|
||||
|
||||
static status_t
|
||||
bfs_write_pages(fs_volume *_volume, fs_vnode *_node, void *_cookie,
|
||||
off_t pos, const iovec *vecs, size_t count, size_t *_numBytes, bool reenter)
|
||||
off_t pos, const iovec *vecs, size_t count, size_t *_numBytes)
|
||||
{
|
||||
Volume *volume = (Volume *)_volume->private_volume;
|
||||
Inode *inode = (Inode *)_node->private_node;
|
||||
@@ -389,8 +387,7 @@ bfs_write_pages(fs_volume *_volume, fs_vnode *_node, void *_cookie,
|
||||
if (inode->FileCache() == NULL)
|
||||
RETURN_ERROR(B_BAD_VALUE);
|
||||
|
||||
if (!reenter)
|
||||
rw_lock_read_lock(&inode->Lock());
|
||||
rw_lock_read_lock(&inode->Lock());
|
||||
|
||||
uint32 vecIndex = 0;
|
||||
size_t vecOffset = 0;
|
||||
@@ -418,8 +415,7 @@ bfs_write_pages(fs_volume *_volume, fs_vnode *_node, void *_cookie,
|
||||
bytesLeft -= bytes;
|
||||
}
|
||||
|
||||
if (!reenter)
|
||||
rw_lock_read_unlock(&inode->Lock());
|
||||
rw_lock_read_unlock(&inode->Lock());
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -1584,7 +1584,7 @@ cdda_can_page(fs_volume *_volume, fs_vnode *_node, void *cookie)
|
||||
|
||||
static status_t
|
||||
cdda_read_pages(fs_volume *_volume, fs_vnode *_node, void *cookie, off_t pos,
|
||||
const iovec *vecs, size_t count, size_t *_numBytes, bool reenter)
|
||||
const iovec *vecs, size_t count, size_t *_numBytes)
|
||||
{
|
||||
return B_NOT_ALLOWED;
|
||||
}
|
||||
@@ -1592,7 +1592,7 @@ cdda_read_pages(fs_volume *_volume, fs_vnode *_node, void *cookie, off_t pos,
|
||||
|
||||
static status_t
|
||||
cdda_write_pages(fs_volume *_volume, fs_vnode *_node, void *cookie, off_t pos,
|
||||
const iovec *vecs, size_t count, size_t *_numBytes, bool reenter)
|
||||
const iovec *vecs, size_t count, size_t *_numBytes)
|
||||
{
|
||||
return B_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ ext2_can_page(fs_volume* _volume, fs_vnode* _node, void* _cookie)
|
||||
|
||||
static status_t
|
||||
ext2_read_pages(fs_volume* _volume, fs_vnode* _node, void* _cookie,
|
||||
off_t pos, const iovec* vecs, size_t count, size_t* _numBytes, bool reenter)
|
||||
off_t pos, const iovec* vecs, size_t count, size_t* _numBytes)
|
||||
{
|
||||
Volume* volume = (Volume*)_volume->private_volume;
|
||||
Inode* inode = (Inode*)_node->private_node;
|
||||
@@ -207,8 +207,7 @@ ext2_read_pages(fs_volume* _volume, fs_vnode* _node, void* _cookie,
|
||||
if (inode->FileCache() == NULL)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
if (!reenter)
|
||||
rw_lock_read_lock(inode->Lock());
|
||||
rw_lock_read_lock(inode->Lock());
|
||||
|
||||
uint32 vecIndex = 0;
|
||||
size_t vecOffset = 0;
|
||||
@@ -236,8 +235,7 @@ ext2_read_pages(fs_volume* _volume, fs_vnode* _node, void* _cookie,
|
||||
bytesLeft -= bytes;
|
||||
}
|
||||
|
||||
if (!reenter)
|
||||
rw_lock_read_unlock(inode->Lock());
|
||||
rw_lock_read_unlock(inode->Lock());
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -392,7 +392,7 @@ fs_release_vnode(fs_volume *_vol, fs_vnode *_node, bool reenter)
|
||||
|
||||
static status_t
|
||||
fs_read_pages(fs_volume *_vol, fs_vnode *_node, void * _cookie, off_t pos,
|
||||
const iovec *vecs, size_t count, size_t *_numBytes, bool reenter)
|
||||
const iovec *vecs, size_t count, size_t *_numBytes)
|
||||
{
|
||||
nspace *ns = (nspace *)_vol->private_volume;
|
||||
vnode *node = (vnode *)_node->private_node;
|
||||
|
||||
+8
-8
@@ -211,7 +211,7 @@ read_into_cache(file_cache_ref *ref, void *cookie, off_t offset,
|
||||
|
||||
// read file into reserved pages
|
||||
status_t status = vfs_read_pages(ref->vnode, cookie, offset, vecs,
|
||||
vecCount, &numBytes, false);
|
||||
vecCount, &numBytes);
|
||||
if (status < B_OK) {
|
||||
// reading failed, free allocated pages
|
||||
|
||||
@@ -294,7 +294,7 @@ read_from_file(file_cache_ref *ref, void *cookie, off_t offset,
|
||||
vm_page_unreserve_pages(lastReservedPages);
|
||||
|
||||
status_t status = vfs_read_pages(ref->vnode, cookie, offset + pageOffset,
|
||||
&vec, 1, &bufferSize, false);
|
||||
&vec, 1, &bufferSize);
|
||||
if (status == B_OK)
|
||||
reserve_pages(ref, reservePages, false);
|
||||
|
||||
@@ -361,7 +361,7 @@ write_to_cache(file_cache_ref *ref, void *cookie, off_t offset,
|
||||
size_t bytesRead = B_PAGE_SIZE;
|
||||
|
||||
status = vfs_read_pages(ref->vnode, cookie, offset, &readVec, 1,
|
||||
&bytesRead, false);
|
||||
&bytesRead);
|
||||
// ToDo: handle errors for real!
|
||||
if (status < B_OK)
|
||||
panic("1. vfs_read_pages() failed: %s!\n", strerror(status));
|
||||
@@ -385,7 +385,7 @@ write_to_cache(file_cache_ref *ref, void *cookie, off_t offset,
|
||||
|
||||
status = vfs_read_pages(ref->vnode, cookie,
|
||||
PAGE_ALIGN(offset + pageOffset + bufferSize) - B_PAGE_SIZE,
|
||||
&readVec, 1, &bytesRead, false);
|
||||
&readVec, 1, &bytesRead);
|
||||
// ToDo: handle errors for real!
|
||||
if (status < B_OK)
|
||||
panic("vfs_read_pages() failed: %s!\n", strerror(status));
|
||||
@@ -420,7 +420,7 @@ write_to_cache(file_cache_ref *ref, void *cookie, off_t offset,
|
||||
if (writeThrough) {
|
||||
// write cached pages back to the file if we were asked to do that
|
||||
status_t status = vfs_write_pages(ref->vnode, cookie, offset, vecs,
|
||||
vecCount, &numBytes, false);
|
||||
vecCount, &numBytes);
|
||||
if (status < B_OK) {
|
||||
// ToDo: remove allocated pages, ...?
|
||||
panic("file_cache: remove allocated pages! write pages failed: %s\n",
|
||||
@@ -491,7 +491,7 @@ write_to_file(file_cache_ref *ref, void *cookie, off_t offset, int32 pageOffset,
|
||||
chunkSize = bufferSize;
|
||||
|
||||
status = vfs_write_pages(ref->vnode, cookie, offset + pageOffset,
|
||||
&vec, 1, &chunkSize, false);
|
||||
&vec, 1, &chunkSize);
|
||||
if (status < B_OK)
|
||||
break;
|
||||
|
||||
@@ -502,7 +502,7 @@ write_to_file(file_cache_ref *ref, void *cookie, off_t offset, int32 pageOffset,
|
||||
free((void*)buffer);
|
||||
} else {
|
||||
status = vfs_write_pages(ref->vnode, cookie, offset + pageOffset,
|
||||
&vec, 1, &bufferSize, false);
|
||||
&vec, 1, &bufferSize);
|
||||
}
|
||||
|
||||
if (status == B_OK)
|
||||
@@ -958,7 +958,7 @@ file_cache_sync(void *_cacheRef)
|
||||
if (ref == NULL)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
return ref->cache->WriteModified(false);
|
||||
return ref->cache->WriteModified();
|
||||
}
|
||||
|
||||
|
||||
|
||||
+4
-5
@@ -41,12 +41,12 @@ VMVnodeCache::HasPage(off_t offset)
|
||||
|
||||
status_t
|
||||
VMVnodeCache::Read(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter)
|
||||
size_t *_numBytes)
|
||||
{
|
||||
size_t bytesUntouched = *_numBytes;
|
||||
|
||||
status_t status = vfs_read_pages(fVnode, NULL, offset, vecs, count,
|
||||
_numBytes, fsReenter);
|
||||
_numBytes);
|
||||
|
||||
bytesUntouched -= *_numBytes;
|
||||
|
||||
@@ -73,10 +73,9 @@ VMVnodeCache::Read(off_t offset, const iovec *vecs, size_t count,
|
||||
|
||||
status_t
|
||||
VMVnodeCache::Write(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter)
|
||||
size_t *_numBytes)
|
||||
{
|
||||
return vfs_write_pages(fVnode, NULL, offset, vecs, count, _numBytes,
|
||||
fsReenter);
|
||||
return vfs_write_pages(fVnode, NULL, offset, vecs, count, _numBytes);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -20,9 +20,9 @@ public:
|
||||
virtual bool HasPage(off_t offset);
|
||||
|
||||
virtual status_t Read(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter);
|
||||
size_t *_numBytes);
|
||||
virtual status_t Write(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter);
|
||||
size_t *_numBytes);
|
||||
|
||||
virtual status_t Fault(struct vm_address_space *aspace, off_t offset);
|
||||
|
||||
|
||||
@@ -1593,7 +1593,7 @@ devfs_can_page(fs_volume *_volume, fs_vnode *_vnode, void *cookie)
|
||||
|
||||
static status_t
|
||||
devfs_read_pages(fs_volume *_volume, fs_vnode *_vnode, void *_cookie,
|
||||
off_t pos, const iovec *vecs, size_t count, size_t *_numBytes, bool reenter)
|
||||
off_t pos, const iovec *vecs, size_t count, size_t *_numBytes)
|
||||
{
|
||||
struct devfs_vnode *vnode = (devfs_vnode *)_vnode->private_node;
|
||||
struct devfs_cookie *cookie = (struct devfs_cookie *)_cookie;
|
||||
@@ -1651,7 +1651,7 @@ devfs_read_pages(fs_volume *_volume, fs_vnode *_vnode, void *_cookie,
|
||||
|
||||
static status_t
|
||||
devfs_write_pages(fs_volume* _volume, fs_vnode* _vnode, void* _cookie,
|
||||
off_t pos, const iovec* vecs, size_t count, size_t* _numBytes, bool reenter)
|
||||
off_t pos, const iovec* vecs, size_t count, size_t* _numBytes)
|
||||
{
|
||||
struct devfs_vnode *vnode = (devfs_vnode *)_vnode->private_node;
|
||||
struct devfs_cookie *cookie = (struct devfs_cookie *)_cookie;
|
||||
|
||||
@@ -935,7 +935,7 @@ fifo_can_page(fs_volume *_volume, fs_vnode *_v, void *cookie)
|
||||
|
||||
static status_t
|
||||
fifo_read_pages(fs_volume *_volume, fs_vnode *_v, void *cookie, off_t pos,
|
||||
const iovec *vecs, size_t count, size_t *_numBytes, bool reenter)
|
||||
const iovec *vecs, size_t count, size_t *_numBytes)
|
||||
{
|
||||
return B_NOT_ALLOWED;
|
||||
}
|
||||
@@ -943,7 +943,7 @@ fifo_read_pages(fs_volume *_volume, fs_vnode *_v, void *cookie, off_t pos,
|
||||
|
||||
static status_t
|
||||
fifo_write_pages(fs_volume *_volume, fs_vnode *_v, void *cookie,
|
||||
off_t pos, const iovec *vecs, size_t count, size_t *_numBytes, bool reenter)
|
||||
off_t pos, const iovec *vecs, size_t count, size_t *_numBytes)
|
||||
{
|
||||
return B_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
@@ -813,7 +813,7 @@ rootfs_can_page(fs_volume *_volume, fs_vnode *_v, void *cookie)
|
||||
|
||||
static status_t
|
||||
rootfs_read_pages(fs_volume *_volume, fs_vnode *_v, void *cookie, off_t pos,
|
||||
const iovec *vecs, size_t count, size_t *_numBytes, bool reenter)
|
||||
const iovec *vecs, size_t count, size_t *_numBytes)
|
||||
{
|
||||
return B_NOT_ALLOWED;
|
||||
}
|
||||
@@ -821,7 +821,7 @@ rootfs_read_pages(fs_volume *_volume, fs_vnode *_v, void *cookie, off_t pos,
|
||||
|
||||
static status_t
|
||||
rootfs_write_pages(fs_volume *_volume, fs_vnode *_v, void *cookie, off_t pos,
|
||||
const iovec *vecs, size_t count, size_t *_numBytes, bool reenter)
|
||||
const iovec *vecs, size_t count, size_t *_numBytes)
|
||||
{
|
||||
return B_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
@@ -1056,7 +1056,7 @@ vnode_low_resource_handler(void */*data*/, uint32 resources, int32 level)
|
||||
mutex_unlock(&sVnodeMutex);
|
||||
|
||||
if (vnode->cache != NULL)
|
||||
vnode->cache->WriteModified(false);
|
||||
vnode->cache->WriteModified();
|
||||
|
||||
dec_vnode_ref_count(vnode, true, false);
|
||||
// this should free the vnode when it's still unused
|
||||
@@ -2912,7 +2912,7 @@ common_file_io_vec_pages(struct vnode *vnode, void *cookie,
|
||||
size = numBytes;
|
||||
|
||||
status = FS_CALL(vnode, read_pages, cookie, fileVecs[0].offset,
|
||||
&vecs[vecIndex], vecCount - vecIndex, &size, false);
|
||||
&vecs[vecIndex], vecCount - vecIndex, &size);
|
||||
if (status < B_OK)
|
||||
return status;
|
||||
|
||||
@@ -3007,10 +3007,10 @@ common_file_io_vec_pages(struct vnode *vnode, void *cookie,
|
||||
size_t bytes = size;
|
||||
if (doWrite) {
|
||||
status = FS_CALL(vnode, write_pages, cookie, fileOffset,
|
||||
tempVecs, tempCount, &bytes, false);
|
||||
tempVecs, tempCount, &bytes);
|
||||
} else {
|
||||
status = FS_CALL(vnode, read_pages, cookie, fileOffset,
|
||||
tempVecs, tempCount, &bytes, false);
|
||||
tempVecs, tempCount, &bytes);
|
||||
}
|
||||
if (status < B_OK)
|
||||
return status;
|
||||
@@ -3282,7 +3282,7 @@ get_vnode_removed(fs_volume *volume, ino_t vnodeID, bool* removed)
|
||||
|
||||
extern "C" status_t
|
||||
read_pages(int fd, off_t pos, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter)
|
||||
size_t *_numBytes)
|
||||
{
|
||||
struct file_descriptor *descriptor;
|
||||
struct vnode *vnode;
|
||||
@@ -3292,7 +3292,7 @@ read_pages(int fd, off_t pos, const iovec *vecs, size_t count,
|
||||
return B_FILE_ERROR;
|
||||
|
||||
status_t status = FS_CALL(vnode, read_pages, descriptor->cookie, pos, vecs,
|
||||
count, _numBytes, fsReenter);
|
||||
count, _numBytes);
|
||||
|
||||
put_fd(descriptor);
|
||||
return status;
|
||||
@@ -3301,7 +3301,7 @@ read_pages(int fd, off_t pos, const iovec *vecs, size_t count,
|
||||
|
||||
extern "C" status_t
|
||||
write_pages(int fd, off_t pos, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter)
|
||||
size_t *_numBytes)
|
||||
{
|
||||
struct file_descriptor *descriptor;
|
||||
struct vnode *vnode;
|
||||
@@ -3311,7 +3311,7 @@ write_pages(int fd, off_t pos, const iovec *vecs, size_t count,
|
||||
return B_FILE_ERROR;
|
||||
|
||||
status_t status = FS_CALL(vnode, write_pages, descriptor->cookie, pos, vecs,
|
||||
count, _numBytes, fsReenter);
|
||||
count, _numBytes);
|
||||
|
||||
put_fd(descriptor);
|
||||
return status;
|
||||
@@ -3888,23 +3888,21 @@ vfs_can_page(struct vnode *vnode, void *cookie)
|
||||
|
||||
extern "C" status_t
|
||||
vfs_read_pages(struct vnode *vnode, void *cookie, off_t pos, const iovec *vecs,
|
||||
size_t count, size_t *_numBytes, bool fsReenter)
|
||||
size_t count, size_t *_numBytes)
|
||||
{
|
||||
FUNCTION(("vfs_read_pages: vnode %p, vecs %p, pos %Ld\n", vnode, vecs, pos));
|
||||
|
||||
return FS_CALL(vnode, read_pages, cookie, pos, vecs, count, _numBytes,
|
||||
fsReenter);
|
||||
return FS_CALL(vnode, read_pages, cookie, pos, vecs, count, _numBytes);
|
||||
}
|
||||
|
||||
|
||||
extern "C" status_t
|
||||
vfs_write_pages(struct vnode *vnode, void *cookie, off_t pos, const iovec *vecs,
|
||||
size_t count, size_t *_numBytes, bool fsReenter)
|
||||
size_t count, size_t *_numBytes)
|
||||
{
|
||||
FUNCTION(("vfs_write_pages: vnode %p, vecs %p, pos %Ld\n", vnode, vecs, pos));
|
||||
|
||||
return FS_CALL(vnode, write_pages, cookie, pos, vecs, count, _numBytes,
|
||||
fsReenter);
|
||||
return FS_CALL(vnode, write_pages, cookie, pos, vecs, count, _numBytes);
|
||||
}
|
||||
|
||||
|
||||
@@ -6712,7 +6710,7 @@ fs_sync(dev_t device)
|
||||
put_vnode(previousVnode);
|
||||
|
||||
if (vnode->cache != NULL)
|
||||
vnode->cache->WriteModified(false);
|
||||
vnode->cache->WriteModified();
|
||||
|
||||
// the next vnode might change until we lock the vnode list again,
|
||||
// but this vnode won't go away since we keep a reference to it.
|
||||
|
||||
@@ -186,7 +186,7 @@ VMAnonymousCache::HasPage(off_t offset)
|
||||
|
||||
status_t
|
||||
VMAnonymousCache::Read(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter)
|
||||
size_t *_numBytes)
|
||||
{
|
||||
off_t cacheOffset = offset >> PAGE_SHIFT;
|
||||
|
||||
@@ -207,7 +207,7 @@ VMAnonymousCache::Read(off_t offset, const iovec *vecs, size_t count,
|
||||
off_t pos = (startPageIndex - swapFile->first_page) * PAGE_SIZE;
|
||||
|
||||
status_t status = vfs_read_pages(swapFile->vnode, NULL, pos, vecs + i,
|
||||
j - i, _numBytes, fsReenter);
|
||||
j - i, _numBytes);
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
}
|
||||
@@ -218,7 +218,7 @@ VMAnonymousCache::Read(off_t offset, const iovec *vecs, size_t count,
|
||||
|
||||
status_t
|
||||
VMAnonymousCache::Write(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter)
|
||||
size_t *_numBytes)
|
||||
{
|
||||
offset >>= PAGE_SHIFT;
|
||||
uint32 n = count;
|
||||
@@ -243,7 +243,7 @@ VMAnonymousCache::Write(off_t offset, const iovec *vecs, size_t count,
|
||||
off_t pos = (pageIndex - swapFile->first_page) * PAGE_SIZE;
|
||||
|
||||
status_t status = vfs_write_pages(swapFile->vnode, NULL, pos, vecs + i ,
|
||||
n, _numBytes, fsReenter);
|
||||
n, _numBytes);
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -26,9 +26,9 @@ public:
|
||||
virtual bool HasPage(off_t offset);
|
||||
|
||||
virtual status_t Read(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter);
|
||||
size_t *_numBytes);
|
||||
virtual status_t Write(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter);
|
||||
size_t *_numBytes);
|
||||
|
||||
virtual status_t Fault(struct vm_address_space *aspace, off_t offset);
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ VMAnonymousNoSwapCache::HasPage(off_t offset)
|
||||
|
||||
status_t
|
||||
VMAnonymousNoSwapCache::Read(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter)
|
||||
size_t *_numBytes)
|
||||
{
|
||||
panic("anonymous_store: read called. Invalid!\n");
|
||||
return B_ERROR;
|
||||
@@ -105,7 +105,7 @@ VMAnonymousNoSwapCache::Read(off_t offset, const iovec *vecs, size_t count,
|
||||
|
||||
status_t
|
||||
VMAnonymousNoSwapCache::Write(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter)
|
||||
size_t *_numBytes)
|
||||
{
|
||||
// no place to write, this will cause the page daemon to skip this store
|
||||
return B_ERROR;
|
||||
|
||||
@@ -23,9 +23,9 @@ public:
|
||||
virtual bool HasPage(off_t offset);
|
||||
|
||||
virtual status_t Read(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter);
|
||||
size_t *_numBytes);
|
||||
virtual status_t Write(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter);
|
||||
size_t *_numBytes);
|
||||
|
||||
virtual status_t Fault(struct vm_address_space *aspace, off_t offset);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ VMDeviceCache::HasPage(off_t offset)
|
||||
|
||||
status_t
|
||||
VMDeviceCache::Read(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter)
|
||||
size_t *_numBytes)
|
||||
{
|
||||
panic("device_store: read called. Invalid!\n");
|
||||
return B_ERROR;
|
||||
@@ -36,7 +36,7 @@ VMDeviceCache::Read(off_t offset, const iovec *vecs, size_t count,
|
||||
|
||||
status_t
|
||||
VMDeviceCache::Write(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter)
|
||||
size_t *_numBytes)
|
||||
{
|
||||
// no place to write, this will cause the page daemon to skip this store
|
||||
return B_OK;
|
||||
|
||||
@@ -19,9 +19,9 @@ public:
|
||||
virtual bool HasPage(off_t offset);
|
||||
|
||||
virtual status_t Read(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter);
|
||||
size_t *_numBytes);
|
||||
virtual status_t Write(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter);
|
||||
size_t *_numBytes);
|
||||
|
||||
private:
|
||||
addr_t fBaseAddress;
|
||||
|
||||
@@ -2249,7 +2249,7 @@ delete_area(vm_address_space *addressSpace, vm_area *area)
|
||||
vm_unmap_pages(area, area->base, area->size, !area->cache->temporary);
|
||||
|
||||
if (!area->cache->temporary)
|
||||
area->cache->WriteModified(false);
|
||||
area->cache->WriteModified();
|
||||
|
||||
arch_vm_unset_memory_type(area);
|
||||
remove_area_from_address_space(addressSpace, area);
|
||||
@@ -4195,8 +4195,7 @@ fault_find_page(vm_translation_map *map, vm_cache *topCache,
|
||||
size_t bytesRead = vec.iov_len = B_PAGE_SIZE;
|
||||
|
||||
// read it in
|
||||
status_t status = cache->Read(cacheOffset, &vec, 1, &bytesRead,
|
||||
false);
|
||||
status_t status = cache->Read(cacheOffset, &vec, 1, &bytesRead);
|
||||
|
||||
map->ops->put_physical_page((addr_t)vec.iov_base);
|
||||
|
||||
@@ -5759,7 +5758,7 @@ _user_sync_memory(void *_address, addr_t size, int flags)
|
||||
if (writeSync) {
|
||||
// synchronous
|
||||
error = vm_page_write_modified_page_range(cache, firstPage,
|
||||
endPage, false);
|
||||
endPage);
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
} else {
|
||||
|
||||
@@ -688,7 +688,7 @@ VMCache::RemoveArea(vm_area* area)
|
||||
|
||||
|
||||
status_t
|
||||
VMCache::WriteModified(bool fsReenter)
|
||||
VMCache::WriteModified()
|
||||
{
|
||||
TRACE(("VMCache::WriteModified(cache = %p)\n", this));
|
||||
|
||||
@@ -696,7 +696,7 @@ VMCache::WriteModified(bool fsReenter)
|
||||
return B_OK;
|
||||
|
||||
Lock();
|
||||
status_t status = vm_page_write_modified_pages(this, fsReenter);
|
||||
status_t status = vm_page_write_modified_pages(this);
|
||||
Unlock();
|
||||
|
||||
return status;
|
||||
@@ -813,16 +813,14 @@ VMCache::HasPage(off_t offset)
|
||||
|
||||
|
||||
status_t
|
||||
VMCache::Read(off_t offset, const iovec *vecs, size_t count, size_t *_numBytes,
|
||||
bool fsReenter)
|
||||
VMCache::Read(off_t offset, const iovec *vecs, size_t count, size_t *_numBytes)
|
||||
{
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
VMCache::Write(off_t offset, const iovec *vecs, size_t count,
|
||||
size_t *_numBytes, bool fsReenter)
|
||||
VMCache::Write(off_t offset, const iovec *vecs, size_t count, size_t *_numBytes)
|
||||
{
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
@@ -844,7 +844,7 @@ page_scrubber(void *unused)
|
||||
|
||||
|
||||
static status_t
|
||||
write_page(vm_page *page, bool fsReenter)
|
||||
write_page(vm_page *page)
|
||||
{
|
||||
size_t length = B_PAGE_SIZE;
|
||||
status_t status;
|
||||
@@ -859,7 +859,7 @@ write_page(vm_page *page, bool fsReenter)
|
||||
vecs->iov_len = B_PAGE_SIZE;
|
||||
|
||||
status = page->cache->Write((off_t)page->cache_offset << PAGE_SHIFT,
|
||||
vecs, 1, &length, fsReenter);
|
||||
vecs, 1, &length);
|
||||
|
||||
vm_put_physical_page((addr_t)vecs[0].iov_base);
|
||||
#if 0
|
||||
@@ -1035,7 +1035,7 @@ page_writer(void* /*unused*/)
|
||||
// TODO: put this as requests into the I/O scheduler
|
||||
status_t writeStatus[kNumPages];
|
||||
for (uint32 i = 0; i < numPages; i++) {
|
||||
writeStatus[i] = write_page(u.pages[i], false);
|
||||
writeStatus[i] = write_page(u.pages[i]);
|
||||
}
|
||||
|
||||
// mark pages depending on whether they could be written or not
|
||||
@@ -1280,7 +1280,7 @@ steal_pages(vm_page **pages, size_t count, bool reserve)
|
||||
*/
|
||||
status_t
|
||||
vm_page_write_modified_page_range(struct VMCache *cache, uint32 firstPage,
|
||||
uint32 endPage, bool fsReenter)
|
||||
uint32 endPage)
|
||||
{
|
||||
// TODO: join adjacent pages into one vec list
|
||||
|
||||
@@ -1321,7 +1321,7 @@ vm_page_write_modified_page_range(struct VMCache *cache, uint32 firstPage,
|
||||
vm_clear_map_flags(page, PAGE_MODIFIED);
|
||||
|
||||
cache->Unlock();
|
||||
status_t status = write_page(page, fsReenter);
|
||||
status_t status = write_page(page);
|
||||
cache->Lock();
|
||||
|
||||
InterruptsSpinLocker locker(&sPageLock);
|
||||
@@ -1361,10 +1361,10 @@ vm_page_write_modified_page_range(struct VMCache *cache, uint32 firstPage,
|
||||
Note that the cache lock is released in this function.
|
||||
*/
|
||||
status_t
|
||||
vm_page_write_modified_pages(vm_cache *cache, bool fsReenter)
|
||||
vm_page_write_modified_pages(vm_cache *cache)
|
||||
{
|
||||
return vm_page_write_modified_page_range(cache, 0,
|
||||
(cache->virtual_end + B_PAGE_SIZE - 1) >> PAGE_SHIFT, fsReenter);
|
||||
(cache->virtual_end + B_PAGE_SIZE - 1) >> PAGE_SHIFT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ read_from_file(file_cache_ref *ref, void *cookie, fssh_off_t offset,
|
||||
fssh_mutex_unlock(&ref->lock);
|
||||
|
||||
fssh_status_t status = vfs_read_pages(ref->node, cookie,
|
||||
offset + pageOffset, &vec, 1, &bufferSize, false);
|
||||
offset + pageOffset, &vec, 1, &bufferSize);
|
||||
|
||||
fssh_mutex_lock(&ref->lock);
|
||||
|
||||
@@ -109,7 +109,7 @@ write_to_file(file_cache_ref *ref, void *cookie, fssh_off_t offset,
|
||||
fssh_mutex_unlock(&ref->lock);
|
||||
|
||||
fssh_status_t status = vfs_write_pages(ref->node, cookie,
|
||||
offset + pageOffset, &vec, 1, &bufferSize, false);
|
||||
offset + pageOffset, &vec, 1, &bufferSize);
|
||||
|
||||
fssh_mutex_lock(&ref->lock);
|
||||
|
||||
|
||||
@@ -1760,7 +1760,7 @@ common_file_io_vec_pages(int fd, const fssh_file_io_vec *fileVecs,
|
||||
size = numBytes;
|
||||
|
||||
status = fssh_read_pages(fd, fileVecs[0].offset, &vecs[vecIndex],
|
||||
vecCount - vecIndex, &size, false);
|
||||
vecCount - vecIndex, &size);
|
||||
if (status < FSSH_B_OK)
|
||||
return status;
|
||||
|
||||
@@ -1855,10 +1855,10 @@ common_file_io_vec_pages(int fd, const fssh_file_io_vec *fileVecs,
|
||||
fssh_size_t bytes = size;
|
||||
if (doWrite) {
|
||||
status = fssh_write_pages(fd, fileOffset, tempVecs,
|
||||
tempCount, &bytes, false);
|
||||
tempCount, &bytes);
|
||||
} else {
|
||||
status = fssh_read_pages(fd, fileOffset, tempVecs,
|
||||
tempCount, &bytes, false);
|
||||
tempCount, &bytes);
|
||||
}
|
||||
if (status < FSSH_B_OK)
|
||||
return status;
|
||||
@@ -2108,7 +2108,7 @@ fssh_get_vnode_removed(fssh_fs_volume *volume, fssh_vnode_id vnodeID, bool* remo
|
||||
//! Works directly on the host's file system
|
||||
extern "C" fssh_status_t
|
||||
fssh_read_pages(int fd, fssh_off_t pos, const fssh_iovec *vecs,
|
||||
fssh_size_t count, fssh_size_t *_numBytes, bool fsReenter)
|
||||
fssh_size_t count, fssh_size_t *_numBytes)
|
||||
{
|
||||
// check how much the iovecs allow us to read
|
||||
fssh_size_t toRead = 0;
|
||||
@@ -2149,7 +2149,7 @@ fssh_read_pages(int fd, fssh_off_t pos, const fssh_iovec *vecs,
|
||||
//! Works directly on the host's file system
|
||||
extern "C" fssh_status_t
|
||||
fssh_write_pages(int fd, fssh_off_t pos, const fssh_iovec *vecs,
|
||||
fssh_size_t count, fssh_size_t *_numBytes, bool fsReenter)
|
||||
fssh_size_t count, fssh_size_t *_numBytes)
|
||||
{
|
||||
// check how much the iovecs allow us to write
|
||||
fssh_size_t toWrite = 0;
|
||||
@@ -2296,25 +2296,23 @@ vfs_get_vnode(fssh_mount_id mountID, fssh_vnode_id vnodeID, void **_vnode)
|
||||
|
||||
fssh_status_t
|
||||
vfs_read_pages(void *_vnode, void *cookie, fssh_off_t pos,
|
||||
const fssh_iovec *vecs, fssh_size_t count, fssh_size_t *_numBytes,
|
||||
bool fsReenter)
|
||||
const fssh_iovec *vecs, fssh_size_t count, fssh_size_t *_numBytes)
|
||||
{
|
||||
struct vnode *vnode = (struct vnode *)_vnode;
|
||||
|
||||
return FS_CALL(vnode, read_pages,
|
||||
cookie, pos, vecs, count, _numBytes, fsReenter);
|
||||
cookie, pos, vecs, count, _numBytes);
|
||||
}
|
||||
|
||||
|
||||
fssh_status_t
|
||||
vfs_write_pages(void *_vnode, void *cookie, fssh_off_t pos,
|
||||
const fssh_iovec *vecs, fssh_size_t count, fssh_size_t *_numBytes,
|
||||
bool fsReenter)
|
||||
const fssh_iovec *vecs, fssh_size_t count, fssh_size_t *_numBytes)
|
||||
{
|
||||
struct vnode *vnode = (struct vnode *)_vnode;
|
||||
|
||||
return FS_CALL(vnode, write_pages,
|
||||
cookie, pos, vecs, count, _numBytes, fsReenter);
|
||||
cookie, pos, vecs, count, _numBytes);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -75,10 +75,10 @@ void vfs_acquire_vnode(void *vnode);
|
||||
fssh_status_t vfs_get_cookie_from_fd(int fd, void **_cookie);
|
||||
fssh_status_t vfs_read_pages(void *vnode, void *cookie, fssh_off_t pos,
|
||||
const fssh_iovec *vecs, fssh_size_t count,
|
||||
fssh_size_t *_numBytes, bool fsReenter);
|
||||
fssh_size_t *_numBytes);
|
||||
fssh_status_t vfs_write_pages(void *vnode, void *cookie,
|
||||
fssh_off_t pos, const fssh_iovec *vecs, fssh_size_t count,
|
||||
fssh_size_t *_numBytes, bool fsReenter);
|
||||
fssh_size_t *_numBytes);
|
||||
fssh_status_t vfs_get_file_map(void *_vnode, fssh_off_t offset,
|
||||
fssh_size_t size, fssh_file_io_vec *vecs,
|
||||
fssh_size_t *_count);
|
||||
|
||||
Reference in New Issue
Block a user