Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78169
b: refs/heads/master
c: 52427c9
h: refs/heads/master
i:
  78167: 68838af
v: v3
  • Loading branch information
Akinobu Mita authored and David S. Miller committed Jan 28, 2008
1 parent fd56bdf commit 2a55620
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 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: 02d45827fa211093202f96bdd58020cc8687929f
refs/heads/master: 52427c9d11477d5a2633d81050f52523decf9eff
15 changes: 2 additions & 13 deletions trunk/drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,17 +292,6 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv,
return count;
}

static inline size_t iov_total(const struct iovec *iv, unsigned long count)
{
unsigned long i;
size_t len;

for (i = 0, len = 0; i < count; i++)
len += iv[i].iov_len;

return len;
}

static ssize_t tun_chr_aio_write(struct kiocb *iocb, const struct iovec *iv,
unsigned long count, loff_t pos)
{
Expand All @@ -313,7 +302,7 @@ static ssize_t tun_chr_aio_write(struct kiocb *iocb, const struct iovec *iv,

DBG(KERN_INFO "%s: tun_chr_write %ld\n", tun->dev->name, count);

return tun_get_user(tun, (struct iovec *) iv, iov_total(iv, count));
return tun_get_user(tun, (struct iovec *) iv, iov_length(iv, count));
}

/* Put packet to the user space buffer */
Expand Down Expand Up @@ -364,7 +353,7 @@ static ssize_t tun_chr_aio_read(struct kiocb *iocb, const struct iovec *iv,

DBG(KERN_INFO "%s: tun_chr_read\n", tun->dev->name);

len = iov_total(iv, count);
len = iov_length(iv, count);
if (len < 0)
return -EINVAL;

Expand Down

0 comments on commit 2a55620

Please sign in to comment.