diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:54:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:54:14 -0400 |
commit | 1d77062b1402aef5b26e1d3776991126e8026bde (patch) | |
tree | 96e4da18878f5fb2ae50b260e194b78803d4c7a9 /net/sunrpc/xdr.c | |
parent | 25581ad107be24b89d805da51a03d616f8f3d1be (diff) | |
parent | 76a9f26c9e40e9c0ed5dc8f0cedd74e733f0088d (diff) |
Merge git://git.linux-nfs.org/pub/linux/nfs-2.6
* git://git.linux-nfs.org/pub/linux/nfs-2.6: (51 commits)
nfs: remove nfs_put_link()
nfs-build-fix-99
git-nfs-build-fixes
Merge branch 'odirect'
NFS: alloc nfs_read/write_data as direct I/O is scheduled
NFS: Eliminate nfs_get_user_pages()
NFS: refactor nfs_direct_free_user_pages
NFS: remove user_addr, user_count, and pos from nfs_direct_req
NFS: "open code" the NFS direct write rescheduler
NFS: Separate functions for counting outstanding NFS direct I/Os
NLM: Fix reclaim races
NLM: sem to mutex conversion
locks.c: add the fl_owner to nlm_compare_locks
NFS: Display the chosen RPCSEC_GSS security flavour in /proc/mounts
NFS: Split fs/nfs/inode.c
NFS: Fix typo in nfs_do_clone_mount()
NFS: Fix compile errors introduced by referrals patches
NFSv4: Ensure that referral mounts bind to a reserved port
NFSv4: A root pathname is sent as a zero component4
NFSv4: Follow a referral
...
Diffstat (limited to 'net/sunrpc/xdr.c')
-rw-r--r-- | net/sunrpc/xdr.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index ca4bfa57e116..49174f0d0a3e 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c | |||
@@ -568,8 +568,7 @@ EXPORT_SYMBOL(xdr_inline_decode); | |||
568 | * | 568 | * |
569 | * Moves data beyond the current pointer position from the XDR head[] buffer | 569 | * Moves data beyond the current pointer position from the XDR head[] buffer |
570 | * into the page list. Any data that lies beyond current position + "len" | 570 | * into the page list. Any data that lies beyond current position + "len" |
571 | * bytes is moved into the XDR tail[]. The current pointer is then | 571 | * bytes is moved into the XDR tail[]. |
572 | * repositioned at the beginning of the XDR tail. | ||
573 | */ | 572 | */ |
574 | void xdr_read_pages(struct xdr_stream *xdr, unsigned int len) | 573 | void xdr_read_pages(struct xdr_stream *xdr, unsigned int len) |
575 | { | 574 | { |
@@ -606,6 +605,31 @@ void xdr_read_pages(struct xdr_stream *xdr, unsigned int len) | |||
606 | } | 605 | } |
607 | EXPORT_SYMBOL(xdr_read_pages); | 606 | EXPORT_SYMBOL(xdr_read_pages); |
608 | 607 | ||
608 | /** | ||
609 | * xdr_enter_page - decode data from the XDR page | ||
610 | * @xdr: pointer to xdr_stream struct | ||
611 | * @len: number of bytes of page data | ||
612 | * | ||
613 | * Moves data beyond the current pointer position from the XDR head[] buffer | ||
614 | * into the page list. Any data that lies beyond current position + "len" | ||
615 | * bytes is moved into the XDR tail[]. The current pointer is then | ||
616 | * repositioned at the beginning of the first XDR page. | ||
617 | */ | ||
618 | void xdr_enter_page(struct xdr_stream *xdr, unsigned int len) | ||
619 | { | ||
620 | char * kaddr = page_address(xdr->buf->pages[0]); | ||
621 | xdr_read_pages(xdr, len); | ||
622 | /* | ||
623 | * Position current pointer at beginning of tail, and | ||
624 | * set remaining message length. | ||
625 | */ | ||
626 | if (len > PAGE_CACHE_SIZE - xdr->buf->page_base) | ||
627 | len = PAGE_CACHE_SIZE - xdr->buf->page_base; | ||
628 | xdr->p = (uint32_t *)(kaddr + xdr->buf->page_base); | ||
629 | xdr->end = (uint32_t *)((char *)xdr->p + len); | ||
630 | } | ||
631 | EXPORT_SYMBOL(xdr_enter_page); | ||
632 | |||
609 | static struct kvec empty_iov = {.iov_base = NULL, .iov_len = 0}; | 633 | static struct kvec empty_iov = {.iov_base = NULL, .iov_len = 0}; |
610 | 634 | ||
611 | void | 635 | void |