]> git.baikalelectronics.ru Git - kernel.git/commit
cachefiles: Provide a function to check how much space there is
authorDavid Howells <dhowells@redhat.com>
Thu, 21 Oct 2021 07:59:46 +0000 (08:59 +0100)
committerDavid Howells <dhowells@redhat.com>
Fri, 7 Jan 2022 13:41:26 +0000 (13:41 +0000)
commit908a6baab501ea60ce8b32dbf9cb0d67cdf75ba7
tree23e578a123ba44c3564fbb66b5f94f4f0454f4e4
parent71bb4ad20f0ee6012a5a3113ffb8d6e3956c6d33
cachefiles: Provide a function to check how much space there is

Provide a function to check how much space there is.  This also flips the
state on the cache and will signal the daemon to inform it of the change
and to ask it to do some culling if necessary.

We will also need to subtract the amount of data currently being written to
the cache (cache->b_writing) from the amount of available space to avoid
hitting ENOSPC accidentally.

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
cc: linux-cachefs@redhat.com
Link: https://lore.kernel.org/r/163819629322.215744.13457425294680841213.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/163906930100.143852.1681026700865762069.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/163967140058.1823006.7781243664702837128.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/164021539957.640689.12477177372616805706.stgit@warthog.procyon.org.uk/
fs/cachefiles/Makefile
fs/cachefiles/cache.c [new file with mode: 0644]
fs/cachefiles/daemon.c
fs/cachefiles/internal.h