diff options
author | Asias He <asias@redhat.com> | 2013-01-21 22:20:25 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-02-13 14:27:40 -0500 |
commit | 765b34fdc1507add8fd6f1007410e7a375d0f89c (patch) | |
tree | ba101d2224da2b56121e39b6fde67b5979ec2d11 /drivers/vhost | |
parent | 9d6064a347a8e15451cbdf6286542d402c9da24c (diff) |
tcm_vhost: Introduce iov_num_pages
Add a helper to calculate the number of pages needed for a iov entry.
(nab: Drop unnecessary inline)
Signed-off-by: Asias He <asias@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/vhost')
-rw-r--r-- | drivers/vhost/tcm_vhost.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index 77d760bb2e44..defc28595656 100644 --- a/drivers/vhost/tcm_vhost.c +++ b/drivers/vhost/tcm_vhost.c | |||
@@ -77,6 +77,12 @@ static struct workqueue_struct *tcm_vhost_workqueue; | |||
77 | static DEFINE_MUTEX(tcm_vhost_mutex); | 77 | static DEFINE_MUTEX(tcm_vhost_mutex); |
78 | static LIST_HEAD(tcm_vhost_list); | 78 | static LIST_HEAD(tcm_vhost_list); |
79 | 79 | ||
80 | static int iov_num_pages(struct iovec *iov) | ||
81 | { | ||
82 | return (PAGE_ALIGN((unsigned long)iov->iov_base + iov->iov_len) - | ||
83 | ((unsigned long)iov->iov_base & PAGE_MASK)) >> PAGE_SHIFT; | ||
84 | } | ||
85 | |||
80 | static int tcm_vhost_check_true(struct se_portal_group *se_tpg) | 86 | static int tcm_vhost_check_true(struct se_portal_group *se_tpg) |
81 | { | 87 | { |
82 | return 1; | 88 | return 1; |