lkml.org 
[lkml]   [2014]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] vfs: move getname() from callers to do_mount()
On Sun, Sep 14, 2014 at 10:15:10PM +0900, Seunghun Lee wrote:
> It would make more sense to pass char __user * instead of
> char * in callers of do_mount() and do getname() inside do_mount().
>
> Suggested-by: Al Viro <viro@ZenIV.linux.org.uk>
> Signed-off-by: Seunghun Lee <waydi1@gmail.com>

Applied with one modification: this getname/kern_path/putname is equivalent to
user_path(dir_name, &path) and do_mount() becomes simpler if we use that
instead of not-quite-opencoding it.

Beginning of do_mount() becomes simply
/* Discard magic */
if ((flags & MS_MGC_MSK) == MS_MGC_VAL)
flags &= ~MS_MGC_MSK;

/* Basic sanity checks */
if (data_page)
((char *)data_page)[PAGE_SIZE - 1] = 0;

/* ... and get the mountpoint */
retval = user_path(dir_name, &path);
if (retval)
return retval;
that way, and there's no struct filename * to discard on exit; getname and
putname are done inside user_path().


\
 
 \ /
  Last update: 2014-09-14 20:41    [W:0.126 / U:0.896 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site