* 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:
Ingo Weinhold 2008-07-23 15:47:47 +00:00
parent 4ed05c6869
commit e6bd90c58d
28 changed files with 151 additions and 166 deletions

View File

@ -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,

View File

@ -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,

View File

@ -26,7 +26,7 @@
#define DEFAULT_FD_TABLE_SIZE 256
#define MAX_FD_TABLE_SIZE 8192
#define DEFAULT_NODE_MONITORS 4096
#define DEFAULT_NODE_MONITORS 4096
#define MAX_NODE_MONITORS 65536
#define B_UNMOUNT_BUSY_PARTITION 0x80000000
@ -64,7 +64,7 @@ typedef struct io_context {
#ifdef __cplusplus
extern "C" {
#endif
#endif
status_t vfs_init(struct kernel_args *args);
status_t vfs_bootstrap_file_systems(void);
@ -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,
@ -250,6 +250,6 @@ extern status_t _user_get_next_socket_stat(int family, uint32 *cookie,
#ifdef __cplusplus
}
#endif
#endif
#endif /* _KERNEL_VFS_H */

View File

@ -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);

View File

@ -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);

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -115,7 +115,7 @@ fs_mount(fs_volume *_volume, const char *device, uint32 flags,
uint32 len = strlen(buf);
// lower case the parms data
for (i = 0; i < len + 1; i++)
for (i = 0; i < len + 1; i++)
buf[i] = tolower(buf[i]);
// look for nojoliet
@ -252,7 +252,7 @@ fs_walk(fs_volume *_vol, fs_vnode *_base, const char *file, ino_t *_vnodeID)
TRACE(("fs_walk - read buffer from disk at LBN %Ld into buffer 0x%x.\n",
block, blockData));
// Move to the next 2-block set if necessary
// Move to the next 2-block set if necessary
// Don't go over end of buffer, if dir record sits on boundary.
node.fileIDString = NULL;
@ -285,7 +285,7 @@ fs_walk(fs_volume *_vol, fs_vnode *_base, const char *file, ino_t *_vnodeID)
free(node.attr.slName);
node.attr.slName = NULL;
}
} else {
} else {
result = initResult;
if (bytesRead == 0)
done = TRUE;
@ -298,7 +298,7 @@ fs_walk(fs_volume *_vol, fs_vnode *_base, const char *file, ino_t *_vnodeID)
}
totalRead += ns->logicalBlkSize[FS_DATA_FORMAT];
block++;
TRACE(("fs_walk - moving to next block %Ld, total read %Ld\n", block, totalRead));
block_cache_put(ns->fBlockCache, cachedBlock);
@ -340,12 +340,12 @@ fs_read_vnode(fs_volume *_vol, ino_t vnodeID, fs_vnode *_node,
status_t result = InitNode(newNode, data + pos, NULL, ns->joliet_level);
block_cache_put(ns->fBlockCache, block);
if (result < B_OK) {
free(newNode);
return result;
}
newNode->id = vnodeID;
_node->private_node = newNode;
_node->ops = &gISO9660VnodeOps;
@ -372,7 +372,7 @@ fs_release_vnode(fs_volume *_vol, fs_vnode *_node, bool reenter)
TRACE(("fs_release_vnode - ENTER (0x%x)\n", node));
if (node != NULL) {
if (node != NULL) {
if (node->id != ISO_ROOTNODE_ID) {
if (node->fileIDString != NULL)
free (node->fileIDString);
@ -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;
@ -441,7 +441,7 @@ fs_read_stat(fs_volume *_vol, fs_vnode *_node, struct stat *st)
// Same for file/dir in ISO9660
st->st_size = node->dataLen[FS_DATA_FORMAT];
if (ConvertRecDate(&(node->recordDate), &time) == B_NO_ERROR)
if (ConvertRecDate(&(node->recordDate), &time) == B_NO_ERROR)
st->st_ctime = st->st_mtime = st->st_atime = time;
TRACE(("fs_read_stat - EXIT, result is %s\n", strerror(result)));
@ -595,7 +595,7 @@ fs_read_dir(fs_volume *_vol, fs_vnode *_node, void *_cookie, struct dirent *buff
TRACE(("fs_read_dir - EXIT, result is %s\n", strerror(result)));
return result;
}
static status_t
fs_rewind_dir(fs_volume *_vol, fs_vnode *_node, void* _cookie)

View File

@ -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();
}

View File

@ -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);
}

View File

@ -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);

View File

@ -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;

View File

@ -319,7 +319,7 @@ Inode::~Inode()
}
status_t
status_t
Inode::InitCheck()
{
return B_OK;
@ -920,7 +920,7 @@ fifo_deselect(fs_volume *_volume, fs_vnode *_node, void *_cookie,
Inode *inode = (Inode *)_node->private_node;
if (!inode)
return B_ERROR;
MutexLocker locker(inode->RequestLock());
return inode->Deselect(event, sync, cookie->open_mode);
}
@ -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;
}

View File

@ -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;
}

View File

@ -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.

View File

@ -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;
}

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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 {

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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);

View File

@ -141,7 +141,7 @@ static fssh_mutex sMountMutex;
* - the fields immutable after initialization of the fs_mount structures in
* sMountsTable will not be modified,
* - vnode::covered_by of any vnode in sVnodeTable will not be modified.
*
*
* The thread trying to lock the lock must not hold sVnodeMutex or
* sMountMutex.
*/
@ -612,7 +612,7 @@ create_new_vnode(struct vnode **_vnode, fssh_mount_id mountID, fssh_vnode_id vno
vnode->id = vnodeID;
// add the vnode to the mount structure
fssh_mutex_lock(&sMountMutex);
fssh_mutex_lock(&sMountMutex);
vnode->mount = find_mount(mountID);
if (!vnode->mount || vnode->mount->unmounting) {
fssh_mutex_unlock(&sMountMutex);
@ -862,7 +862,7 @@ err:
* The caller must, of course, own a reference to the vnode to call this
* function.
* The caller must not hold the sVnodeMutex or the sMountMutex.
*
*
* \param vnode the vnode.
*/
@ -873,7 +873,7 @@ put_vnode(struct vnode *vnode)
}
/** Disconnects all file descriptors that are associated with the
/** Disconnects all file descriptors that are associated with the
* \a vnodeToDisconnect, or if this is NULL, all vnodes of the specified
* \a mount object.
*
@ -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;
@ -1820,7 +1820,7 @@ common_file_io_vec_pages(int fd, const fssh_file_io_vec *fileVecs,
uint32_t tempCount = 0;
// size tracks how much of what is left of the current fileVec
// (fileLeft) has been assigned to tempVecs
// (fileLeft) has been assigned to tempVecs
size = 0;
// assign what is left of the current fileVec to the tempVecs
@ -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;
@ -2059,7 +2059,7 @@ fssh_remove_vnode(fssh_fs_volume *volume, fssh_vnode_id vnodeID)
}
locker.Unlock();
if (remove) {
// if the vnode hasn't been published yet, we delete it here
fssh_atomic_add(&vnode->ref_count, -1);
@ -2070,7 +2070,7 @@ fssh_remove_vnode(fssh_fs_volume *volume, fssh_vnode_id vnodeID)
}
extern "C" fssh_status_t
extern "C" fssh_status_t
fssh_unremove_vnode(fssh_fs_volume *volume, fssh_vnode_id vnodeID)
{
struct vnode *vnode;
@ -2086,7 +2086,7 @@ fssh_unremove_vnode(fssh_fs_volume *volume, fssh_vnode_id vnodeID)
}
extern "C" fssh_status_t
extern "C" fssh_status_t
fssh_get_vnode_removed(fssh_fs_volume *volume, fssh_vnode_id vnodeID, bool* removed)
{
fssh_mutex_lock(&sVnodeMutex);
@ -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);
}
@ -2901,7 +2899,7 @@ create_vnode(struct vnode *directory, const char *name, int openMode, int perms,
put_vnode(vnode);
FS_CALL(directory, unlink, name);
return status;
}
@ -2993,7 +2991,7 @@ file_create_entry_ref(fssh_mount_id mountID, fssh_vnode_id directoryID, const ch
FUNCTION(("file_create_entry_ref: name = '%s', omode %x, perms %d, kernel %d\n", name, openMode, perms, kernel));
// get directory to put the new file in
// get directory to put the new file in
status = get_vnode(mountID, directoryID, &directory, false);
if (status < FSSH_B_OK)
return status;
@ -3014,7 +3012,7 @@ file_create(int fd, char *path, int openMode, int perms, bool kernel)
FUNCTION(("file_create: path '%s', omode %x, perms %d, kernel %d\n", path, openMode, perms, kernel));
// get directory to put the new file in
// get directory to put the new file in
status = fd_and_path_to_dir_vnode(fd, path, &directory, name, kernel);
if (status < 0)
return status;
@ -3182,7 +3180,7 @@ dir_create_entry_ref(fssh_mount_id mountID, fssh_vnode_id parentID, const char *
return FSSH_B_BAD_VALUE;
FUNCTION(("dir_create_entry_ref(dev = %ld, ino = %Ld, name = '%s', perms = %d)\n", mountID, parentID, name, perms));
status = get_vnode(mountID, parentID, &vnode, kernel);
if (status < FSSH_B_OK)
return status;
@ -3297,7 +3295,7 @@ dir_free_fd(struct file_descriptor *descriptor)
}
static fssh_status_t
static fssh_status_t
dir_read(struct file_descriptor *descriptor, struct fssh_dirent *buffer,
fssh_size_t bufferSize, uint32_t *_count)
{
@ -3348,7 +3346,7 @@ fix_dirent(struct vnode *parent, struct fssh_dirent *entry)
}
static fssh_status_t
static fssh_status_t
dir_read(struct vnode *vnode, void *cookie, struct fssh_dirent *buffer,
fssh_size_t bufferSize, uint32_t *_count)
{
@ -3369,7 +3367,7 @@ dir_read(struct vnode *vnode, void *cookie, struct fssh_dirent *buffer,
}
static fssh_status_t
static fssh_status_t
dir_rewind(struct file_descriptor *descriptor)
{
struct vnode *vnode = descriptor->u.vnode;
@ -3401,7 +3399,7 @@ dir_remove(int fd, char *path, bool kernel)
lastSlash--;
}
if (!leaf[0]
if (!leaf[0]
|| !fssh_strcmp(leaf, ".")) {
// "name/" -> "name", or "name/." -> "name"
lastSlash[0] = '\0';
@ -3439,7 +3437,7 @@ common_ioctl(struct file_descriptor *descriptor, uint32_t op, void *buffer,
}
static fssh_status_t
static fssh_status_t
common_fcntl(int fd, int op, uint32_t argument, bool kernel)
{
struct file_descriptor *descriptor;
@ -3463,7 +3461,7 @@ common_fcntl(int fd, int op, uint32_t argument, bool kernel)
fssh_mutex_lock(&context->io_mutex);
fd_set_close_on_exec(context, fd, argument == FSSH_FD_CLOEXEC);
fssh_mutex_unlock(&context->io_mutex);
status = FSSH_B_OK;
break;
}
@ -3801,7 +3799,7 @@ common_write_stat(struct file_descriptor *descriptor,
const struct fssh_stat *stat, int statMask)
{
struct vnode *vnode = descriptor->u.vnode;
FUNCTION(("common_write_stat(vnode = %p, stat = %p, statMask = %d)\n", vnode, stat, statMask));
if (!HAS_FS_CALL(vnode, write_stat))
return FSSH_EROFS;
@ -3906,7 +3904,7 @@ attr_dir_free_fd(struct file_descriptor *descriptor)
}
static fssh_status_t
static fssh_status_t
attr_dir_read(struct file_descriptor *descriptor, struct fssh_dirent *buffer,
fssh_size_t bufferSize, uint32_t *_count)
{
@ -3921,7 +3919,7 @@ attr_dir_read(struct file_descriptor *descriptor, struct fssh_dirent *buffer,
}
static fssh_status_t
static fssh_status_t
attr_dir_rewind(struct file_descriptor *descriptor)
{
struct vnode *vnode = descriptor->u.vnode;
@ -4267,7 +4265,7 @@ index_dir_free_fd(struct file_descriptor *descriptor)
}
static fssh_status_t
static fssh_status_t
index_dir_read(struct file_descriptor *descriptor, struct fssh_dirent *buffer,
fssh_size_t bufferSize, uint32_t *_count)
{
@ -4280,7 +4278,7 @@ index_dir_read(struct file_descriptor *descriptor, struct fssh_dirent *buffer,
}
static fssh_status_t
static fssh_status_t
index_dir_rewind(struct file_descriptor *descriptor)
{
struct fs_mount *mount = descriptor->u.mount;
@ -4431,7 +4429,7 @@ query_free_fd(struct file_descriptor *descriptor)
}
static fssh_status_t
static fssh_status_t
query_read(struct file_descriptor *descriptor, struct fssh_dirent *buffer,
fssh_size_t bufferSize, uint32_t *_count)
{
@ -4444,7 +4442,7 @@ query_read(struct file_descriptor *descriptor, struct fssh_dirent *buffer,
}
static fssh_status_t
static fssh_status_t
query_rewind(struct file_descriptor *descriptor)
{
struct fs_mount *mount = descriptor->u.mount;
@ -4888,7 +4886,7 @@ fs_next_device(int32_t *_cookie)
struct fs_mount *mount = NULL;
fssh_dev_t device = *_cookie;
fssh_mutex_lock(&sMountMutex);
fssh_mutex_lock(&sMountMutex);
// Since device IDs are assigned sequentially, this algorithm
// does work good enough. It makes sure that the device list
@ -4909,7 +4907,7 @@ fs_next_device(int32_t *_cookie)
device = FSSH_B_BAD_VALUE;
fssh_mutex_unlock(&sMountMutex);
return device;
}
@ -4931,7 +4929,7 @@ get_cwd(char *buffer, fssh_size_t size, bool kernel)
status = FSSH_B_ERROR;
fssh_mutex_unlock(&context->io_mutex);
return status;
return status;
}
@ -5142,7 +5140,7 @@ _kern_open_dir(int fd, const char *path)
}
fssh_status_t
fssh_status_t
_kern_fcntl(int fd, int op, uint32_t argument)
{
return common_fcntl(fd, op, argument, true);
@ -5245,7 +5243,7 @@ _kern_read_link(int fd, const char *path, char *buffer, fssh_size_t *_bufferSize
if (pathBuffer.InitCheck() != FSSH_B_OK)
return FSSH_B_NO_MEMORY;
return common_read_link(fd, pathBuffer.LockBuffer(),
return common_read_link(fd, pathBuffer.LockBuffer(),
buffer, _bufferSize, true);
}
@ -5282,7 +5280,7 @@ _kern_create_symlink(int fd, const char *path, const char *toPath, int mode)
if (status < FSSH_B_OK)
return status;
return common_create_symlink(fd, pathBuffer.LockBuffer(),
return common_create_symlink(fd, pathBuffer.LockBuffer(),
toBuffer, mode, true);
}
@ -5295,7 +5293,7 @@ _kern_create_link(const char *path, const char *toPath)
if (pathBuffer.InitCheck() != FSSH_B_OK || toPathBuffer.InitCheck() != FSSH_B_OK)
return FSSH_B_NO_MEMORY;
return common_create_link(pathBuffer.LockBuffer(),
return common_create_link(pathBuffer.LockBuffer(),
toPathBuffer.LockBuffer(), true);
}
@ -5352,7 +5350,7 @@ _kern_rename(int oldFD, const char *oldPath, int newFD, const char *newPath)
if (oldPathBuffer.InitCheck() != FSSH_B_OK || newPathBuffer.InitCheck() != FSSH_B_OK)
return FSSH_B_NO_MEMORY;
return common_rename(oldFD, oldPathBuffer.LockBuffer(),
return common_rename(oldFD, oldPathBuffer.LockBuffer(),
newFD, newPathBuffer.LockBuffer(), true);
}
@ -5411,7 +5409,7 @@ _kern_read_stat(int fd, const char *path, bool traverseLeafLink,
if (pathBuffer.InitCheck() != FSSH_B_OK)
return FSSH_B_NO_MEMORY;
status = common_path_read_stat(fd, pathBuffer.LockBuffer(),
status = common_path_read_stat(fd, pathBuffer.LockBuffer(),
traverseLeafLink, stat, true);
} else {
// no path given: get the FD and use the FD operation
@ -5481,7 +5479,7 @@ _kern_write_stat(int fd, const char *path, bool traverseLeafLink,
if (pathBuffer.InitCheck() != FSSH_B_OK)
return FSSH_B_NO_MEMORY;
status = common_path_write_stat(fd, pathBuffer.LockBuffer(),
status = common_path_write_stat(fd, pathBuffer.LockBuffer(),
traverseLeafLink, stat, statMask, true);
} else {
// no path given: get the FD and use the FD operation

View File

@ -20,7 +20,7 @@ namespace FSShell {
/* R5 figures, but we don't use a table for monitors anyway */
#define DEFAULT_FD_TABLE_SIZE 128
#define MAX_FD_TABLE_SIZE 8192
#define DEFAULT_NODE_MONITORS 4096
#define DEFAULT_NODE_MONITORS 4096
#define MAX_NODE_MONITORS 65536
struct kernel_args;
@ -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);