12 #include <linux/module.h>
14 #include <linux/sched.h>
16 #include <linux/slab.h>
22 #include <linux/ctype.h>
32 _enter(
"{%u,%u,%u,%u,%u,%u},%s",
53 kerror(
"'bind' command doesn't take an argument");
58 kerror(
"No cache directory specified");
64 kerror(
"Cache already bound");
78 return cachefiles_daemon_add_cache(cache);
90 const struct cred *saved_cred;
100 cachefiles_begin_secure(cache, &saved_cred);
107 goto error_root_object;
114 _debug(
"- fsdef %p", fsdef);
119 goto error_open_root;
128 !root->
d_inode->i_op->lookup ||
130 !root->
d_inode->i_op->setxattr ||
131 !root->
d_inode->i_op->getxattr ||
132 !root->
d_sb->s_op->statfs ||
133 !root->
d_sb->s_op->sync_fs)
134 goto error_unsupported;
138 goto error_unsupported;
144 goto error_unsupported;
149 goto error_unsupported;
152 if (
stats.f_bsize <= 0)
153 goto error_unsupported;
157 goto error_unsupported;
164 _debug(
"blksize %u (shift %u)",
167 _debug(
"size %llu, avail %llu",
168 (
unsigned long long)
stats.f_blocks,
169 (
unsigned long long)
stats.f_bavail);
177 _debug(
"limits {%llu,%llu,%llu} files",
178 (
unsigned long long) cache->
frun,
179 (
unsigned long long) cache->
fcull,
180 (
unsigned long long) cache->
fstop);
188 _debug(
"limits {%llu,%llu,%llu} blocks",
189 (
unsigned long long) cache->
brun,
190 (
unsigned long long) cache->
bcull,
191 (
unsigned long long) cache->
bstop);
195 if (IS_ERR(cachedir)) {
196 ret = PTR_ERR(cachedir);
197 goto error_unsupported;
205 goto error_unsupported;
209 if (IS_ERR(graveyard)) {
210 ret = PTR_ERR(graveyard);
211 goto error_unsupported;
220 fsdef->
dentry->d_sb->s_id);
226 goto error_add_cache;
233 " File cache on %s registered\n",
234 cache->
cache.identifier);
238 cachefiles_end_secure(cache, saved_cred);
253 cachefiles_end_secure(cache, saved_cred);
254 kerror(
"Failed to register: %d", ret);
267 " File cache on %s unregistering\n",
268 cache->
cache.identifier);