]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ocfs2/ocfs2.h
Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh64-2.6
[linux-2.6-omap-h63xx.git] / fs / ocfs2 / ocfs2.h
index 82cc92dcf8a6c54237c1ed45097cb87e5b3fa494..58307853fb4a5be7100405d720f720202bcec6f6 100644 (file)
@@ -219,6 +219,7 @@ struct ocfs2_super
        u16 max_slots;
        s16 node_num;
        s16 slot_num;
+       s16 preferred_slot;
        int s_sectsize_bits;
        int s_clustersize;
        int s_clustersize_bits;
@@ -305,6 +306,19 @@ static inline int ocfs2_sparse_alloc(struct ocfs2_super *osb)
        return 0;
 }
 
+static inline int ocfs2_writes_unwritten_extents(struct ocfs2_super *osb)
+{
+       /*
+        * Support for sparse files is a pre-requisite
+        */
+       if (!ocfs2_sparse_alloc(osb))
+               return 0;
+
+       if (osb->s_feature_ro_compat & OCFS2_FEATURE_RO_COMPAT_UNWRITTEN)
+               return 1;
+       return 0;
+}
+
 /* set / clear functions because cluster events can make these happen
  * in parallel so we want the transitions to be atomic. this also
  * means that any future flags osb_flags must be protected by spinlock
@@ -363,9 +377,9 @@ static inline int ocfs2_mount_local(struct ocfs2_super *osb)
        typeof(__di) ____di = (__di);                                   \
        ocfs2_error((__sb),                                             \
                "Dinode # %llu has bad signature %.*s",                 \
-               (unsigned long long)(____di)->i_blkno, 7,               \
+               (unsigned long long)le64_to_cpu((____di)->i_blkno), 7,  \
                (____di)->i_signature);                                 \
-} while (0);
+} while (0)
 
 #define OCFS2_IS_VALID_EXTENT_BLOCK(ptr)                               \
        (!strcmp((ptr)->h_signature, OCFS2_EXTENT_BLOCK_SIGNATURE))
@@ -374,9 +388,9 @@ static inline int ocfs2_mount_local(struct ocfs2_super *osb)
        typeof(__eb) ____eb = (__eb);                                   \
        ocfs2_error((__sb),                                             \
                "Extent Block # %llu has bad signature %.*s",           \
-               (unsigned long long)(____eb)->h_blkno, 7,               \
+               (unsigned long long)le64_to_cpu((____eb)->h_blkno), 7,  \
                (____eb)->h_signature);                                 \
-} while (0);
+} while (0)
 
 #define OCFS2_IS_VALID_GROUP_DESC(ptr)                                 \
        (!strcmp((ptr)->bg_signature, OCFS2_GROUP_DESC_SIGNATURE))
@@ -385,9 +399,9 @@ static inline int ocfs2_mount_local(struct ocfs2_super *osb)
        typeof(__gd) ____gd = (__gd);                                   \
                ocfs2_error((__sb),                                     \
                "Group Descriptor # %llu has bad signature %.*s",       \
-               (unsigned long long)(____gd)->bg_blkno, 7,              \
+               (unsigned long long)le64_to_cpu((____gd)->bg_blkno), 7, \
                (____gd)->bg_signature);                                \
-} while (0);
+} while (0)
 
 static inline unsigned long ino_from_blkno(struct super_block *sb,
                                           u64 blkno)
@@ -480,16 +494,16 @@ static inline unsigned int ocfs2_page_index_to_clusters(struct super_block *sb,
 /*
  * Find the 1st page index which covers the given clusters.
  */
-static inline unsigned long ocfs2_align_clusters_to_page_index(struct super_block *sb,
+static inline pgoff_t ocfs2_align_clusters_to_page_index(struct super_block *sb,
                                                        u32 clusters)
 {
        unsigned int cbits = OCFS2_SB(sb)->s_clustersize_bits;
-       unsigned long index = clusters;
+        pgoff_t index = clusters;
 
        if (PAGE_CACHE_SHIFT > cbits) {
-               index = clusters >> (PAGE_CACHE_SHIFT - cbits);
+               index = (pgoff_t)clusters >> (PAGE_CACHE_SHIFT - cbits);
        } else if (PAGE_CACHE_SHIFT < cbits) {
-               index = clusters << (cbits - PAGE_CACHE_SHIFT);
+               index = (pgoff_t)clusters << (cbits - PAGE_CACHE_SHIFT);
        }
 
        return index;