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: Implement simple cookie state machine · 5d00e426
    David Howells authored Oct 20, 2021
    
    
    Implement a very simple cookie state machine to handle lookup,
    invalidation, withdrawal, relinquishment and, to be added later, commit on
    LRU discard.
    
    Three cache methods are provided: ->lookup_cookie() to look up and, if
    necessary, create a data storage object; ->withdraw_cookie() to free the
    resources associated with that object and potentially delete it; and
    ->prepare_to_write(), to do prepare for changes to the cached data to be
    modified locally.
    
    Changes
    =======
    ver #3:
     - Fix a race between LRU discard and relinquishment whereby the former
       would override the latter and thus the latter would never happen[1].
    
    ver #2:
     - Don't hold n_accesses elevated whilst cache is bound to a cookie, but
       rather add a flag that prevents the state machine from being queued when
       n_accesses reaches 0.
    
    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/599331.1639410068@warthog.procyon.org.uk/ [1]
    Link: https://lore.kernel.org/r/163819599657.215744.15799615296912341745.stgit@warthog.procyon.org.uk/ # v1
    Link: https://lore.kernel.org/r/163906903925.143852.1805855338154353867.stgit@warthog.procyon.org.uk/ # v2
    Link: https://lore.kernel.org/r/163967105456.1823006.14730395299835841776.stgit@warthog.procyon.org.uk/ # v3
    Link: https://lore.kernel.org/r/164021510706.640689.7961423370243272583.stgit@warthog.procyon.org.uk/ # v4
    5d00e426
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7