am 3b0c24e2: Merge "sdcard: direct I/O file access write buffer alignment"
* commit '3b0c24e28d7538ff5b49a98eee99bac85c8e687b': sdcard: direct I/O file access write buffer alignment
This commit is contained in:
commit
406f1aff9a
1 changed files with 6 additions and 0 deletions
|
|
@ -1244,6 +1244,12 @@ static int handle_write(struct fuse* fuse, struct fuse_handler* handler,
|
||||||
struct fuse_write_out out;
|
struct fuse_write_out out;
|
||||||
struct handle *h = id_to_ptr(req->fh);
|
struct handle *h = id_to_ptr(req->fh);
|
||||||
int res;
|
int res;
|
||||||
|
__u8 aligned_buffer[req->size] __attribute__((__aligned__(PAGESIZE)));
|
||||||
|
|
||||||
|
if (req->flags & O_DIRECT) {
|
||||||
|
memcpy(aligned_buffer, buffer, req->size);
|
||||||
|
buffer = (const __u8*) aligned_buffer;
|
||||||
|
}
|
||||||
|
|
||||||
TRACE("[%d] WRITE %p(%d) %u@%llu\n", handler->token,
|
TRACE("[%d] WRITE %p(%d) %u@%llu\n", handler->token,
|
||||||
h, h->fd, req->size, req->offset);
|
h, h->fd, req->size, req->offset);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue