]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/ocfs2/aops.c
usb: use get/put_unaligned_* helpers
[mv-sheeva.git] / fs / ocfs2 / aops.c
index 286af3a11383903db4ae33fa1fccea328966896b..17964c0505a9785daa29a88f3086dcfab3ac2c1e 100644 (file)
@@ -217,7 +217,7 @@ int ocfs2_read_inline_data(struct inode *inode, struct page *page,
                           struct buffer_head *di_bh)
 {
        void *kaddr;
-       unsigned int size;
+       loff_t size;
        struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data;
 
        if (!(le16_to_cpu(di->i_dyn_features) & OCFS2_INLINE_DATA_FL)) {
@@ -231,8 +231,9 @@ int ocfs2_read_inline_data(struct inode *inode, struct page *page,
        if (size > PAGE_CACHE_SIZE ||
            size > ocfs2_max_inline_data(inode->i_sb)) {
                ocfs2_error(inode->i_sb,
-                           "Inode %llu has with inline data has bad size: %u",
-                           (unsigned long long)OCFS2_I(inode)->ip_blkno, size);
+                           "Inode %llu has with inline data has bad size: %Lu",
+                           (unsigned long long)OCFS2_I(inode)->ip_blkno,
+                           (unsigned long long)size);
                return -EROFS;
        }
 
@@ -256,7 +257,7 @@ static int ocfs2_readpage_inline(struct inode *inode, struct page *page)
        struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 
        BUG_ON(!PageLocked(page));
-       BUG_ON(!OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL);
+       BUG_ON(!(OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL));
 
        ret = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno, &di_bh,
                               OCFS2_BH_CACHED, inode);
@@ -306,7 +307,7 @@ static int ocfs2_readpage(struct file *file, struct page *page)
         * XXX sys_readahead() seems to get that wrong?
         */
        if (start >= i_size_read(inode)) {
-               zero_user_page(page, 0, PAGE_SIZE, KM_USER0);
+               zero_user(page, 0, PAGE_SIZE);
                SetPageUptodate(page);
                ret = 0;
                goto out_alloc;
@@ -466,11 +467,11 @@ handle_t *ocfs2_start_walk_page_trans(struct inode *inode,
                                                         unsigned to)
 {
        struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
-       handle_t *handle = NULL;
+       handle_t *handle;
        int ret = 0;
 
        handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
-       if (!handle) {
+       if (IS_ERR(handle)) {
                ret = -ENOMEM;
                mlog_errno(ret);
                goto out;
@@ -486,7 +487,7 @@ handle_t *ocfs2_start_walk_page_trans(struct inode *inode,
        }
 out:
        if (ret) {
-               if (handle)
+               if (!IS_ERR(handle))
                        ocfs2_commit_trans(osb, handle);
                handle = ERR_PTR(ret);
        }
@@ -868,7 +869,7 @@ int ocfs2_map_page_blocks(struct page *page, u64 *p_blkno,
                if (block_start >= to)
                        break;
 
-               zero_user_page(page, block_start, bh->b_size, KM_USER0);
+               zero_user(page, block_start, bh->b_size);
                set_buffer_uptodate(bh);
                mark_buffer_dirty(bh);
 
@@ -1033,7 +1034,7 @@ static void ocfs2_zero_new_buffers(struct page *page, unsigned from, unsigned to
                                        start = max(from, block_start);
                                        end = min(to, block_end);
 
-                                       zero_user_page(page, start, end - start, KM_USER0);
+                                       zero_user_segment(page, start, end);
                                        set_buffer_uptodate(bh);
                                }