]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/ocfs2/file.c
ocfs2: pass ocfs2_super * into ocfs2_commit_trans()
[karo-tx-linux.git] / fs / ocfs2 / file.c
index 1be74c4e78148f4cd79df11a62c6796fc7b642e4..9eb60f21968dbf2b357ba882315fa12a3c3bbbc2 100644 (file)
@@ -178,7 +178,7 @@ static int ocfs2_simple_size_update(struct inode *inode,
        if (ret < 0)
                mlog_errno(ret);
 
-       ocfs2_commit_trans(handle);
+       ocfs2_commit_trans(osb, handle);
 out:
        return ret;
 }
@@ -207,7 +207,7 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb,
        if (status < 0)
                mlog_errno(status);
 
-       ocfs2_commit_trans(handle);
+       ocfs2_commit_trans(osb, handle);
 out:
        mlog_exit(status);
        return status;
@@ -463,13 +463,6 @@ restart_all:
             (unsigned long long)OCFS2_I(inode)->ip_blkno, i_size_read(inode),
             fe->i_clusters, clusters_to_add);
 
-       handle = ocfs2_alloc_handle(osb);
-       if (handle == NULL) {
-               status = -ENOMEM;
-               mlog_errno(status);
-               goto leave;
-       }
-
        num_free_extents = ocfs2_num_free_extents(osb,
                                                  inode,
                                                  fe);
@@ -480,10 +473,7 @@ restart_all:
        }
 
        if (!num_free_extents) {
-               status = ocfs2_reserve_new_metadata(osb,
-                                                   handle,
-                                                   fe,
-                                                   &meta_ac);
+               status = ocfs2_reserve_new_metadata(osb, fe, &meta_ac);
                if (status < 0) {
                        if (status != -ENOSPC)
                                mlog_errno(status);
@@ -491,10 +481,7 @@ restart_all:
                }
        }
 
-       status = ocfs2_reserve_clusters(osb,
-                                       handle,
-                                       clusters_to_add,
-                                       &data_ac);
+       status = ocfs2_reserve_clusters(osb, clusters_to_add, &data_ac);
        if (status < 0) {
                if (status != -ENOSPC)
                        mlog_errno(status);
@@ -509,7 +496,7 @@ restart_all:
        drop_alloc_sem = 1;
 
        credits = ocfs2_calc_extend_credits(osb->sb, fe, clusters_to_add);
-       handle = ocfs2_start_trans(osb, handle, credits);
+       handle = ocfs2_start_trans(osb, NULL, credits);
        if (IS_ERR(handle)) {
                status = PTR_ERR(handle);
                handle = NULL;
@@ -566,7 +553,7 @@ restarted_transaction:
                        credits = ocfs2_calc_extend_credits(osb->sb,
                                                            fe,
                                                            clusters_to_add);
-                       status = ocfs2_extend_trans(handle, credits);
+                       status = ocfs2_extend_trans(handle->k_handle, credits);
                        if (status < 0) {
                                /* handle still has to be committed at
                                 * this point. */
@@ -589,7 +576,7 @@ leave:
                drop_alloc_sem = 0;
        }
        if (handle) {
-               ocfs2_commit_trans(handle);
+               ocfs2_commit_trans(osb, handle);
                handle = NULL;
        }
        if (data_ac) {
@@ -668,7 +655,7 @@ static int ocfs2_write_zero_page(struct inode *inode,
                ret = 0;
 
        if (handle)
-               ocfs2_commit_trans(handle);
+               ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle);
 out_unlock:
        unlock_page(page);
        page_cache_release(page);
@@ -825,7 +812,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
                }
        }
 
-       status = ocfs2_meta_lock(inode, NULL, &bh, 1);
+       status = ocfs2_meta_lock(inode, &bh, 1);
        if (status < 0) {
                if (status != -ENOENT)
                        mlog_errno(status);
@@ -863,7 +850,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
                mlog_errno(status);
 
 bail_commit:
-       ocfs2_commit_trans(handle);
+       ocfs2_commit_trans(osb, handle);
 bail_unlock:
        ocfs2_meta_unlock(inode, 1);
 bail_unlock_rw:
@@ -951,7 +938,7 @@ static int ocfs2_write_remove_suid(struct inode *inode)
 out_bh:
        brelse(bh);
 out_trans:
-       ocfs2_commit_trans(handle);
+       ocfs2_commit_trans(osb, handle);
 out:
        mlog_exit(ret);
        return ret;
@@ -1019,7 +1006,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
         */
        meta_level = (filp->f_flags & O_APPEND) ? 1 : 0;
        for(;;) {
-               ret = ocfs2_meta_lock(inode, NULL, NULL, meta_level);
+               ret = ocfs2_meta_lock(inode, NULL, meta_level);
                if (ret < 0) {
                        meta_level = -1;
                        mlog_errno(ret);
@@ -1187,7 +1174,7 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
         * like i_size. This allows the checks down below
         * generic_file_aio_read() a chance of actually working. 
         */
-       ret = ocfs2_meta_lock(inode, NULL, NULL, 0);
+       ret = ocfs2_meta_lock(inode, NULL, 0);
        if (ret < 0) {
                mlog_errno(ret);
                goto bail;