]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ocfs2/inode.c
[IA64] eliminate NULL test and memset after alloc_bootmem
[linux-2.6-omap-h63xx.git] / fs / ocfs2 / inode.c
index 522297033945564e6301d18de1f3152c5b0c6cfb..7aa00d5118748f392251acf5b76605350eefcd98 100644 (file)
@@ -461,8 +461,8 @@ static int ocfs2_read_locked_inode(struct inode *inode,
        }
 
        if (can_lock)
-               status = ocfs2_read_block(osb, args->fi_blkno, &bh, 0,
-                                         inode);
+               status = ocfs2_read_blocks(inode, args->fi_blkno, 1, &bh,
+                                          OCFS2_BH_IGNORE_CACHE);
        else
                status = ocfs2_read_blocks_sync(osb, args->fi_blkno, 1, &bh);
        if (status < 0) {
@@ -1106,6 +1106,12 @@ void ocfs2_clear_inode(struct inode *inode)
        oi->ip_last_trans = 0;
        oi->ip_dir_start_lookup = 0;
        oi->ip_blkno = 0ULL;
+
+       /*
+        * ip_jinode is used to track txns against this inode. We ensure that
+        * the journal is flushed before journal shutdown. Thus it is safe to
+        * have inodes get cleaned up after journal shutdown.
+        */
        jbd2_journal_release_jbd_inode(OCFS2_SB(inode->i_sb)->journal->j_journal,
                                       &oi->ip_jinode);
 
@@ -1133,57 +1139,6 @@ void ocfs2_drop_inode(struct inode *inode)
        mlog_exit_void();
 }
 
-/*
- * TODO: this should probably be merged into ocfs2_get_block
- *
- * However, you now need to pay attention to the cont_prepare_write()
- * stuff in ocfs2_get_block (that is, ocfs2_get_block pretty much
- * expects never to extend).
- */
-struct buffer_head *ocfs2_bread(struct inode *inode,
-                               int block, int *err, int reada)
-{
-       struct buffer_head *bh = NULL;
-       int tmperr;
-       u64 p_blkno;
-       int readflags = OCFS2_BH_CACHED;
-
-       if (reada)
-               readflags |= OCFS2_BH_READAHEAD;
-
-       if (((u64)block << inode->i_sb->s_blocksize_bits) >=
-           i_size_read(inode)) {
-               BUG_ON(!reada);
-               return NULL;
-       }
-
-       down_read(&OCFS2_I(inode)->ip_alloc_sem);
-       tmperr = ocfs2_extent_map_get_blocks(inode, block, &p_blkno, NULL,
-                                            NULL);
-       up_read(&OCFS2_I(inode)->ip_alloc_sem);
-       if (tmperr < 0) {
-               mlog_errno(tmperr);
-               goto fail;
-       }
-
-       tmperr = ocfs2_read_block(OCFS2_SB(inode->i_sb), p_blkno, &bh,
-                                 readflags, inode);
-       if (tmperr < 0)
-               goto fail;
-
-       tmperr = 0;
-
-       *err = 0;
-       return bh;
-
-fail:
-       brelse(bh);
-       bh = NULL;
-
-       *err = -EIO;
-       return NULL;
-}
-
 /*
  * This is called from our getattr.
  */