aboutsummaryrefslogtreecommitdiffstats
path: root/fs/configfs/configfs_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/configfs/configfs_internal.h')
-rw-r--r--fs/configfs/configfs_internal.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/configfs/configfs_internal.h b/fs/configfs/configfs_internal.h
index f752d83a9c44..520f1813e789 100644
--- a/fs/configfs/configfs_internal.h
+++ b/fs/configfs/configfs_internal.h
@@ -20,6 +20,15 @@
20#include <linux/list.h> 20#include <linux/list.h>
21#include <linux/spinlock.h> 21#include <linux/spinlock.h>
22 22
23struct configfs_fragment {
24 atomic_t frag_count;
25 struct rw_semaphore frag_sem;
26 bool frag_dead;
27};
28
29void put_fragment(struct configfs_fragment *);
30struct configfs_fragment *get_fragment(struct configfs_fragment *);
31
23struct configfs_dirent { 32struct configfs_dirent {
24 atomic_t s_count; 33 atomic_t s_count;
25 int s_dependent_count; 34 int s_dependent_count;
@@ -34,6 +43,7 @@ struct configfs_dirent {
34#ifdef CONFIG_LOCKDEP 43#ifdef CONFIG_LOCKDEP
35 int s_depth; 44 int s_depth;
36#endif 45#endif
46 struct configfs_fragment *s_frag;
37}; 47};
38 48
39#define CONFIGFS_ROOT 0x0001 49#define CONFIGFS_ROOT 0x0001
@@ -61,8 +71,8 @@ extern int configfs_create(struct dentry *, umode_t mode, void (*init)(struct in
61extern int configfs_create_file(struct config_item *, const struct configfs_attribute *); 71extern int configfs_create_file(struct config_item *, const struct configfs_attribute *);
62extern int configfs_create_bin_file(struct config_item *, 72extern int configfs_create_bin_file(struct config_item *,
63 const struct configfs_bin_attribute *); 73 const struct configfs_bin_attribute *);
64extern int configfs_make_dirent(struct configfs_dirent *, 74extern int configfs_make_dirent(struct configfs_dirent *, struct dentry *,
65 struct dentry *, void *, umode_t, int); 75 void *, umode_t, int, struct configfs_fragment *);
66extern int configfs_dirent_is_ready(struct configfs_dirent *); 76extern int configfs_dirent_is_ready(struct configfs_dirent *);
67 77
68extern void configfs_hash_and_remove(struct dentry * dir, const char * name); 78extern void configfs_hash_and_remove(struct dentry * dir, const char * name);
@@ -137,6 +147,7 @@ static inline void release_configfs_dirent(struct configfs_dirent * sd)
137{ 147{
138 if (!(sd->s_type & CONFIGFS_ROOT)) { 148 if (!(sd->s_type & CONFIGFS_ROOT)) {
139 kfree(sd->s_iattr); 149 kfree(sd->s_iattr);
150 put_fragment(sd->s_frag);
140 kmem_cache_free(configfs_dir_cachep, sd); 151 kmem_cache_free(configfs_dir_cachep, sd);
141 } 152 }
142} 153}