Skip to content

Commit

Permalink
tcm_vhost: Introduce iov_num_pages
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Asias He authored and Nicholas Bellinger committed Feb 13, 2013
1 parent 9d6064a commit 765b34f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/vhost/tcm_vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ static struct workqueue_struct *tcm_vhost_workqueue;
static DEFINE_MUTEX(tcm_vhost_mutex);
static LIST_HEAD(tcm_vhost_list);

static int iov_num_pages(struct iovec *iov)
{
return (PAGE_ALIGN((unsigned long)iov->iov_base + iov->iov_len) -
((unsigned long)iov->iov_base & PAGE_MASK)) >> PAGE_SHIFT;
}

static int tcm_vhost_check_true(struct se_portal_group *se_tpg)
{
return 1;
Expand Down

0 comments on commit 765b34f

Please sign in to comment.