* {read|write}_pages() does not have a "reenter" argument. This could let both
commands run without proper locking. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30160 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
3553f323a6
commit
1db58389c6
@ -1504,9 +1504,8 @@ dosfs_can_page(fs_volume *_vol, fs_vnode *_node, void *_cookie)
|
||||
|
||||
|
||||
status_t
|
||||
dosfs_read_pages(fs_volume *_vol, fs_vnode *_node, void *_cookie,
|
||||
off_t pos, const iovec *vecs, size_t count, size_t *_numBytes,
|
||||
bool reenter)
|
||||
dosfs_read_pages(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
|
||||
const iovec *vecs, size_t count, size_t *_numBytes)
|
||||
{
|
||||
nspace *vol = (nspace *)_vol->private_volume;
|
||||
vnode *node = (vnode *)_node->private_node;
|
||||
@ -1522,9 +1521,7 @@ dosfs_read_pages(fs_volume *_vol, fs_vnode *_node, void *_cookie,
|
||||
if (node->cache == NULL)
|
||||
return(B_BAD_VALUE);
|
||||
|
||||
if (!reenter) {
|
||||
LOCK_VOL(vol);
|
||||
}
|
||||
LOCK_VOL(vol);
|
||||
|
||||
while (true) {
|
||||
struct file_io_vec fileVecs[8];
|
||||
@ -1548,18 +1545,15 @@ dosfs_read_pages(fs_volume *_vol, fs_vnode *_node, void *_cookie,
|
||||
bytesLeft -= bytes;
|
||||
}
|
||||
|
||||
if (!reenter) {
|
||||
UNLOCK_VOL(vol);
|
||||
}
|
||||
UNLOCK_VOL(vol);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
dosfs_write_pages(fs_volume *_vol, fs_vnode *_node, void *_cookie,
|
||||
off_t pos, const iovec *vecs, size_t count, size_t *_numBytes,
|
||||
bool reenter)
|
||||
dosfs_write_pages(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
|
||||
const iovec *vecs, size_t count, size_t *_numBytes)
|
||||
{
|
||||
nspace *vol = (nspace *)_vol->private_volume;
|
||||
vnode *node = (vnode *)_node->private_node;
|
||||
@ -1575,9 +1569,7 @@ dosfs_write_pages(fs_volume *_vol, fs_vnode *_node, void *_cookie,
|
||||
if (node->cache == NULL)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
if (!reenter) {
|
||||
LOCK_VOL(vol);
|
||||
}
|
||||
LOCK_VOL(vol);
|
||||
|
||||
while (true) {
|
||||
struct file_io_vec fileVecs[8];
|
||||
@ -1601,9 +1593,7 @@ dosfs_write_pages(fs_volume *_vol, fs_vnode *_node, void *_cookie,
|
||||
bytesLeft -= bytes;
|
||||
}
|
||||
|
||||
if (!reenter) {
|
||||
UNLOCK_VOL(vol);
|
||||
}
|
||||
UNLOCK_VOL(vol);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
Copyright 1999-2001, Be Incorporated. All Rights Reserved.
|
||||
This file may be used under the terms of the Be Sample Code License.
|
||||
*/
|
||||
#ifndef _DOSFS_FILE_H_
|
||||
#define _DOSFS_FILE_H_
|
||||
#ifndef FAT_FILE_H
|
||||
#define FAT_FILE_H
|
||||
|
||||
mode_t make_mode(nspace *volume, vnode *node);
|
||||
status_t write_vnode_entry(nspace *vol, vnode *node);
|
||||
@ -37,10 +37,8 @@ status_t dosfs_get_file_map(fs_volume *_vol, fs_vnode *_node, off_t pos,
|
||||
size_t reqLen, struct file_io_vec *vecs, size_t *_count);
|
||||
bool dosfs_can_page(fs_volume *_vol, fs_vnode *_node, void *_cookie);
|
||||
status_t dosfs_read_pages(fs_volume *_vol, 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);
|
||||
status_t dosfs_write_pages(fs_volume *_vol, 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);
|
||||
|
||||
#endif
|
||||
#endif /* FAT_FILE_H */
|
||||
|
Loading…
Reference in New Issue
Block a user