Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 344762
b: refs/heads/master
c: 40ff2c3
h: refs/heads/master
v: v3
  • Loading branch information
Sebastian Andrzej Siewior authored and Nicholas Bellinger committed Dec 5, 2012
1 parent 1485a4a commit f7e3cde
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0ff8754981261a80f4b77db2536dfea92c2d4539
refs/heads/master: 40ff2c3b3da35dd3a00ac6722056a59b4b3f2caf
9 changes: 7 additions & 2 deletions trunk/drivers/target/target_core_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,16 @@ static int fd_do_readv(struct se_cmd *cmd, struct scatterlist *sgl,

for_each_sg(sgl, sg, sgl_nents, i) {
iov[i].iov_len = sg->length;
iov[i].iov_base = sg_virt(sg);
iov[i].iov_base = kmap(sg_page(sg)) + sg->offset;
}

old_fs = get_fs();
set_fs(get_ds());
ret = vfs_readv(fd, &iov[0], sgl_nents, &pos);
set_fs(old_fs);

for_each_sg(sgl, sg, sgl_nents, i)
kunmap(sg_page(sg));
kfree(iov);
/*
* Return zeros and GOOD status even if the READ did not return
Expand Down Expand Up @@ -288,14 +290,17 @@ static int fd_do_writev(struct se_cmd *cmd, struct scatterlist *sgl,

for_each_sg(sgl, sg, sgl_nents, i) {
iov[i].iov_len = sg->length;
iov[i].iov_base = sg_virt(sg);
iov[i].iov_base = kmap(sg_page(sg)) + sg->offset;
}

old_fs = get_fs();
set_fs(get_ds());
ret = vfs_writev(fd, &iov[0], sgl_nents, &pos);
set_fs(old_fs);

for_each_sg(sgl, sg, sgl_nents, i)
kunmap(sg_page(sg));

kfree(iov);

if (ret < 0 || ret != cmd->data_length) {
Expand Down

0 comments on commit f7e3cde

Please sign in to comment.