[Ocfs2-commits] jlbec commits r1035 - branches/format-changes/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Jun 9 06:24:51 CDT 2004
Author: jlbec
Date: 2004-06-09 05:24:49 -0500 (Wed, 09 Jun 2004)
New Revision: 1035
Modified:
branches/format-changes/src/alloc.c
branches/format-changes/src/dlm.c
branches/format-changes/src/journal.c
branches/format-changes/src/nm.c
branches/format-changes/src/ocfs.h
branches/format-changes/src/proc.c
branches/format-changes/src/super.c
branches/format-changes/src/volcfg.c
branches/format-changes/src/vote.c
Log:
o ocfs_safefree is an ex-parrot.
Modified: branches/format-changes/src/alloc.c
===================================================================
--- branches/format-changes/src/alloc.c 2004-06-09 09:58:00 UTC (rev 1034)
+++ branches/format-changes/src/alloc.c 2004-06-09 10:24:49 UTC (rev 1035)
@@ -159,7 +159,7 @@
if (tmpstat)
status = tmpstat;
list_del(&(log->log_list));
- ocfs_safefree(log);
+ kfree(log);
f->num_logs--;
}
@@ -437,6 +437,7 @@
ocfs_commit_trans(handle);
handle = NULL;
+
abort:
if (handle)
ocfs_abort_trans(handle);
@@ -470,12 +471,16 @@
finally:
- for (i = 0; i < osb->max_nodes; i++) {
- if (extnode_inode[i]) {
- up(&OCFS_I(extnode_inode[i])->ip_io_sem);
- iput(extnode_inode[i]);
+ if (extnode_inode) {
+ for (i = 0; i < osb->max_nodes; i++) {
+ if (extnode_inode[i]) {
+ up(&OCFS_I(extnode_inode[i])->ip_io_sem);
+ iput(extnode_inode[i]);
+ }
}
+ kfree(extnode_inode);
}
+
if (vol_inode) {
up(&OCFS_I(vol_inode)->ip_io_sem);
iput(vol_inode);
@@ -484,16 +489,17 @@
if (globalbh)
brelse(globalbh);
- for (i = 0; i < osb->max_nodes; i++) {
- ocfs_safefree (free_ext_node[i]);
+ if (free_ext_node) {
+ for (i = 0; i < osb->max_nodes; i++) {
+ if (free_ext_node[i])
+ kfree(free_ext_node[i]);
+ }
+ kfree(free_ext_node);
}
- ocfs_safefree (free_ext_node);
-
- ocfs_safefree (extnode_inode);
+ if (free_vol_bits)
+ kfree(free_vol_bits);
- ocfs_safefree (free_vol_bits);
-
LOG_EXIT_STATUS (status);
return status;
} /* ocfs_free_disk_bitmap */
Modified: branches/format-changes/src/dlm.c
===================================================================
--- branches/format-changes/src/dlm.c 2004-06-09 09:58:00 UTC (rev 1034)
+++ branches/format-changes/src/dlm.c 2004-06-09 10:24:49 UTC (rev 1035)
@@ -199,7 +199,7 @@
if (bhs != NULL) {
for (i = 0; i < numnodes; i++)
brelse(bhs[i]);
- ocfs_safefree(bhs);
+ kfree(bhs);
}
if (status >= 0) {
@@ -446,7 +446,7 @@
if (bhs != NULL) {
for (i=0; i < numnodes; i++)
brelse(bhs[i]);
- ocfs_safefree(bhs);
+ kfree(bhs);
}
LOG_EXIT_STATUS (status);
return (status);
Modified: branches/format-changes/src/journal.c
===================================================================
--- branches/format-changes/src/journal.c 2004-06-09 09:58:00 UTC (rev 1034)
+++ branches/format-changes/src/journal.c 2004-06-09 10:24:49 UTC (rev 1035)
@@ -184,8 +184,8 @@
if (retval) {
if (retval->buffs)
- ocfs_safefree(retval->buffs);
- ocfs_safefree(retval);
+ kfree(retval->buffs);
+ kfree(retval);
}
LOG_EXIT_PTR(NULL);
return(NULL);
Modified: branches/format-changes/src/nm.c
===================================================================
--- branches/format-changes/src/nm.c 2004-06-09 09:58:00 UTC (rev 1034)
+++ branches/format-changes/src/nm.c 2004-06-09 10:24:49 UTC (rev 1035)
@@ -119,7 +119,7 @@
status = ocfs_recv_udp_msg (recv_ctxt);
if (status < 0) {
- ocfs_safefree (recv_ctxt);
+ kfree(recv_ctxt);
if (status != -EBADF) {
LOG_ERROR_STATUS (status);
} else {
Modified: branches/format-changes/src/ocfs.h
===================================================================
--- branches/format-changes/src/ocfs.h 2004-06-09 09:58:00 UTC (rev 1034)
+++ branches/format-changes/src/ocfs.h 2004-06-09 10:24:49 UTC (rev 1035)
@@ -122,12 +122,6 @@
/* convenience macro */
-#define ocfs_safefree(x) \
-do { \
- if (x) \
- kfree(x); \
- (x) = NULL; \
-} while (0)
#define OCFS_ASSERT(x) do { if (!(x)) BUG(); } while (0)
@@ -1651,15 +1645,14 @@
ocfs_free_rec *log;
struct list_head *p, *n;
- if ((f) && ((f)->num_logs)) {
- list_for_each_safe(p, n, &((f)->free_logs)) {
+ if (f && (f->num_logs)) {
+ list_for_each_safe(p, n, &(f->free_logs)) {
log = list_entry(p, ocfs_free_rec, log_list);
list_del(&(log->log_list));
kfree(log);
}
+ kfree(f);
}
- ocfs_safefree((f));
- return;
}
static inline unsigned int ocfs_clusters_for_bytes(struct super_block *sb,
Modified: branches/format-changes/src/proc.c
===================================================================
--- branches/format-changes/src/proc.c 2004-06-09 09:58:00 UTC (rev 1034)
+++ branches/format-changes/src/proc.c 2004-06-09 10:24:49 UTC (rev 1035)
@@ -406,8 +406,10 @@
}
bail:
- ocfs_safefree (tmp);
- ocfs_safefree (newdir);
+ if (tmp)
+ kfree(tmp);
+ if (newdir)
+ kfree(newdir);
LOG_EXIT ();
return;
} /* ocfs_proc_add_volume */
@@ -438,7 +440,8 @@
remove_proc_entry (tmp, NULL);
bail:
- ocfs_safefree (tmp);
+ if (tmp)
+ kfree(tmp);
LOG_EXIT ();
return;
} /* ocfs_proc_remove_volume */
@@ -520,7 +523,8 @@
ret = ocfs_proc_calc_metrics (page, start, off, count, eof, len);
bail:
- ocfs_safefree (pubmap);
+ if (pubmap)
+ kfree(pubmap);
LOG_EXIT_INT (ret);
return ret;
} /* ocfs_proc_statistics */
Modified: branches/format-changes/src/super.c
===================================================================
--- branches/format-changes/src/super.c 2004-06-09 09:58:00 UTC (rev 1034)
+++ branches/format-changes/src/super.c 2004-06-09 10:24:49 UTC (rev 1035)
@@ -1128,13 +1128,14 @@
BARF_BARF_BARF *p;
p = osb->node_cfg_info[i];
- ocfs_safefree (p);
+ if (p)
+ kfree(p);
}
ocfs_release_system_inodes(osb);
ocfs_delete_osb (osb);
- ocfs_safefree (osb);
+ kfree(osb);
sb->s_dev = 0;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
@@ -1297,13 +1298,13 @@
/* FIXME: before getting started, this MUST be set */
osb->max_nodes = 32; // noNONONO!
- /* FIXME
- * This should be done in ocfs_journal_init(), but unknown
- * ordering issues will cause the filesystem to crash.
- * If anyone wants to figure out what part of the code
- * refers to osb->journal before ocfs_journal_init() is run,
- * be my guest.
- */
+ /* FIXME
+ * This should be done in ocfs_journal_init(), but unknown
+ * ordering issues will cause the filesystem to crash.
+ * If anyone wants to figure out what part of the code
+ * refers to osb->journal before ocfs_journal_init() is run,
+ * be my guest.
+ */
/* initialize our journal structure */
osb->journal = kmalloc(sizeof(ocfs_journal), GFP_KERNEL);
if (!osb->journal) {
@@ -1437,7 +1438,7 @@
/* get some pseudo constants for >> bits */
osb->sect_size_bits = ocfs_get_right_shift_bits(sect_size);
- osb->s_clustersize = vol_layout->cluster_size;
+ osb->s_clustersize = vol_layout->cluster_size;
osb->s_clustersize_bits = ocfs_get_right_shift_bits(vol_layout->cluster_size);
osb->dir_alloc_bits = ocfs_get_right_shift_bits(vol_layout->dir_node_size);
osb->file_alloc_bits = ocfs_get_right_shift_bits(vol_layout->file_node_size);
@@ -1493,14 +1494,14 @@
}
publish = OCFS_BH_GET_DATA_WRITE(publish_bh);
- /*
- * FIXME: This really ought to be something exported by the
- * identical code in heartbeat.c
- */
+ /*
+ * FIXME: This really ought to be something exported by the
+ * identical code in heartbeat.c
+ */
publish->time = jiffies;
- /* Disallow 0 */
- if (!publish->time)
- publish->time = 1;
+ /* Disallow 0 */
+ if (!publish->time)
+ publish->time = 1;
OCFS_BH_PUT_DATA(publish_bh);
publish = NULL;
@@ -1763,12 +1764,12 @@
if (osb->node_cfg_info)
kfree(osb->node_cfg_info);
- /* FIXME
- * This belongs in journal shutdown, but because we have to
- * allocate osb->journal at the start of ocfs_initalize_osb(),
- * we free it here.
- */
- kfree(osb->journal);
+ /* FIXME
+ * This belongs in journal shutdown, but because we have to
+ * allocate osb->journal at the start of ocfs_initalize_osb(),
+ * we free it here.
+ */
+ kfree(osb->journal);
memset (osb, 0, sizeof (ocfs_super));
Modified: branches/format-changes/src/volcfg.c
===================================================================
--- branches/format-changes/src/volcfg.c 2004-06-09 09:58:00 UTC (rev 1034)
+++ branches/format-changes/src/volcfg.c 2004-06-09 10:24:49 UTC (rev 1035)
@@ -465,7 +465,8 @@
finito:
ocfs_release_disk_lock (osb, lock_off);
- ocfs_safefree (cfg_task);
+ if (cfg_task)
+ kfree(cfg_task);
if (bh)
brelse(bh);
@@ -589,7 +590,8 @@
}
bail:
- ocfs_safefree (buffer);
+ if (buffer)
+ kfree(buffer);
LOG_EXIT_STATUS (status);
return status;
@@ -883,7 +885,7 @@
for (i = 0; i < numblocks; i++)
if (cfg_bhs[i])
brelse(cfg_bhs[i]);
- ocfs_safefree(cfg_bhs);
+ kfree(cfg_bhs);
}
LOG_EXIT_STATUS (status);
@@ -1015,7 +1017,8 @@
}
bail:
- ocfs_safefree(buffer);
+ if (buffer)
+ kfree(buffer);
LOG_EXIT_STATUS (status);
return status;
} /* ocfs_refresh_node_config */
Modified: branches/format-changes/src/vote.c
===================================================================
--- branches/format-changes/src/vote.c 2004-06-09 09:58:00 UTC (rev 1034)
+++ branches/format-changes/src/vote.c 2004-06-09 10:24:49 UTC (rev 1035)
@@ -68,7 +68,7 @@
{
spin_lock(&vote_obj_lock);
if (atomic_dec_and_test(&obj->refcount))
- ocfs_safefree (obj);
+ kfree(obj);
spin_unlock(&vote_obj_lock);
}
@@ -636,7 +636,7 @@
ocfs_comm_process_msg (dlm_packet);
}
- ocfs_safefree (recv_ctxt);
+ kfree(recv_ctxt);
LOG_EXIT ();
return;
More information about the Ocfs2-commits
mailing list