configfs: implement binary attributes
[cascardo/linux.git] / fs / configfs / configfs_internal.h
index b65d1ef..ccc31fa 100644 (file)
@@ -53,13 +53,14 @@ struct configfs_dirent {
 #define CONFIGFS_ROOT          0x0001
 #define CONFIGFS_DIR           0x0002
 #define CONFIGFS_ITEM_ATTR     0x0004
+#define CONFIGFS_ITEM_BIN_ATTR 0x0008
 #define CONFIGFS_ITEM_LINK     0x0020
 #define CONFIGFS_USET_DIR      0x0040
 #define CONFIGFS_USET_DEFAULT  0x0080
 #define CONFIGFS_USET_DROPPING 0x0100
 #define CONFIGFS_USET_IN_MKDIR 0x0200
 #define CONFIGFS_USET_CREATING 0x0400
-#define CONFIGFS_NOT_PINNED    (CONFIGFS_ITEM_ATTR)
+#define CONFIGFS_NOT_PINNED    (CONFIGFS_ITEM_ATTR | CONFIGFS_ITEM_BIN_ATTR)
 
 extern struct mutex configfs_symlink_mutex;
 extern spinlock_t configfs_dirent_lock;
@@ -72,6 +73,8 @@ extern struct inode * configfs_new_inode(umode_t mode, struct configfs_dirent *,
 extern int configfs_create(struct dentry *, umode_t mode, void (*init)(struct inode *));
 
 extern int configfs_create_file(struct config_item *, const struct configfs_attribute *);
+extern int configfs_create_bin_file(struct config_item *,
+                                   const struct configfs_bin_attribute *);
 extern int configfs_make_dirent(struct configfs_dirent *,
                                struct dentry *, void *, umode_t, int);
 extern int configfs_dirent_is_ready(struct configfs_dirent *);
@@ -88,7 +91,7 @@ extern void configfs_release_fs(void);
 extern struct rw_semaphore configfs_rename_sem;
 extern const struct file_operations configfs_dir_operations;
 extern const struct file_operations configfs_file_operations;
-extern const struct file_operations bin_fops;
+extern const struct file_operations configfs_bin_file_operations;
 extern const struct inode_operations configfs_dir_inode_operations;
 extern const struct inode_operations configfs_root_inode_operations;
 extern const struct inode_operations configfs_symlink_inode_operations;
@@ -119,6 +122,13 @@ static inline struct configfs_attribute * to_attr(struct dentry * dentry)
        return ((struct configfs_attribute *) sd->s_element);
 }
 
+static inline struct configfs_bin_attribute *to_bin_attr(struct dentry *dentry)
+{
+       struct configfs_attribute *attr = to_attr(dentry);
+
+       return container_of(attr, struct configfs_bin_attribute, cb_attr);
+}
+
 static inline struct config_item *configfs_get_config_item(struct dentry *dentry)
 {
        struct config_item * item = NULL;