Bring back read page alignmnet
This commit is contained in:
parent
33863b8b96
commit
f4c9e85924
@ -709,9 +709,7 @@ static int do_read(struct fsg_common *common)
|
|||||||
u32 amount_left;
|
u32 amount_left;
|
||||||
loff_t file_offset, file_offset_tmp;
|
loff_t file_offset, file_offset_tmp;
|
||||||
unsigned int amount;
|
unsigned int amount;
|
||||||
// partial_page handling causes hangs
|
unsigned int partial_page;
|
||||||
// same thing in do_write() --mmoskal
|
|
||||||
//unsigned int partial_page;
|
|
||||||
ssize_t nread;
|
ssize_t nread;
|
||||||
|
|
||||||
/* Get the starting Logical Block Address and check that it's
|
/* Get the starting Logical Block Address and check that it's
|
||||||
@ -756,12 +754,10 @@ static int do_read(struct fsg_common *common)
|
|||||||
amount = min(amount_left, FSG_BUFLEN);
|
amount = min(amount_left, FSG_BUFLEN);
|
||||||
amount = min((loff_t) amount,
|
amount = min((loff_t) amount,
|
||||||
curlun->file_length - file_offset);
|
curlun->file_length - file_offset);
|
||||||
/*
|
|
||||||
partial_page = file_offset & (PAGE_CACHE_SIZE - 1);
|
partial_page = file_offset & (PAGE_CACHE_SIZE - 1);
|
||||||
if (partial_page > 0)
|
if (partial_page > 0)
|
||||||
amount = min(amount, (unsigned int) PAGE_CACHE_SIZE -
|
amount = min(amount, (unsigned int) PAGE_CACHE_SIZE -
|
||||||
partial_page);
|
partial_page);
|
||||||
*/
|
|
||||||
/* Wait for the next buffer to become available */
|
/* Wait for the next buffer to become available */
|
||||||
bh = common->next_buffhd_to_fill;
|
bh = common->next_buffhd_to_fill;
|
||||||
while (bh->state != BUF_STATE_EMPTY) {
|
while (bh->state != BUF_STATE_EMPTY) {
|
||||||
@ -844,7 +840,7 @@ static int do_write(struct fsg_common *common)
|
|||||||
u32 amount_left_to_req, amount_left_to_write;
|
u32 amount_left_to_req, amount_left_to_write;
|
||||||
loff_t usb_offset, file_offset, file_offset_tmp;
|
loff_t usb_offset, file_offset, file_offset_tmp;
|
||||||
unsigned int amount;
|
unsigned int amount;
|
||||||
//unsigned int partial_page;
|
unsigned int partial_page;
|
||||||
ssize_t nwritten;
|
ssize_t nwritten;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
@ -908,12 +904,10 @@ static int do_write(struct fsg_common *common)
|
|||||||
amount = min(amount_left_to_req, FSG_BUFLEN);
|
amount = min(amount_left_to_req, FSG_BUFLEN);
|
||||||
amount = min((loff_t) amount, curlun->file_length -
|
amount = min((loff_t) amount, curlun->file_length -
|
||||||
usb_offset);
|
usb_offset);
|
||||||
/*
|
|
||||||
partial_page = usb_offset & (PAGE_CACHE_SIZE - 1);
|
partial_page = usb_offset & (PAGE_CACHE_SIZE - 1);
|
||||||
if (partial_page > 0)
|
if (partial_page > 0)
|
||||||
amount = min(amount,
|
amount = min(amount,
|
||||||
(unsigned int) PAGE_CACHE_SIZE - partial_page);
|
(unsigned int) PAGE_CACHE_SIZE - partial_page);
|
||||||
*/
|
|
||||||
|
|
||||||
if (amount == 0) {
|
if (amount == 0) {
|
||||||
get_some_more = 0;
|
get_some_more = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user