1. 10 8月, 2010 2 次提交
  2. 08 8月, 2010 3 次提交
  3. 06 8月, 2010 1 次提交
  4. 05 8月, 2010 8 次提交
    • S
      ppp: make channel_ops const · d7100da0
      stephen hemminger 提交于
      The PPP channel ops structure should be const.
      Cleanup the declarations to use standard C99 format.
      Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d7100da0
    • D
      RxRPC: Fix a potential deadlock between the call resend_timer and state_lock · 3b5bac2b
      David Howells 提交于
      RxRPC can potentially deadlock as rxrpc_resend_time_expired() wants to get
      call->state_lock so that it can alter the state of an RxRPC call.  However, its
      caller (call_timer_fn()) has an apparent lock on the timer struct.
      
      The problem is that rxrpc_resend_time_expired() isn't permitted to lock
      call->state_lock as this could cause a deadlock against rxrpc_send_abort() as
      that takes state_lock and then attempts to delete the resend timer by calling
      del_timer_sync().
      
      The deadlock can occur because del_timer_sync() will sit there forever waiting
      for rxrpc_resend_time_expired() to return, but the latter may then wait for
      call->state_lock, which rxrpc_send_abort() holds around del_timer_sync()...
      
      This leads to a warning appearing in the kernel log that looks something like
      the attached.
      
      It should be sufficient to simply dispense with the locks.  It doesn't matter
      if we set the resend timer expired event bit and queue the event processor
      whilst we're changing state to one where the resend timer is irrelevant as the
      event can just be ignored by the processor thereafter.
      
      =======================================================
      [ INFO: possible circular locking dependency detected ]
      2.6.35-rc3-cachefs+ #115
      -------------------------------------------------------
      swapper/0 is trying to acquire lock:
       (&call->state_lock){++--..}, at: [<ffffffffa00200d4>] rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]
      
      but task is already holding lock:
       (&call->resend_timer){+.-...}, at: [<ffffffff8103b675>] run_timer_softirq+0x182/0x2a5
      
      which lock already depends on the new lock.
      
      the existing dependency chain (in reverse order) is:
      
      -> #1 (&call->resend_timer){+.-...}:
             [<ffffffff810560bc>] __lock_acquire+0x889/0x8fa
             [<ffffffff81056184>] lock_acquire+0x57/0x6d
             [<ffffffff8103bb9c>] del_timer_sync+0x3c/0x86
             [<ffffffffa002bb7a>] rxrpc_send_abort+0x50/0x97 [af_rxrpc]
             [<ffffffffa002bdd9>] rxrpc_kernel_abort_call+0xa1/0xdd [af_rxrpc]
             [<ffffffffa0061588>] afs_deliver_to_call+0x129/0x368 [kafs]
             [<ffffffffa006181b>] afs_process_async_call+0x54/0xff [kafs]
             [<ffffffff8104261d>] worker_thread+0x1ef/0x2e2
             [<ffffffff81045f47>] kthread+0x7a/0x82
             [<ffffffff81002cd4>] kernel_thread_helper+0x4/0x10
      
      -> #0 (&call->state_lock){++--..}:
             [<ffffffff81055237>] validate_chain+0x727/0xd23
             [<ffffffff810560bc>] __lock_acquire+0x889/0x8fa
             [<ffffffff81056184>] lock_acquire+0x57/0x6d
             [<ffffffff813e6b69>] _raw_read_lock_bh+0x34/0x43
             [<ffffffffa00200d4>] rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]
             [<ffffffff8103b6e6>] run_timer_softirq+0x1f3/0x2a5
             [<ffffffff81036828>] __do_softirq+0xa2/0x13e
             [<ffffffff81002dcc>] call_softirq+0x1c/0x28
             [<ffffffff810049f0>] do_softirq+0x38/0x80
             [<ffffffff810361a2>] irq_exit+0x45/0x47
             [<ffffffff81018fb3>] smp_apic_timer_interrupt+0x88/0x96
             [<ffffffff81002893>] apic_timer_interrupt+0x13/0x20
             [<ffffffff810011ac>] cpu_idle+0x4d/0x83
             [<ffffffff813e06f3>] start_secondary+0x1bd/0x1c1
      
      other info that might help us debug this:
      
      1 lock held by swapper/0:
       #0:  (&call->resend_timer){+.-...}, at: [<ffffffff8103b675>] run_timer_softirq+0x182/0x2a5
      
      stack backtrace:
      Pid: 0, comm: swapper Not tainted 2.6.35-rc3-cachefs+ #115
      Call Trace:
       <IRQ>  [<ffffffff81054414>] print_circular_bug+0xae/0xbd
       [<ffffffff81055237>] validate_chain+0x727/0xd23
       [<ffffffff810560bc>] __lock_acquire+0x889/0x8fa
       [<ffffffff810539a7>] ? mark_lock+0x42f/0x51f
       [<ffffffff81056184>] lock_acquire+0x57/0x6d
       [<ffffffffa00200d4>] ? rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]
       [<ffffffff813e6b69>] _raw_read_lock_bh+0x34/0x43
       [<ffffffffa00200d4>] ? rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]
       [<ffffffffa00200d4>] rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]
       [<ffffffff8103b6e6>] run_timer_softirq+0x1f3/0x2a5
       [<ffffffff8103b675>] ? run_timer_softirq+0x182/0x2a5
       [<ffffffffa002007e>] ? rxrpc_resend_time_expired+0x0/0x96 [af_rxrpc]
       [<ffffffff810367ef>] ? __do_softirq+0x69/0x13e
       [<ffffffff81036828>] __do_softirq+0xa2/0x13e
       [<ffffffff81002dcc>] call_softirq+0x1c/0x28
       [<ffffffff810049f0>] do_softirq+0x38/0x80
       [<ffffffff810361a2>] irq_exit+0x45/0x47
       [<ffffffff81018fb3>] smp_apic_timer_interrupt+0x88/0x96
       [<ffffffff81002893>] apic_timer_interrupt+0x13/0x20
       <EOI>  [<ffffffff81049de1>] ? __atomic_notifier_call_chain+0x0/0x86
       [<ffffffff8100955b>] ? mwait_idle+0x6e/0x78
       [<ffffffff81009552>] ? mwait_idle+0x65/0x78
       [<ffffffff810011ac>] cpu_idle+0x4d/0x83
       [<ffffffff813e06f3>] start_secondary+0x1bd/0x1c1
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3b5bac2b
    • C
      sch_sfq: add sanity check for the packet length · f2f00981
      Changli Gao 提交于
      The packet length should be checked before the packet data is dereferenced.
      Signed-off-by: NChangli Gao <xiaosuo@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f2f00981
    • C
      cls_rsvp: add sanity check for the packet length · 12dc96d1
      Changli Gao 提交于
      The packet length should be checked before the packet data is dereferenced.
      Signed-off-by: NChangli Gao <xiaosuo@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      12dc96d1
    • C
      cls_flow: add sanity check for the packet length · 4b95c3d4
      Changli Gao 提交于
      The packet length should be checked before the packet data is dereferenced.
      Signed-off-by: NChangli Gao <xiaosuo@gmail.com>
      Acked-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4b95c3d4
    • C
      act_nat: fix on the TX path · 36d12690
      Changli Gao 提交于
      On the TX path, skb->data points to the ethernet header, not the network
      header. So when validating the packet length for accessing we should
      take the ethernet header into account.
      Signed-off-by: NChangli Gao <xiaosuo@gmail.com>
      Acked-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      36d12690
    • J
      mac80211: Fix compilation warning when CONFIG_INET is not set · 93c08c32
      Juuso Oikarinen 提交于
      The warning is:
        net/mac80211/main.c:688: warning: label ‘fail_ifa’ defined but not used
      Signed-off-by: NJuuso Oikarinen <juuso.oikarinen@nokia.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      93c08c32
    • J
      mac80211: fix scan locking wrt. hw scan · 1601b1e5
      Johannes Berg 提交于
      Releasing the scan mutex while starting scans
      can lead to unexpected things happening, so
      we shouldn't do that. Fix that and hold the
      mutex across the scan triggering.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      1601b1e5
  5. 04 8月, 2010 2 次提交
  6. 03 8月, 2010 19 次提交
    • O
      can-raw: Fix skb_orphan_try handling · cff0d6e6
      Oliver Hartkopp 提交于
      Commit fc6055a5 (net: Introduce
      skb_orphan_try()) allows an early orphan of the skb and takes care on
      tx timestamping, which needs the sk-reference in the skb on driver level.
      So does the can-raw socket, which has not been taken into account here.
      
      The patch below adds a 'prevent_sk_orphan' bit in the skb tx shared info,
      which fixes the problem discovered by Matthias Fuchs here:
      
            http://marc.info/?t=128030411900003&r=1&w=2
      
      Even if it's not a primary tx timestamp topic it fits well into some skb
      shared tx context. Or should be find a different place for the information to
      protect the sk reference until it reaches the driver level?
      Signed-off-by: NOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cff0d6e6
    • D
      Revert "net: remove zap_completion_queue" · 3578b0c8
      David S. Miller 提交于
      This reverts commit 15e83ed7.
      
      As explained by Johannes Berg, the optimization made here is
      invalid.  Or, at best, incomplete.
      
      Not only destructor invocation, but conntract entry releasing
      must be executed outside of hw IRQ context.
      
      So just checking "skb->destructor" is insufficient.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3578b0c8
    • C
      net: cleanup inclusion · a427615e
      Changli Gao 提交于
      Commit ab95bfe0 replaces bridge and macvlan
      hooks in __netif_receive_skb(), so dev.c doesn't need to include their headers.
      Signed-off-by: NChangli Gao <xiaosuo@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a427615e
    • S
      u32: negative offset fix · 66d50d25
      stephen hemminger 提交于
      It was possible to use a negative offset in a u32 match to reference
      the ethernet header or other parts of the link layer header.
      This fixes the regression caused by:
      
      commit fbc2e7d9
      Author: Changli Gao <xiaosuo@gmail.com>
      Date:   Wed Jun 2 07:32:42 2010 -0700
      
          cls_u32: use skb_header_pointer() to dereference data safely
      Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      66d50d25
    • C
      ip_fragment: fix subtracting PPPOE_SES_HLEN from mtu twice · c893b806
      Changli Gao 提交于
      6c79bf0f subtracts PPPOE_SES_HLEN from mtu at
      the front of ip_fragment(). So the later subtraction should be removed. The
      MTU of 802.1q is also 1500, so MTU should not be changed.
      Signed-off-by: NChangli Gao <xiaosuo@gmail.com>
      Signed-off-by: NBart De Schuymer <bdschuym@pandora.bo>
      ----
       net/ipv4/ip_output.c |    6 ++----
       1 file changed, 2 insertions(+), 4 deletions(-)
      Signed-off-by: NBart De Schuymer <bdschuym@pandora.bo>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c893b806
    • J
      net: Add getsockopt support for TCP thin-streams · 3c0fef0b
      Josh Hunt 提交于
      Initial TCP thin-stream commit did not add getsockopt support for the new
      socket options: TCP_THIN_LINEAR_TIMEOUTS and TCP_THIN_DUPACK. This adds support
      for them.
      Signed-off-by: NJosh Hunt <johunt@akamai.com>
      Tested-by: NAndreas Petlund <apetlund@simula.no>
      Acked-by: NAndreas Petlund <apetlund@simula.no>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3c0fef0b
    • A
      fs/9p: destroy fid on failed remove · 0b1208b1
      Aneesh Kumar K.V 提交于
      9P spec says:
      "It is correct to consider remove to be a clunk with the
      side effect of removing the file if permissions allow. "
      
      So even if remove fails we need to destroy the fid.
      
      Without this patch an rmdir on a directory with contents leave
      the new cloned directory fid fid attached to fidlist. On umount
      we dump the fids on the fidlist
      
      ~# rmdir /mnt2/test4/
      rmdir: failed to remove `/mnt2/test4/': Directory not empty
      ~# umount /mnt2/
      ~# dmesg
      [  228.474323] Found fid 3 not clunked
      Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: NVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
      0b1208b1
    • A
      net/9p: Implement TXATTRCREATE 9p call · eda25e46
      Aneesh Kumar K.V 提交于
      TXATTRCREATE:  Prepare a fid for setting xattr value on a file system object.
      
       size[4] TXATTRCREATE tag[2] fid[4] name[s] attr_size[8] flags[4]
       size[4] RXATTRCREATE tag[2]
      
      txattrcreate gets a fid pointing to xattr. This fid can later be
      used to set the xattr value.
      
      flag value is derived from set Linux setxattr. The manpage says
      "The flags parameter can be used to refine the semantics of the operation.
      XATTR_CREATE specifies a pure create, which fails if the named attribute
      exists already. XATTR_REPLACE specifies a pure replace operation, which
      fails if the named attribute does not already exist. By default (no flags),
      the extended attribute will be created if need be, or will simply replace
      the value if the attribute exists."
      
      The actual setxattr operation happens when the fid is clunked. At that point
      the written byte count and the attr_size specified in TXATTRCREATE should be
      same otherwise an error will be returned.
      Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: NVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
      eda25e46
    • A
      net/9p: Implement attrwalk 9p call · 0ef63f34
      Aneesh Kumar K.V 提交于
      TXATTRWALK: Descend a ATTR namespace
      
       size[4] TXATTRWALK tag[2] fid[4] newfid[4] name[s]
       size[4] RXATTRWALK tag[2] size[8]
      
      txattrwalk gets a fid pointing to xattr. This fid can later be
      used to read the xattr value. If name is NULL the fid returned
      can be used to get the list of extended attribute associated to
      the file system object.
      Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: NVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
      0ef63f34
    • M
      9p: Implement LOPEN · ef56547e
      M. Mohan Kumar 提交于
      Implement 9p2000.L version of open(LOPEN) interface in 9p client.
      
      For LOPEN, no need to convert the flags to and from 9p mode to VFS mode.
      
      Synopsis:
      
          size[4] Tlopen tag[2] fid[4] mode[4]
      
          size[4] Rlopen tag[2] qid[13] iounit[4]
      
      [Fix mode bit format - jvrao@linux.vnet.ibm.com]
      Signed-off-by: NM. Mohan Kumar <mohan@in.ibm.com>
      Signed-off-by: NVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      Signed-off-by: NEric Van Hensbegren <ericvh@gmail.com>
      ef56547e
    • V
      fs/9p: This patch implements TLCREATE for 9p2000.L protocol. · 5643135a
      Venkateswararao Jujjuri (JV) 提交于
      SYNOPSIS
      
          size[4] Tlcreate tag[2] fid[4] name[s] flags[4] mode[4] gid[4]
      
          size[4] Rlcreate tag[2] qid[13] iounit[4]
      
      DESCRIPTION
      
      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: NVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
      5643135a
    • M
      9p: Implement TMKDIR · 01a622bd
      M. Mohan Kumar 提交于
      Implement TMKDIR as part of 2000.L Work
      
      Synopsis
      
          size[4] Tmkdir tag[2] fid[4] name[s] mode[4] gid[4]
      
          size[4] Rmkdir tag[2] qid[13]
      
      Description
      
          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: NM. Mohan Kumar <mohan@in.ibm.com>
      Signed-off-by: NVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
      01a622bd
    • M
      9p: Implement TMKNOD · 4b43516a
      M. Mohan Kumar 提交于
      Synopsis
      
          size[4] Tmknod tag[2] fid[4] name[s] mode[4] major[4] minor[4] gid[4]
      
          size[4] Rmknod tag[2] qid[13]
      
      Description
      
          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: NM. Mohan Kumar <mohan@in.ibm.com>
      Signed-off-by: NVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
      4b43516a
    • V
      9p: Define and implement TSYMLINK for 9P2000.L · 50cc42ff
      Venkateswararao Jujjuri (JV) 提交于
      Create a symbolic link
      
      SYNOPSIS
      
      size[4] Tsymlink tag[2] fid[4] name[s] symtgt[s] gid[4]
      
      size[4] Rsymlink tag[2] qid[13]
      
      DESCRIPTION
      
      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: NVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      Reviewed-by: NSripathi Kodi <sripathik@in.ibm.com>
      Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
      50cc42ff
    • V
      9p: Define and implement TLINK for 9P2000.L · 652df9a7
      Venkateswararao Jujjuri (JV) 提交于
      This patch adds a helper function to get the dentry from inode and
      uses it in creating a Hardlink
      
      SYNOPSIS
      
      size[4] Tlink tag[2] dfid[4] oldfid[4] newpath[s]
      
      size[4] Rlink tag[2]
      
      DESCRIPTION
      
      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: NVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
      652df9a7
    • S
      9p: Implement client side of setattr for 9P2000.L protocol. · 87d7845a
      Sripathi Kodi 提交于
          SYNOPSIS
      
            size[4] Tsetattr tag[2] attr[n]
      
            size[4] Rsetattr tag[2]
      
          DESCRIPTION
      
            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:
      
               valid[4]
                  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.
      
               mode[4]
                  File permission bits
      
               uid[4]
                  Owner id of file
      
               gid[4]
                  Group id of the file
      
               size[8]
                  File size
      
               atime_sec[8]
                  Time of last file access, seconds
      
               atime_nsec[8]
                  Time of last file access, nanoseconds
      
               mtime_sec[8]
                  Time of last file modification, seconds
      
               mtime_nsec[8]
                  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: NSripathi Kodi <sripathik@in.ibm.com>
      Signed-off-by: NVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
      87d7845a
    • S
      9p: getattr client implementation for 9P2000.L protocol. · f0853122
      Sripathi Kodi 提交于
              SYNOPSIS
      
                    size[4] Tgetattr tag[2] fid[4] request_mask[8]
      
                    size[4] Rgetattr tag[2] lstat[n]
      
                 DESCRIPTION
      
                    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:
      
                       st_result_mask[8]
                          Bit mask that indicates which fields in the stat structure
                          have been populated by the server
      
                       qid.type[1]
                          the type of the file (directory, etc.), represented as a bit
                          vector corresponding to the high 8 bits of the file's mode
                          word.
      
                       qid.vers[4]
                          version number for given path
      
                       qid.path[8]
                          the file server's unique identification for the file
      
                       st_mode[4]
                          Permission and flags
      
                       st_uid[4]
                          User id of owner
      
                       st_gid[4]
                          Group ID of owner
      
                       st_nlink[8]
                          Number of hard links
      
                       st_rdev[8]
                          Device ID (if special file)
      
                       st_size[8]
                          Size, in bytes
      
                       st_blksize[8]
                          Block size for file system IO
      
                       st_blocks[8]
                          Number of file system blocks allocated
      
                       st_atime_sec[8]
                          Time of last access, seconds
      
                       st_atime_nsec[8]
                          Time of last access, nanoseconds
      
                       st_mtime_sec[8]
                          Time of last modification, seconds
      
                       st_mtime_nsec[8]
                          Time of last modification, nanoseconds
      
                       st_ctime_sec[8]
                          Time of last status change, seconds
      
                       st_ctime_nsec[8]
                          Time of last status change, nanoseconds
      
                       st_btime_sec[8]
                          Time of creation (birth) of file, seconds
      
                       st_btime_nsec[8]
                          Time of creation (birth) of file, nanoseconds
      
                       st_gen[8]
                          Inode generation
      
                       st_data_version[8]
                          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
              differences:
      
              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
              include/asm-generic/stat.h
      
              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: NSripathi Kodi <sripathik@in.ibm.com>
      Signed-off-by: NEric Van Hensbegren <ericvh@gmail.com>
      f0853122
    • A
      net/9p: Handle the server returned error properly · 69d4b443
      Aneesh Kumar K.V 提交于
      We need to get the negative errno value in the kernel
      even for dotl.
      Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
      69d4b443
    • S
      9p: readdir implementation for 9p2000.L · 7751bdb3
      Sripathi Kodi 提交于
      This patch implements the kernel part of readdir() implementation for 9p2000.L
      
          Change from V3: Instead of inode, server now sends qids for each dirent
      
          SYNOPSIS
      
          size[4] Treaddir tag[2] fid[4] offset[8] count[4]
          size[4] Rreaddir tag[2] count[4] data[count]
      
          DESCRIPTION
      
          The readdir request asks the server to read the directory specified by 'fid'
          at an offset specified by 'offset' and return as many dirent structures as
          possible that fit into count bytes. Each dirent structure is laid out as
          follows.
      
                  qid.type[1]
                    the type of the file (directory, etc.), represented as a bit
                    vector corresponding to the high 8 bits of the file's mode
                    word.
      
                  qid.vers[4]
                    version number for given path
      
                  qid.path[8]
                    the file server's unique identification for the file
      
                  offset[8]
                    offset into the next dirent.
      
                  type[1]
                    type of this directory entry.
      
                  name[256]
                    name of this directory entry.
      
          This patch adds v9fs_dir_readdir_dotl() as the readdir() call for 9p2000.L.
          This function sends P9_TREADDIR command to the server. In response the server
          sends a buffer filled with dirent structures. This is different from the
          existing v9fs_dir_readdir() call which receives stat structures from the server.
          This results in significant speedup of readdir() on large directories.
          For example, doing 'ls >/dev/null' on a directory with 10000 files on my
          laptop takes 1.088 seconds with the existing code, but only takes 0.339 seconds
          with the new readdir.
      Signed-off-by: NSripathi Kodi <sripathik@in.ibm.com>
      Reviewed-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
      7751bdb3
  7. 02 8月, 2010 5 次提交