1. 17 3月, 2011 1 次提交
  2. 16 3月, 2011 11 次提交
  3. 15 3月, 2011 13 次提交
  4. 14 3月, 2011 15 次提交
    • A
      exportfs: Return the minimum required handle size · 5fe0c237
      Aneesh Kumar K.V 提交于
      The exportfs encode handle function should return the minimum required
      handle size. This helps user to find out the handle size by passing 0
      handle size in the first step and then redoing to the call again with
      the returned handle size value.
      Acked-by: NSerge Hallyn <serue@us.ibm.com>
      Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      5fe0c237
    • A
      clean statfs-like syscalls up · c8b91acc
      Al Viro 提交于
      New helpers: user_statfs() and fd_statfs(), taking userland pathname and
      descriptor resp. and filling struct kstatfs.  Syscalls of statfs family
      (native, compat and foreign - osf and hpux on alpha and parisc resp.)
      switched to those.  Removes some boilerplate code, simplifies cleanup
      on errors...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      c8b91acc
    • A
      open-style analog of vfs_path_lookup() · 73d049a4
      Al Viro 提交于
      new function: file_open_root(dentry, mnt, name, flags) opens the file
      vfs_path_lookup would arrive to.
      
      Note that name can be empty; in that case the usual requirement that
      dentry should be a directory is lifted.
      
      open-coded equivalents switched to it, may_open() got down exactly
      one caller and became static.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      73d049a4
    • A
      reduce vfs_path_lookup() to do_path_lookup() · 5b6ca027
      Al Viro 提交于
      New lookup flag: LOOKUP_ROOT.  nd->root is set (and held) by caller,
      path_init() starts walking from that place and all pathname resolution
      machinery never drops nd->root if that flag is set.  That turns
      vfs_path_lookup() into a special case of do_path_lookup() *and*
      gets us down to 3 callers of link_path_walk(), making it finally
      feasible to rip the handling of trailing symlink out of link_path_walk().
      That will not only simply the living hell out of it, but make life
      much simpler for unionfs merge.  Trailing symlink handling will
      become iterative, which is a good thing for stack footprint in
      a lot of situations as well.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      5b6ca027
    • A
      untangle do_lookup() · 5a18fff2
      Al Viro 提交于
      That thing has devolved into rats nest of gotos; sane use of unlikely()
      gets rid of that horror and gives much more readable structure:
      	* make a fast attempt to find a dentry; false negatives are OK.
      In RCU mode if everything went fine, we are done, otherwise just drop
      out of RCU.  If we'd done (RCU) ->d_revalidate() and it had not refused
      outright (i.e. didn't give us -ECHILD), remember its result.
      	* now we are not in RCU mode and hopefully have a dentry.  If we
      do not, lock parent, do full d_lookup() and if that has not found anything,
      allocate and call ->lookup().  If we'd done that ->lookup(), remember that
      dentry is good and we don't need to revalidate it.
      	* now we have a dentry.  If it has ->d_revalidate() and we can't
      skip it, call it.
      	* hopefully dentry is good; if not, either fail (in case of error)
      or try to invalidate it.  If d_invalidate() has succeeded, drop it and
      retry everything as if original attempt had not found a dentry.
      	* now we can finish it up - deal with mountpoint crossing and
      automount.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      5a18fff2
    • A
      path_openat: clean ELOOP handling a bit · 40b39136
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      40b39136
    • A
      do_last: kill a rudiment of old ->d_revalidate() workaround · f374ed5f
      Al Viro 提交于
      There used to be time when ->d_revalidate() couldn't return an error.
      So intents code had lookup_instantiate_filp() stash ERR_PTR(error)
      in nd->intent.open.filp and had it checked after lookup_hash(), to
      catch the otherwise silent failures.  That had been introduced by
      commit 4af4c52f.  These days
      ->d_revalidate() can and does propagate errors back to callers
      explicitly, so this check isn't needed anymore.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      f374ed5f
    • A
      fold __open_namei_create() and open_will_truncate() into do_last() · 6c0d46c4
      Al Viro 提交于
      ... and clean up a bit more
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6c0d46c4
    • A
      do_last: unify may_open() call and everyting after it · ca344a89
      Al Viro 提交于
      We have a bunch of diverging codepaths in do_last(); some of
      them converge, but the case of having to create a new file
      duplicates large part of common tail of the rest and exits
      separately.  Massage them so that they could be merged.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      ca344a89
    • A
      move may_open() from __open_name_create() to do_last() · 9b44f1b3
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      9b44f1b3
    • A
      expand finish_open() in its only caller · 0f9d1a10
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      0f9d1a10
    • A
      sanitize pathname component hash calculation · 5a202bcd
      Al Viro 提交于
      Lift it to lookup_one_len() and link_path_walk() resp. into the
      same place where we calculated default hash function of the same
      name.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      5a202bcd
    • A
      kill __lookup_one_len() · 6a96ba54
      Al Viro 提交于
      only one caller left
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6a96ba54
    • A
      switch non-create side of open() to use of do_last() · fe2d35ff
      Al Viro 提交于
      Instead of path_lookupat() doing trailing symlink resolution,
      use the same scheme as on the O_CREAT side.  Walk with
      LOOKUP_PARENT, then (in do_last()) look the final component
      up, then either open it or return error or, if it's a symlink,
      give the symlink back to path_openat() to be resolved there.
      
      The really messy complication here is RCU.  We don't want to drop
      out of RCU mode before the final lookup, since we don't want to
      bounce parent directory ->d_count without a good reason.
      
      Result is _not_ pretty; later in the series we'll clean it up.
      For now we are roughly back where we'd been before the revert
      done by Nick's series - top-level logics of path_openat() is
      cleaned up, do_last() does actual opening, symlink resolution is
      done uniformly.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      fe2d35ff
    • A
      get rid of nd->file · 70e9b357
      Al Viro 提交于
      Don't stash the struct file * used as starting point of walk in nameidata;
      pass file ** to path_init() instead.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      70e9b357