This source file includes following definitions.
- fscache_fsdef_netfs_check_aux
1
2
3
4
5
6
7
8 #define FSCACHE_DEBUG_LEVEL CACHE
9 #include <linux/module.h>
10 #include "internal.h"
11
12 static
13 enum fscache_checkaux fscache_fsdef_netfs_check_aux(void *cookie_netfs_data,
14 const void *data,
15 uint16_t datalen,
16 loff_t object_size);
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 static struct fscache_cookie_def fscache_fsdef_index_def = {
43 .name = ".FS-Cache",
44 .type = FSCACHE_COOKIE_TYPE_INDEX,
45 };
46
47 struct fscache_cookie fscache_fsdef_index = {
48 .usage = ATOMIC_INIT(1),
49 .n_active = ATOMIC_INIT(1),
50 .lock = __SPIN_LOCK_UNLOCKED(fscache_fsdef_index.lock),
51 .backing_objects = HLIST_HEAD_INIT,
52 .def = &fscache_fsdef_index_def,
53 .flags = 1 << FSCACHE_COOKIE_ENABLED,
54 .type = FSCACHE_COOKIE_TYPE_INDEX,
55 };
56 EXPORT_SYMBOL(fscache_fsdef_index);
57
58
59
60
61
62
63 struct fscache_cookie_def fscache_fsdef_netfs_def = {
64 .name = "FSDEF.netfs",
65 .type = FSCACHE_COOKIE_TYPE_INDEX,
66 .check_aux = fscache_fsdef_netfs_check_aux,
67 };
68
69
70
71
72
73 static enum fscache_checkaux fscache_fsdef_netfs_check_aux(
74 void *cookie_netfs_data,
75 const void *data,
76 uint16_t datalen,
77 loff_t object_size)
78 {
79 struct fscache_netfs *netfs = cookie_netfs_data;
80 uint32_t version;
81
82 _enter("{%s},,%hu", netfs->name, datalen);
83
84 if (datalen != sizeof(version)) {
85 _leave(" = OBSOLETE [dl=%d v=%zu]", datalen, sizeof(version));
86 return FSCACHE_CHECKAUX_OBSOLETE;
87 }
88
89 memcpy(&version, data, sizeof(version));
90 if (version != netfs->version) {
91 _leave(" = OBSOLETE [ver=%x net=%x]", version, netfs->version);
92 return FSCACHE_CHECKAUX_OBSOLETE;
93 }
94
95 _leave(" = OKAY");
96 return FSCACHE_CHECKAUX_OKAY;
97 }