1. 04 May, 2017 3 commits
  2. 20 Feb, 2017 2 commits
    • Jeff Layton's avatar
      ceph: add a new flag to indicate whether parent is locked · 3dd69aab
      Jeff Layton authored
      struct ceph_mds_request has an r_locked_dir pointer, which is set to
      indicate the parent inode and that its i_rwsem is locked.  In some
      critical places, we need to be able to indicate the parent inode to the
      request handling code, even when its i_rwsem may not be locked.
      
      Most of the code that operates on r_locked_dir doesn't require that the
      i_rwsem be locked. We only really need it to handle manipulation of the
      dcache. The rest (filling of the inode, updating dentry leases, etc.)
      already has its own locking.
      
      Add a new r_req_flags bit that indicates whether the parent is locked
      when doing the request, and rename the pointer to "r_parent". For now,
      all the places that set r_parent also set this flag, but that will
      change in a later patch.
      Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
      Reviewed-by: default avatarYan, Zheng <zyan@redhat.com>
      Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
      3dd69aab
    • Jeff Layton's avatar
      ceph: convert bools in ceph_mds_request to a new r_req_flags field · bc2de10d
      Jeff Layton authored
      Currently, we have a bunch of bool flags in struct ceph_mds_request. We
      need more flags though, but each bool takes (at least) a byte. Those
      add up over time.
      
      Merge all of the existing bools in this struct into a single unsigned
      long, and use the set/test/clear_bit macros to manipulate them. These
      are atomic operations, but that is required here to prevent
      load/modify/store races. The existing flags are protected by different
      locks, so we can't rely on them for that purpose.
      Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
      Reviewed-by: default avatarYan, Zheng <zyan@redhat.com>
      Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
      bc2de10d
  3. 03 Oct, 2016 1 commit
  4. 28 Jul, 2016 6 commits
  5. 25 May, 2016 4 commits
  6. 04 Apr, 2016 1 commit
    • Kirill A. Shutemov's avatar
      mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros · 09cbfeaf
      Kirill A. Shutemov authored
      PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
      ago with promise that one day it will be possible to implement page
      cache with bigger chunks than PAGE_SIZE.
      
      This promise never materialized.  And unlikely will.
      
      We have many places where PAGE_CACHE_SIZE assumed to be equal to
      PAGE_SIZE.  And it's constant source of confusion on whether
      PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
      especially on the border between fs and mm.
      
      Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
      breakage to be doable.
      
      Let's stop pretending that pages in page cache are special.  They are
      not.
      
      The changes are pretty straight-forward:
      
       - <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};
      
       - page_cache_get() -> get_page();
      
       - page_cache_release() -> put_page();
      
      This patch contains automated changes generated with coccinelle using
      script below.  For some reason, coccinelle doesn't patch header files.
      I've called spatch for them manually.
      
      The only adjustment after coccinelle is revert of changes to
      PAGE_CAHCE_ALIGN definition: we are going to drop it later.
      
      There are few places in the code where coccinelle didn't reach.  I'll
      fix them manually in a separate patch.  Comments and documentation also
      will be addressed with the separate patch.
      
      virtual patch
      
      @@
      expression E;
      @@
      - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      expression E;
      @@
      - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      @@
      - PAGE_CACHE_SHIFT
      + PAGE_SHIFT
      
      @@
      @@
      - PAGE_CACHE_SIZE
      + PAGE_SIZE
      
      @@
      @@
      - PAGE_CACHE_MASK
      + PAGE_MASK
      
      @@
      expression E;
      @@
      - PAGE_CACHE_ALIGN(E)
      + PAGE_ALIGN(E)
      
      @@
      expression E;
      @@
      - page_cache_get(E)
      + get_page(E)
      
      @@
      expression E;
      @@
      - page_cache_release(E)
      + put_page(E)
      Signed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      09cbfeaf
  7. 04 Mar, 2016 1 commit
  8. 02 Nov, 2015 1 commit
  9. 08 Sep, 2015 1 commit
  10. 25 Jun, 2015 8 commits
    • Yan, Zheng's avatar
      ceph: rework dcache readdir · fdd4e158
      Yan, Zheng authored
      Previously our dcache readdir code relies on that child dentries in
      directory dentry's d_subdir list are sorted by dentry's offset in
      descending order. When adding dentries to the dcache, if a dentry
      already exists, our readdir code moves it to head of directory
      dentry's d_subdir list. This design relies on dcache internals.
      Al Viro suggests using ncpfs's approach: keeping array of pointers
      to dentries in page cache of directory inode. the validity of those
      pointers are presented by directory inode's complete and ordered
      flags. When a dentry gets pruned, we clear directory inode's complete
      flag in the d_prune() callback. Before moving a dentry to other
      directory, we clear the ordered flag for both old and new directory.
      Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
      fdd4e158
    • Yan, Zheng's avatar
      ceph: track pending caps flushing globally · 8310b089
      Yan, Zheng authored
      So we know TID of the oldest pending caps flushing. Later patch will
      send this information to MDS, so that MDS can trim its completed caps
      flush list.
      
      Tracking pending caps flushing globally also simplifies syncfs code.
      Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
      8310b089
    • Yan, Zheng's avatar
      ceph: track pending caps flushing accurately · 553adfd9
      Yan, Zheng authored
      Previously we do not trace accurate TID for flushing caps. when
      MDS failovers, we have no choice but to re-send all flushing caps
      with a new TID. This can cause problem because MDS can has already
      flushed some caps and has issued the same caps to other client.
      The re-sent cap flush has a new TID, which makes MDS unable to
      detect if it has already processed the cap flush.
      
      This patch adds code to track pending caps flushing accurately.
      When re-sending cap flush is needed, we use its original flush
      TID.
      Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
      553adfd9
    • Ilya Dryomov's avatar
      libceph: store timeouts in jiffies, verify user input · a319bf56
      Ilya Dryomov authored
      There are currently three libceph-level timeouts that the user can
      specify on mount: mount_timeout, osd_idle_ttl and osdkeepalive.  All of
      these are in seconds and no checking is done on user input: negative
      values are accepted, we multiply them all by HZ which may or may not
      overflow, arbitrarily large jiffies then get added together, etc.
      
      There is also a bug in the way mount_timeout=0 is handled.  It's
      supposed to mean "infinite timeout", but that's not how wait.h APIs
      treat it and so __ceph_open_session() for example will busy loop
      without much chance of being interrupted if none of ceph-mons are
      there.
      
      Fix all this by verifying user input, storing timeouts capped by
      msecs_to_jiffies() in jiffies and using the new ceph_timeout_jiffies()
      helper for all user-specified waits to handle infinite timeouts
      correctly.
      Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
      Reviewed-by: default avatarAlex Elder <elder@linaro.org>
      a319bf56
    • Yan, Zheng's avatar
      ceph: exclude setfilelock requests when calculating oldest tid · e8a7b8b1
      Yan, Zheng authored
      setfilelock requests can block for a long time, which can prevent
      client from advancing its oldest tid.
      Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
      e8a7b8b1
    • Yan, Zheng's avatar
      ceph: don't pre-allocate space for cap release messages · 745a8e3b
      Yan, Zheng authored
      Previously we pre-allocate cap release messages for each caps. This
      wastes lots of memory when there are large amount of caps. This patch
      make the code not pre-allocate the cap release messages. Instead,
      we add the corresponding ceph_cap struct to a list when releasing a
      cap. Later when flush cap releases is needed, we allocate the cap
      release messages dynamically.
      Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
      745a8e3b
    • Yan, Zheng's avatar
      ceph: make sure syncfs flushes all cap snaps · affbc19a
      Yan, Zheng authored
      Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
      affbc19a
    • Yan, Zheng's avatar
      ceph: check OSD caps before read/write · 10183a69
      Yan, Zheng authored
      Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
      10183a69
  11. 19 Feb, 2015 2 commits
  12. 17 Dec, 2014 3 commits
  13. 14 Oct, 2014 2 commits
  14. 06 Jun, 2014 1 commit
    • Sage Weil's avatar
      ceph: include time stamp in every MDS request · b8e69066
      Sage Weil authored
      We recently modified the client/MDS protocol to include a timestamp in the
      client request.  This allows ctime updates to follow the client's clock
      in most cases, which avoids subtle problems when clocks are out of sync
      and timestamps are updated sometimes by the MDS clock (for most requests)
      and sometimes by the client clock (for cap writeback).
      Signed-off-by: default avatarSage Weil <sage@inktank.com>
      b8e69066
  15. 05 Apr, 2014 1 commit
  16. 21 Jan, 2014 1 commit
  17. 23 Nov, 2013 1 commit
  18. 12 Feb, 2013 1 commit