[Ocfs2-commits] mfasheh commits r1131 - trunk/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Thu Jun 17 18:04:17 CDT 2004
Author: mfasheh
Date: 2004-06-17 17:04:15 -0500 (Thu, 17 Jun 2004)
New Revision: 1131
Modified:
trunk/src/alloc.c
trunk/src/file.c
Log:
* remove the last two fe copies in the code. this is no longer needed.
Modified: trunk/src/alloc.c
===================================================================
--- trunk/src/alloc.c 2004-06-17 22:03:36 UTC (rev 1130)
+++ trunk/src/alloc.c 2004-06-17 22:04:15 UTC (rev 1131)
@@ -866,23 +866,12 @@
struct buffer_head **bhs = NULL;
int numbhs = 0;
void *buf;
- ocfs2_dinode *fe = NULL, *real_fe = NULL;
+ ocfs2_dinode *fe = NULL;
LOG_ENTRY_ARGS("(0x%p, 0x%p, %llu, %u\n", osb, fe, blkno,
new_clusters);
- /* too complicated to deal with both reads and writes to the structure */
- /* just save off a copy and replace the fe_bh with the new data at the end */
-#warning markflar, fix the fe copy
- fe = kmalloc(osb->sb->s_blocksize, GFP_NOFS);
- if (fe == NULL) {
- LOG_ERROR_STATUS (status = -ENOMEM);
- goto finally;
- }
- real_fe = OCFS_BH_GET_DATA_READ(fe_bh);
- memcpy(fe, real_fe, osb->sb->s_blocksize);
- OCFS_BH_PUT_DATA(fe_bh);
- real_fe = NULL;
+ fe = (ocfs2_dinode *) fe_bh->b_data;
fel = &fe->id2.i_list;
numbhs = fel->l_tree_depth + 2;
@@ -1130,13 +1119,6 @@
finally:
- if (fe) {
- real_fe = OCFS_BH_GET_DATA_WRITE(fe_bh);
- memcpy(real_fe, fe, osb->sb->s_blocksize);
- OCFS_BH_PUT_DATA(fe_bh);
- real_fe = NULL;
- kfree(fe);
- }
#warning Leaking bhs here
LOG_EXIT_STATUS (status);
return (status);
Modified: trunk/src/file.c
===================================================================
--- trunk/src/file.c 2004-06-17 22:03:36 UTC (rev 1130)
+++ trunk/src/file.c 2004-06-17 22:04:15 UTC (rev 1131)
@@ -425,22 +425,10 @@
ocfs2_extent_list *el;
struct buffer_head *eb_bh = NULL;
ocfs2_dinode *fe = NULL;
- void *tmp;
LOG_ENTRY ();
-
- /* get a copy of fe, used readonly in this path and */
- /* ocfs_create_new_oin will deadlock if fe_bh is locked */
-#warning markflar, fix the fe copy
- fe = kmalloc(osb->sb->s_blocksize, GFP_NOFS);
- if (fe == NULL) {
- LOG_ERROR_STATUS(ret = -ENOMEM);
- goto leave;
- }
- tmp = OCFS_BH_GET_DATA_READ(fe_bh);
- memcpy(fe, tmp, osb->sb->s_blocksize);
- OCFS_BH_PUT_DATA(fe_bh);
+ fe = (ocfs2_dinode *) fe_bh->b_data;
tempoff = fe->i_blkno << osb->sb->s_blocksize_bits;
#warning I think we DO want extent map stuff for dirs now
@@ -520,10 +508,6 @@
}
leave:
- /* this fe was a copy */
- if (fe)
- kfree(fe);
-
if (eb_bh) {
if (eb)
OCFS_BH_PUT_DATA(eb_bh);
More information about the Ocfs2-commits
mailing list