cellFs fix

This commit is contained in:
Nekotekina 2015-05-09 01:36:15 +03:00
parent 8cf62e560e
commit 3ae43edc3e
2 changed files with 3 additions and 27 deletions

View File

@ -477,11 +477,6 @@ s32 cellFsStReadStart(u32 fd, u64 offset, u64 size)
return CELL_FS_EBADF; return CELL_FS_EBADF;
} }
if (size > std::numeric_limits<u32>::max()) // ???
{
return CELL_FS_EINVAL;
}
switch (auto status = file->st_status.compare_and_swap(SSS_INITIALIZED, SSS_STARTED)) switch (auto status = file->st_status.compare_and_swap(SSS_INITIALIZED, SSS_STARTED))
{ {
case SSS_NOT_INITIALIZED: case SSS_NOT_INITIALIZED:
@ -595,11 +590,6 @@ s32 cellFsStRead(u32 fd, vm::ptr<u8> buf, u64 size, vm::ptr<u64> rsize)
return CELL_FS_EBADF; return CELL_FS_EBADF;
} }
if (size > std::numeric_limits<u32>::max()) // ???
{
return CELL_FS_EINVAL;
}
if (file->st_status.read_sync() == SSS_NOT_INITIALIZED || file->st_copyless) if (file->st_status.read_sync() == SSS_NOT_INITIALIZED || file->st_copyless)
{ {
return CELL_FS_ENXIO; return CELL_FS_ENXIO;
@ -667,11 +657,6 @@ s32 cellFsStReadPutCurrentAddr(u32 fd, vm::ptr<u8> addr, u64 size)
return CELL_FS_EBADF; return CELL_FS_EBADF;
} }
if (size > std::numeric_limits<u32>::max()) // ???
{
return CELL_FS_EINVAL;
}
if (file->st_status.read_sync() == SSS_NOT_INITIALIZED || !file->st_copyless) if (file->st_status.read_sync() == SSS_NOT_INITIALIZED || !file->st_copyless)
{ {
return CELL_FS_ENXIO; return CELL_FS_ENXIO;
@ -699,11 +684,6 @@ s32 cellFsStReadWait(u32 fd, u64 size)
return CELL_FS_EBADF; return CELL_FS_EBADF;
} }
if (size > std::numeric_limits<u32>::max()) // ???
{
return CELL_FS_EINVAL;
}
if (file->st_status.read_sync() == SSS_NOT_INITIALIZED) if (file->st_status.read_sync() == SSS_NOT_INITIALIZED)
{ {
return CELL_FS_ENXIO; return CELL_FS_ENXIO;
@ -738,17 +718,12 @@ s32 cellFsStReadWaitCallback(u32 fd, u64 size, fs_st_cb_t func)
return CELL_FS_EBADF; return CELL_FS_EBADF;
} }
if (size > std::numeric_limits<u32>::max()) // ???
{
return CELL_FS_EINVAL;
}
if (file->st_status.read_sync() == SSS_NOT_INITIALIZED) if (file->st_status.read_sync() == SSS_NOT_INITIALIZED)
{ {
return CELL_FS_ENXIO; return CELL_FS_ENXIO;
} }
if (!file->st_callback.compare_and_swap_test({}, { static_cast<u32>(size), func })) if (!file->st_callback.compare_and_swap_test({}, { size, func }))
{ {
return CELL_FS_EIO; return CELL_FS_EIO;
} }

View File

@ -158,8 +158,9 @@ using fs_st_cb_t = vm::ptr<void(u32 xfd, u64 xsize)>;
struct fs_st_cb_rec_t struct fs_st_cb_rec_t
{ {
u32 size; u64 size;
fs_st_cb_t func; fs_st_cb_t func;
u32 pad;
}; };
struct fs_file_t struct fs_file_t