Home Home > GIT Browse > SLE15-SP2-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bogendoerfer <tbogendoerfer@suse.de>2019-10-18 15:34:20 +0200
committerMichal Kubecek <mkubecek@suse.cz>2019-10-19 00:58:46 +0200
commite187b871bce272e68598f894bbf7d292df4b43ca (patch)
treee7c3b41675812a6bf155b88bb7d19749a3e2681e
parent41ff356f60ca7be8b37930fae64d677486e2735d (diff)
sunrpc: add a new cache_detail operation for when a cache is
flushed (bsc#1154353). suse-commit: e5fd081319a887d0c19db82f5f55eba724015b28
-rw-r--r--include/linux/sunrpc/cache.h1
-rw-r--r--net/sunrpc/cache.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index f7d086b77a21..f8603724fbee 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -87,6 +87,7 @@ struct cache_detail {
int has_died);
struct cache_head * (*alloc)(void);
+ void (*flush)(void);
int (*match)(struct cache_head *orig, struct cache_head *new);
void (*init)(struct cache_head *orig, struct cache_head *new);
void (*update)(struct cache_head *orig, struct cache_head *new);
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index a6a6190ad37a..a349094f6fb7 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -1524,6 +1524,9 @@ static ssize_t write_flush(struct file *file, const char __user *buf,
cd->nextcheck = now;
cache_flush();
+ if (cd->flush)
+ cd->flush();
+
*ppos += count;
return count;
}