#ifndef _ODF_H_
#define _ODF_H_
-#define UUID_LEN 16
-#define ODF_VERSION 2
-
-/* odf special filenames/dirnames */
-#define ODF_SB "sb" /* odf superblock file (/odf/sb) */
-#define ODF_IC "ic" /* inode cache dir (/odf/ic) */
-#define ODF_RC "reclaim" /* reclaim dir (/odf/reclaim) */
-#define ODF_NS "ns" /* namespace dir (/odf/ns) */
-#define ODF_SR "sr" /* sily rename dir (/odf/sr) */
-#define ODF_WH "whiteout" /* the file whiteouts are linked to */
-#define ODF_CONTENT "content" /* name of cached dirs file in /odf/ic */
-#define ODF_CONTENT_LEN (sizeof(ODF_CONTENT) - 1)
-
-/* Some string constants */
-#define ODF_BRANCH_PATH PAGE_SIZE
-#define ODF_OPTIONS_LEN PAGE_SIZE
-#define ODF_INAME_LEN 17
-
/* Lookup flags */
#define ODF_LOOKUP_RMV_WH 0x01
#define ODF_LOOKUP_FILE 0x02
#define ODF_RMV_NOTWH 2
#define ODF_RMV_ANY (ODF_RMV_WH|ODF_RMV_NOTWH)
-#define ODF_DIRENT_MAGIC 0x0DFD1300
-
/* cleanup thread flags */
#define ODF_CLEAN_DEFAULT 0x01
#define ODF_CLEAN_SR 0x02
#define ODF_CLEAN_FULL 0x04
-/* Options flags */
-#define ODF_OPT_KEEPCACHE 0x01
-#define ODF_OPT_DIRS 0x02
+#define ODF_CONTENT "content" /* name of cached dirs file in /odf/ic */
+#define ODF_CONTENT_LEN (sizeof(ODF_CONTENT) - 1)
+
/* super */
int odf_read_super(struct super_block *sb, char *data);
void odf_put_super(struct odf_sb_info *osi);
-int odf_is_new(struct odf_sb_info *osi);
char *odf_read_sb_data(struct odf_sb_info *odf_sb, int **bid);
int odf_write_sb_data(struct odf_sb_info* osi, struct unionfs_data *data,
- struct path *lower_paths, int branches);
-int odf_parse_options(const char *options, char **odf_path);
+ struct path *lower_paths, int branches);
+int odf_is_new(struct odf_sb_info *osi);
int odf_update_uuids(struct odf_sb_info *odf, struct path *old_paths, int old_branches,
struct path *new_paths, int new_branches);
-static inline char *odf_get_branch_uuid(struct odf_sb_info *odf, int branch)
-{
- return (odf->branch_uuids + UUID_LEN * branch);
-}
/* lookup */
int odf_lookup(struct dentry *parent, struct dentry *dentry, int flags);
-struct dentry *__odf_lookup(struct dentry *parent, struct dentry *target,
- const char *name, int len, int flags, struct dentry *link);
struct dentry *odf_lookup_name(struct dentry *parent, const char *name, int len, int flags);
-struct dentry* odf_getdir(struct dentry *d_odf, const char *name, int len);
/* dirents & dir cache */
struct dentry *odf_ic_cache_dentry(struct dentry *dir);
-struct dentry *odf_ic_dentry(struct odf_sb_info *osi, u64 ino, char *name, int namelen);
int odf_write_dirent(struct file *filp, const char *name, int namelen, u64 ino, unsigned int d_type);
int odf_read_dirent(struct file *filp, char **name, int *namelen, u64 *ino, unsigned int *d_type);
int odf_purge_dir_cache(struct dentry *dentry);
int odf_cache_dir(struct dentry *d_upper, struct dentry *d_odf, struct timespec *mtime);
int odf_release_sr(struct inode *inode);
+/* various i-ops */
int odf_rename(struct dentry *old_dentry, struct dentry *new_dentry);
int odf_link(struct dentry *old_dentry, struct dentry *new_dentry);
/* unlink */
int odf_remove(struct dentry *dentry, int flags);
-int odf_reclaim(struct dentry *dentry, int sr);
/* whiteouts */
int odf_create_wh(struct dentry *dentry);
-static inline int __odf_is_wh(struct odf_sb_info *osi, struct dentry *dentry)
-{
- return osi->whiteout->d_inode->i_ino == dentry->d_inode->i_ino;
-}
/* opaque */
int odf_get_opaque(struct super_block *sb, struct dentry *dentry);
-int odf_set_opaque(struct dentry *odf_dentry, int branch);
-/* cleanup thread functions */
extern void __odf_cleanup(void *args);
-int odf_cleanup(struct odf_sb_info *odf, int mode, u64 b_to_free, u64 i_to_free);
-
-extern void generate_random_uuid(unsigned char uuid_out[16]);
#endif /* _ODF_H_ */
--- /dev/null
+#ifndef _ODF_INTERNALS_H_
+#define _ODF_INTERNALS_H_
+
+#define UUID_LEN 16
+#define ODF_VERSION 2
+
+/* odf special filenames/dirnames */
+#define ODF_SB "sb" /* odf superblock file (/odf/sb) */
+#define ODF_IC "ic" /* inode cache dir (/odf/ic) */
+#define ODF_RC "reclaim" /* reclaim dir (/odf/reclaim) */
+#define ODF_NS "ns" /* namespace dir (/odf/ns) */
+#define ODF_SR "sr" /* sily rename dir (/odf/sr) */
+#define ODF_WH "whiteout" /* the file whiteouts are linked to */
+
+/* Some string constants */
+#define ODF_BRANCH_PATH PAGE_SIZE
+#define ODF_OPTIONS_LEN PAGE_SIZE
+#define ODF_INAME_LEN 17
+
+#define ODF_DIRENT_MAGIC 0x0DFD1300
+
+/* Options flags */
+#define ODF_OPT_KEEPCACHE 0x01
+#define ODF_OPT_DIRS 0x02
+
+int odf_parse_options(const char *options, char **odf_path);
+static inline char *odf_get_branch_uuid(struct odf_sb_info *odf, int branch)
+{
+ return (odf->branch_uuids + UUID_LEN * branch);
+}
+
+struct dentry *__odf_lookup(struct dentry *parent, struct dentry *target,
+ const char *name, int len, int flags,
+ struct dentry *link);
+struct dentry* odf_getdir(struct dentry *d_odf, const char *name, int len);
+
+struct dentry *odf_ic_dentry(struct odf_sb_info *osi, u64 ino,
+ char *name, int namelen);
+int odf_reclaim(struct dentry *dentry, int sr);
+
+static inline int __odf_is_wh(struct odf_sb_info *osi, struct dentry *dentry)
+{
+ return osi->whiteout->d_inode->i_ino == dentry->d_inode->i_ino;
+}
+int odf_set_opaque(struct dentry *odf_dentry, int branch);
+
+/* cleanup thread functions */
+int odf_cleanup(struct odf_sb_info *odf, int mode, u64 b_to_free, u64 i_to_free);
+
+extern void generate_random_uuid(unsigned char uuid_out[16]);
+
+#endif