diff options
author | Christoph Hellwig <hch@infradead.org> | 2007-08-27 23:59:03 -0400 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-10-15 02:50:13 -0400 |
commit | 804c83c37607efe415774c3a170ad72a789e5992 (patch) | |
tree | f53df9e59968cf16904e7652bca7e2a7cd3da57b /fs/xfs/linux-2.6/xfs_iops.c | |
parent | 051e7cd44ab8f0f7c2958371485b4a1ff64a8d1b (diff) |
[XFS] stop using uio in the readlink code
Simplify the readlink code to get rid of the last user of uio.
SGI-PV: 968563
SGI-Modid: xfs-linux-melb:xfs-kern:29479a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_iops.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_iops.c | 50 |
1 files changed, 13 insertions, 37 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 0b5fa124bef2..ef941f99b2bc 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -542,50 +542,26 @@ xfs_vn_follow_link( | |||
542 | struct dentry *dentry, | 542 | struct dentry *dentry, |
543 | struct nameidata *nd) | 543 | struct nameidata *nd) |
544 | { | 544 | { |
545 | bhv_vnode_t *vp; | 545 | bhv_vnode_t *vp = vn_from_inode(dentry->d_inode); |
546 | uio_t *uio; | ||
547 | iovec_t iov; | ||
548 | int error; | ||
549 | char *link; | 546 | char *link; |
550 | 547 | int error = -ENOMEM; | |
551 | ASSERT(dentry); | ||
552 | ASSERT(nd); | ||
553 | 548 | ||
554 | link = kmalloc(MAXPATHLEN+1, GFP_KERNEL); | 549 | link = kmalloc(MAXPATHLEN+1, GFP_KERNEL); |
555 | if (!link) { | 550 | if (!link) |
556 | nd_set_link(nd, ERR_PTR(-ENOMEM)); | 551 | goto out_err; |
557 | return NULL; | ||
558 | } | ||
559 | |||
560 | uio = kmalloc(sizeof(uio_t), GFP_KERNEL); | ||
561 | if (!uio) { | ||
562 | kfree(link); | ||
563 | nd_set_link(nd, ERR_PTR(-ENOMEM)); | ||
564 | return NULL; | ||
565 | } | ||
566 | |||
567 | vp = vn_from_inode(dentry->d_inode); | ||
568 | 552 | ||
569 | iov.iov_base = link; | 553 | error = -bhv_vop_readlink(vp, link); |
570 | iov.iov_len = MAXPATHLEN; | 554 | if (unlikely(error)) |
571 | 555 | goto out_kfree; | |
572 | uio->uio_iov = &iov; | ||
573 | uio->uio_offset = 0; | ||
574 | uio->uio_segflg = UIO_SYSSPACE; | ||
575 | uio->uio_resid = MAXPATHLEN; | ||
576 | uio->uio_iovcnt = 1; | ||
577 | |||
578 | error = bhv_vop_readlink(vp, uio, 0, NULL); | ||
579 | if (unlikely(error)) { | ||
580 | kfree(link); | ||
581 | link = ERR_PTR(-error); | ||
582 | } else { | ||
583 | link[MAXPATHLEN - uio->uio_resid] = '\0'; | ||
584 | } | ||
585 | kfree(uio); | ||
586 | 556 | ||
587 | nd_set_link(nd, link); | 557 | nd_set_link(nd, link); |
588 | return NULL; | 558 | return NULL; |
559 | |||
560 | out_kfree: | ||
561 | kfree(link); | ||
562 | out_err: | ||
563 | nd_set_link(nd, ERR_PTR(error)); | ||
564 | return NULL; | ||
589 | } | 565 | } |
590 | 566 | ||
591 | STATIC void | 567 | STATIC void |