1. 15 Mar, 2011 1 commit
  2. 12 Jan, 2011 1 commit
    • Al Viro's avatar
      switch 9p · 98cd3fb0
      Al Viro authored
      here we actually *want* ->d_op for root; setting it allows to get rid
      of kludge in v9fs_kill_super() since now we have proper ->d_release()
      for root and don't need to call it manually.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
  3. 11 Jan, 2011 2 commits
  4. 06 Jan, 2011 5 commits
    • Nick Piggin's avatar
      fs: dcache per-inode inode alias locking · 873feea0
      Nick Piggin authored
      dcache_inode_lock can be replaced with per-inode locking. Use existing
      inode->i_lock for this. This is slightly non-trivial because we sometimes
      need to find the inode from the dentry, which requires d_inode to be
      stabilised (either with refcount or d_lock).
      Signed-off-by: default avatarNick Piggin <npiggin@kernel.dk>
    • Nick Piggin's avatar
      fs: dcache reduce branches in lookup path · fb045adb
      Nick Piggin authored
      Reduce some branches and memory accesses in dcache lookup by adding dentry
      flags to indicate common d_ops are set, rather than having to check them.
      This saves a pointer memory access (dentry->d_op) in common path lookup
      situations, and saves another pointer load and branch in cases where we
      have d_op but not the particular operation.
      Patched with:
      git grep -E '[.>]([[:space:]])*d_op([[:space:]])*=' | xargs sed -e 's/\([^\t ]*\)->d_op = \(.*\);/d_set_d_op(\1, \2);/' -e 's/\([^\t ]*\)\.d_op = \(.*\);/d_set_d_op(\&\1, \2);/' -i
      Signed-off-by: default avatarNick Piggin <npiggin@kernel.dk>
    • Nick Piggin's avatar
      fs: icache RCU free inodes · fa0d7e3d
      Nick Piggin authored
      RCU free the struct inode. This will allow:
      - Subsequent store-free path walking patch. The inode must be consulted for
        permissions when walking, so an RCU inode reference is a must.
      - sb_inode_list_lock to be moved inside i_lock because sb list walkers who want
        to take i_lock no longer need to take sb_inode_list_lock to walk the list in
        the first place. This will simplify and optimize locking.
      - Could remove some nested trylock loops in dcache code
      - Could potentially simplify things a bit in VM land. Do not need to take the
        page lock to follow page->mapping.
      The downsides of this is the performance cost of using RCU. In a simple
      creat/unlink microbenchmark, performance drops by about 10% due to inability to
      reuse cache-hot slab objects. As iterations increase and RCU freeing starts
      kicking over, this increases to about 20%.
      In cases where inode lifetimes are longer (ie. many inodes may be allocated
      during the average life span of a single inode), a lot of this cache reuse is
      not applicable, so the regression caused by this patch is smaller.
      The cache-hot regression could largely be avoided by using SLAB_DESTROY_BY_RCU,
      however this adds some complexity to list walking and store-free path walking,
      so I prefer to implement this at a later date, if it is shown to be a win in
      real situations. I haven't found a regression in any non-micro benchmark so I
      doubt it will be a problem.
      Signed-off-by: default avatarNick Piggin <npiggin@kernel.dk>
    • Nick Piggin's avatar
      fs: dcache remove dcache_lock · b5c84bf6
      Nick Piggin authored
      dcache_lock no longer protects anything. remove it.
      Signed-off-by: default avatarNick Piggin <npiggin@kernel.dk>
    • Nick Piggin's avatar
      fs: scale inode alias list · b23fb0a6
      Nick Piggin authored
      Add a new lock, dcache_inode_lock, to protect the inode's i_dentry list
      from concurrent modification. d_alias is also protected by d_lock.
      Signed-off-by: default avatarNick Piggin <npiggin@kernel.dk>
  5. 28 Oct, 2010 10 commits
  6. 25 Oct, 2010 1 commit
  7. 13 Sep, 2010 3 commits
  8. 10 Aug, 2010 1 commit
  9. 09 Aug, 2010 2 commits
    • Al Viro's avatar
    • Christoph Hellwig's avatar
      remove inode_setattr · 1025774c
      Christoph Hellwig authored
      Replace inode_setattr with opencoded variants of it in all callers.  This
      moves the remaining call to vmtruncate into the filesystem methods where it
      can be replaced with the proper truncate sequence.
      In a few cases it was obvious that we would never end up calling vmtruncate
      so it was left out in the opencoded variant:
       spufs: explicitly checks for ATTR_SIZE earlier
       btrfs,hugetlbfs,logfs,dlmfs: explicitly clears ATTR_SIZE earlier
       ufs: contains an opencoded simple_seattr + truncate that sets the filesize just above
      In addition to that ncpfs called inode_setattr with handcrafted iattrs,
      which allowed to trim down the opencoded variant.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
  10. 02 Aug, 2010 10 commits
    • Eric Van Hensbergen's avatar
      fs/9p: remove sparse warning in vfs_inode · ea137533
      Eric Van Hensbergen authored
      make v9fs_dentry_from_dir_inode static
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
    • Aneesh Kumar K.V's avatar
      fs/9p: Prevent parallel rename when doing fid_lookup · a534c8d1
      Aneesh Kumar K.V authored
      During fid lookup we need to make sure that the dentry->d_parent doesn't
      change so that we can safely walk the parent dentries. To ensure that
      we need to prevent cross directory rename during fid_lookup. Add a
      per superblock rename_sem rw_semaphore to prevent parallel fid lookup and
      Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: default avatarVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
    • Aneesh Kumar K.V's avatar
    • Venkateswararao Jujjuri (JV)'s avatar
      fs/9p: This patch implements TLCREATE for 9p2000.L protocol. · 5643135a
      Venkateswararao Jujjuri (JV) authored
          size[4] Tlcreate tag[2] fid[4] name[s] flags[4] mode[4] gid[4]
          size[4] Rlcreate tag[2] qid[13] iounit[4]
      The Tlreate request asks the file server to create a new regular file with the
      name supplied, in the directory (dir) represented by fid.
      The mode argument specifies the permissions to use. New file is created with
      the uid if the fid and with supplied gid.
      The flags argument represent Linux access mode flags with which the caller
      is requesting to open the file with. Protocol allows all the Linux access
      modes but it is upto the server to allow/disallow any of these acess modes.
      If the server doesn't support any of the access mode, it is expected to
      return error.
      Signed-off-by: default avatarVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
    • M. Mohan Kumar's avatar
      9p: Implement TMKDIR · 01a622bd
      M. Mohan Kumar authored
      Implement TMKDIR as part of 2000.L Work
          size[4] Tmkdir tag[2] fid[4] name[s] mode[4] gid[4]
          size[4] Rmkdir tag[2] qid[13]
          mkdir asks the file server to create a directory with given name,
          mode and gid. The qid for the new directory is returned with
          the mkdir reply message.
      Note: 72 is selected as the opcode for TMKDIR from the reserved list.
      Signed-off-by: default avatarM. Mohan Kumar <mohan@in.ibm.com>
      Signed-off-by: default avatarVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
    • M. Mohan Kumar's avatar
      9p: Implement TMKNOD · 4b43516a
      M. Mohan Kumar authored
          size[4] Tmknod tag[2] fid[4] name[s] mode[4] major[4] minor[4] gid[4]
          size[4] Rmknod tag[2] qid[13]
          mknod asks the file server to create a device node with given major and
          minor number, mode and gid. The qid for the new device node is returned
          with the mknod reply message.
      [sripathik@in.ibm.com: Fix error handling code]
      Signed-off-by: default avatarM. Mohan Kumar <mohan@in.ibm.com>
      Signed-off-by: default avatarVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
    • Venkateswararao Jujjuri (JV)'s avatar
      9p: Define and implement TSYMLINK for 9P2000.L · 50cc42ff
      Venkateswararao Jujjuri (JV) authored
      Create a symbolic link
      size[4] Tsymlink tag[2] fid[4] name[s] symtgt[s] gid[4]
      size[4] Rsymlink tag[2] qid[13]
      Create a symbolic link named 'name' pointing to 'symtgt'.
      gid represents the effective group id of the caller.
      The  permissions of a symbolic link are irrelevant hence it is omitted
      from the protocol.
      Signed-off-by: default avatarVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      Reviewed-by: default avatarSripathi Kodi <sripathik@in.ibm.com>
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
    • Eric Van Hensbergen's avatar
      9p: Define and implement TLINK for 9P2000.L · 09d34ee5
      Eric Van Hensbergen authored
      This patch adds a helper function to get the dentry from inode and
      uses it in creating a Hardlink
      size[4] Tlink tag[2] dfid[4] oldfid[4] newpath[s]
      size[4] Rlink tag[2]
      Create a link 'newpath' in directory pointed by dfid linking to oldfid path.
      [sripathik@in.ibm.com : p9_client_link should not free req structure
      if p9_client_rpc has returned an error.]
      Signed-off-by: default avatarVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
    • Sripathi Kodi's avatar
      9p: Implement client side of setattr for 9P2000.L protocol. · 87d7845a
      Sripathi Kodi authored
            size[4] Tsetattr tag[2] attr[n]
            size[4] Rsetattr tag[2]
            The setattr command changes some of the file status information.
            attr resembles the iattr structure used in Linux kernel. It
            specifies which status parameter is to be changed and to what
            value. It is laid out as follows:
                  specifies which status information is to be changed. Possible
                  values are:
                  ATTR_MODE       (1 << 0)
                  ATTR_UID        (1 << 1)
                  ATTR_GID        (1 << 2)
                  ATTR_SIZE       (1 << 3)
                  ATTR_ATIME      (1 << 4)
                  ATTR_MTIME      (1 << 5)
                  ATTR_ATIME_SET  (1 << 7)
                  ATTR_MTIME_SET  (1 << 8)
                  The last two bits represent whether the time information
                  is being sent by the client's user space. In the absense
                  of these bits the server always uses server's time.
                  File permission bits
                  Owner id of file
                  Group id of the file
                  File size
                  Time of last file access, seconds
                  Time of last file access, nanoseconds
                  Time of last file modification, seconds
                  Time of last file modification, nanoseconds
      Explanation of the patches:
      *) The kernel just copies relevent contents of iattr structure to
         p9_iattr_dotl structure and passes it down to the client. The
         only check it has is calling inode_change_ok()
      *) The p9_iattr_dotl structure does not have ctime and ia_file
         parameters because I don't think these are needed in our case.
         The client user space can request updating just ctime by calling
         chown(fd, -1, -1). This is handled on server side without a need
         for putting ctime on the wire.
      *) The server currently supports changing mode, time, ownership and
         size of the file.
      *) 9P RFC says "Either all the changes in wstat request happen, or
         none of them does: if the request succeeds, all changes were made;
         if it fails, none were."
         I have not done anything to implement this specifically because I
         don't see a reason.
      Signed-off-by: default avatarSripathi Kodi <sripathik@in.ibm.com>
      Signed-off-by: default avatarVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
    • Sripathi Kodi's avatar
      9p: getattr client implementation for 9P2000.L protocol. · f0853122
      Sripathi Kodi authored
                    size[4] Tgetattr tag[2] fid[4] request_mask[8]
                    size[4] Rgetattr tag[2] lstat[n]
                    The getattr transaction inquires about the file identified by fid.
                    request_mask is a bit mask that specifies which fields of the
                    stat structure is the client interested in.
                    The reply will contain a machine-independent directory entry,
                    laid out as follows:
                          Bit mask that indicates which fields in the stat structure
                          have been populated by the server
                          the type of the file (directory, etc.), represented as a bit
                          vector corresponding to the high 8 bits of the file's mode
                          version number for given path
                          the file server's unique identification for the file
                          Permission and flags
                          User id of owner
                          Group ID of owner
                          Number of hard links
                          Device ID (if special file)
                          Size, in bytes
                          Block size for file system IO
                          Number of file system blocks allocated
                          Time of last access, seconds
                          Time of last access, nanoseconds
                          Time of last modification, seconds
                          Time of last modification, nanoseconds
                          Time of last status change, seconds
                          Time of last status change, nanoseconds
                          Time of creation (birth) of file, seconds
                          Time of creation (birth) of file, nanoseconds
                          Inode generation
                          Data version number
                    request_mask and result_mask bit masks contain the following bits
                       #define P9_STATS_MODE          0x00000001ULL
                       #define P9_STATS_NLINK         0x00000002ULL
                       #define P9_STATS_UID           0x00000004ULL
                       #define P9_STATS_GID           0x00000008ULL
                       #define P9_STATS_RDEV          0x00000010ULL
                       #define P9_STATS_ATIME         0x00000020ULL
                       #define P9_STATS_MTIME         0x00000040ULL
                       #define P9_STATS_CTIME         0x00000080ULL
                       #define P9_STATS_INO           0x00000100ULL
                       #define P9_STATS_SIZE          0x00000200ULL
                       #define P9_STATS_BLOCKS        0x00000400ULL
                       #define P9_STATS_BTIME         0x00000800ULL
                       #define P9_STATS_GEN           0x00001000ULL
                       #define P9_STATS_DATA_VERSION  0x00002000ULL
                       #define P9_STATS_BASIC         0x000007ffULL
                       #define P9_STATS_ALL           0x00003fffULL
              This patch implements the client side of getattr implementation for
              9P2000.L. It introduces a new structure p9_stat_dotl for getting
              Linux stat information along with QID. The data layout is similar to
              stat structure in Linux user space with the following major
              inode (st_ino) is not part of data. Instead qid is.
              device (st_dev) is not part of data because this doesn't make sense
              on the client.
              All time variables are 64 bit wide on the wire. The kernel seems to use
              32 bit variables for these variables. However, some of the architectures
              have used 64 bit variables and glibc exposes 64 bit variables to user
              space on some architectures. Hence to be on the safer side we have made
              these 64 bit in the protocol. Refer to the comments in
              There are some additional fields: st_btime_sec, st_btime_nsec, st_gen,
              st_data_version apart from the bitmask, st_result_mask. The bit mask
              is filled by the server to indicate which stat fields have been
              populated by the server. Currently there is no clean way for the
              server to obtain these additional fields, so it sends back just the
              basic fields.
      Signed-off-by: default avatarSripathi Kodi <sripathik@in.ibm.com>
      Signed-off-by: default avatarEric Van Hensbegren <ericvh@gmail.com>
  11. 22 May, 2010 4 commits