public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Chinner <dgc@sgi.com>
To: Christoph Hellwig <hch@lst.de>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] stop using uio in the readlink code
Date: Wed, 1 Aug 2007 15:41:42 +1000	[thread overview]
Message-ID: <20070801054142.GT31489@sgi.com> (raw)
In-Reply-To: <20070729211354.GB12824@lst.de>

On Sun, Jul 29, 2007 at 11:13:54PM +0200, Christoph Hellwig wrote:
> Simplify the readlink code to get rid of the last user of uio.
> 
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
.....
> --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ioctl.c	2007-07-14 16:07:19.000000000 +0200
> +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c	2007-07-29 14:28:29.000000000 +0200
> @@ -349,19 +349,44 @@ xfs_open_by_handle(
>  	return new_fd;
>  }
>  
> +/*
> + * This is a copy from fs/namei.c:vfs_readlink(), except for removing it's
> + * unused first argument.
> + */
> +STATIC int
> +do_readlink(
> +	char __user		*buffer,
> +	int			buflen,
> +	const char		*link)
> +{
> +        int len;
> +
> +	len = PTR_ERR(link);
> +	if (IS_ERR(link))
> +		goto out;
> +
> +	len = strlen(link);
> +	if (len > (unsigned) buflen)
> +		len = buflen;
> +	if (copy_to_user(buffer, link, len))
> +		len = -EFAULT;
> + out:
> +	return len;
> +}

Do we really need to copy this code? I guess it doesn't really
matter that much but it would be nice not to have to copy an
exported vfs function just because we don't have a dentry...

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group

  reply	other threads:[~2007-08-01  5:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-29 21:13 [PATCH] stop using uio in the readlink code Christoph Hellwig
2007-08-01  5:41 ` David Chinner [this message]
2007-08-01 12:55   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070801054142.GT31489@sgi.com \
    --to=dgc@sgi.com \
    --cc=hch@lst.de \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox