Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • include
  • linux
  • fscache-cache.h
Find file BlameHistoryPermalink
  • David Howells's avatar
    fscache: Count data storage objects in a cache · cdf262f2
    David Howells authored Nov 11, 2021
    
    
    Count the data storage objects that are currently allocated in a cache.
    This is used to pin certain cache structures until cache withdrawal is
    complete.
    
    Three helpers are provided to manage and make use of the count:
    
     (1) void fscache_count_object(struct fscache_cache *cache);
    
         This should be called by the cache backend to note that an object has
         been allocated and attached to the cache.
    
     (2) void fscache_uncount_object(struct fscache_cache *cache);
    
         This should be called by the backend to note that an object has been
         destroyed.  This sends a wakeup event that allows cache withdrawal to
         proceed if it was waiting for that object.
    
     (3) void fscache_wait_for_objects(struct fscache_cache *cache);
    
         This can be used by the backend to wait for all outstanding cache
         object to be destroyed.
    
    Each cache's counter is displayed as part of /proc/fs/fscache/caches.
    
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
    cc: linux-cachefs@redhat.com
    Link: https://lore.kernel.org/r/163819608594.215744.1812706538117388252.stgit@warthog.procyon.org.uk/ # v1
    Link: https://lore.kernel.org/r/163906911646.143852.168184059935530127.stgit@warthog.procyon.org.uk/ # v2
    Link: https://lore.kernel.org/r/163967111846.1823006.9868154941573671255.stgit@warthog.procyon.org.uk/ # v3
    Link: https://lore.kernel.org/r/164021516219.640689.4934796654308958158.stgit@warthog.procyon.org.uk/ # v4
    cdf262f2
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7