Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7c08d70c69150148c14f02633855f1591219c37c
Commit:     7c08d70c69150148c14f02633855f1591219c37c
Parent:     a00cce356b5592208e761525a48a25902322cce9
Author:     Mark Fasheh <[EMAIL PROTECTED]>
AuthorDate: Fri Jul 20 11:58:36 2007 -0700
Committer:  Mark Fasheh <[EMAIL PROTECTED]>
CommitDate: Thu Aug 9 17:25:27 2007 -0700

    ocfs2: Fix some casting errors related to file writes
    
    ocfs2_align_clusters_to_page_index() needs to cast the clusters shift to
    pgoff_t and ocfs2_file_buffered_write() needs loff_t when calculating
    destination start for memcpy.
    
    Signed-off-by: Mark Fasheh <[EMAIL PROTECTED]>
---
 fs/ocfs2/file.c  |    2 +-
 fs/ocfs2/ocfs2.h |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 7e508e2..b1ae4c7 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1959,7 +1959,7 @@ static ssize_t ocfs2_file_buffered_write(struct file 
*file, loff_t *ppos,
                }
 
                dst = kmap_atomic(page, KM_USER0);
-               memcpy(dst + (pos & (PAGE_CACHE_SIZE - 1)), buf, bytes);
+               memcpy(dst + (pos & (loff_t)(PAGE_CACHE_SIZE - 1)), buf, bytes);
                kunmap_atomic(dst, KM_USER0);
                flush_dcache_page(page);
                ocfs2_put_write_source(user_page);
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
index 5cc90a4..5830785 100644
--- a/fs/ocfs2/ocfs2.h
+++ b/fs/ocfs2/ocfs2.h
@@ -494,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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to