Lines Matching refs:volume
14 * Allocate and set up a volume representation. We make sure all the fanout
19 struct cachefiles_volume *volume;
30 volume = kzalloc(sizeof(struct cachefiles_volume), GFP_KERNEL);
31 if (!volume)
33 volume->vcookie = vcookie;
34 volume->cache = cache;
35 INIT_LIST_HEAD(&volume->cache_link);
51 volume->dentry = vdentry;
54 if (!cachefiles_set_volume_xattr(volume))
57 ret = cachefiles_check_volume_xattr(volume);
64 cachefiles_put_directory(volume->dentry);
75 volume->fanout[i] = fan;
80 vcookie->cache_priv = volume;
87 list_add(&volume->cache_link, &volume->cache->volumes);
95 cachefiles_put_directory(volume->fanout[i]);
97 cachefiles_put_directory(volume->dentry);
101 kfree(volume);
106 * Release a volume representation.
108 static void __cachefiles_free_volume(struct cachefiles_volume *volume)
114 volume->vcookie->cache_priv = NULL;
117 cachefiles_put_directory(volume->fanout[i]);
118 cachefiles_put_directory(volume->dentry);
119 kfree(volume);
124 struct cachefiles_volume *volume = vcookie->cache_priv;
126 if (volume) {
127 spin_lock(&volume->cache->object_list_lock);
128 list_del_init(&volume->cache_link);
129 spin_unlock(&volume->cache->object_list_lock);
130 __cachefiles_free_volume(volume);
134 void cachefiles_withdraw_volume(struct cachefiles_volume *volume)
136 fscache_withdraw_volume(volume->vcookie);
137 cachefiles_set_volume_xattr(volume);
138 __cachefiles_free_volume(volume);