split odf.h into two .h files, odf.h and odf_internals.h
authorYiannis Pericleous <yiannos@loki.fsl.cs.sunysb.edu>
Wed, 30 May 2007 02:14:30 +0000 (22:14 -0400)
committerRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Thu, 1 May 2008 23:02:44 +0000 (19:02 -0400)
fs/unionfs/odf.c
fs/unionfs/odf.h
fs/unionfs/odf_internals.h [new file with mode: 0644]

index 603b849a8b035791c3f426d49ef89d5ee65a1b53..8d46e9b55dc65c3ec8b962aa7d7986c3d10a28ee 100644 (file)
@@ -1,4 +1,5 @@
 #include "union.h"
+#include "odf_internals.h"
 
 /* Create a directory in odf
  * Fails if the directory already exists
index fcbffe620dbbda4c7346bda216055d4378e7c7e3..2a38f33123d9e47c55b75e0edc8e7238a5983d80 100644 (file)
@@ -1,24 +1,6 @@
 #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);
 
@@ -80,23 +52,13 @@ int odf_copyup_link(struct super_block *sb, struct dentry *old_dentry, struct de
 
 /* 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_ */
diff --git a/fs/unionfs/odf_internals.h b/fs/unionfs/odf_internals.h
new file mode 100644 (file)
index 0000000..4cd2931
--- /dev/null
@@ -0,0 +1,52 @@
+#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