[Ocfs2-commits] mfasheh commits r1555 - trunk/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Oct 7 16:47:00 CDT 2004


Author: mfasheh
Date: 2004-10-07 16:46:58 -0500 (Thu, 07 Oct 2004)
New Revision: 1555

Modified:
   trunk/src/alloc.c
   trunk/src/dlm.c
   trunk/src/extmap.c
   trunk/src/file.c
   trunk/src/journal.c
   trunk/src/localalloc.c
   trunk/src/namei.c
   trunk/src/nm.c
   trunk/src/ocfs.h
   trunk/src/super.c
   trunk/src/volcfg.c
   trunk/src/vote.c
Log:
* get rid of EFAIL and EWARNING.



Modified: trunk/src/alloc.c
===================================================================
--- trunk/src/alloc.c	2004-10-07 21:08:30 UTC (rev 1554)
+++ trunk/src/alloc.c	2004-10-07 21:46:58 UTC (rev 1555)
@@ -375,7 +375,7 @@
 
 			if (el2->l_next_free_rec == 0) {
 				brelse(bh);
-				LOG_ERROR_STATUS (status = -EFAIL);
+				LOG_ERROR_STATUS (status = -EINVAL);
 				goto finally;
 			}
 
@@ -1003,7 +1003,7 @@
 			}
 			
 			if (el2->l_next_free_rec == 0) {
-				LOG_ERROR_STATUS (status = -EFAIL);
+				LOG_ERROR_STATUS (status = -EINVAL);
 				goto finally;
 			}
 			
@@ -1074,7 +1074,7 @@
 		if (!ocfs_add_extent_map_entry(osb, &OCFS_I(inode)->ip_ext_map,
 					       Vbo, Lbo,
 					       (u64)new_clusters << osb->s_clustersize_bits))
-			LOG_ERROR_STATUS (status = -EFAIL);
+			LOG_ERROR_STATUS (status = -EINVAL);
 	}
 
 	/* Buffers are always null if they haven't been mapped and
@@ -1106,7 +1106,7 @@
 				__s64 *contig_bytes,
 				struct inode *inode, int locked)
 {
-	int status = -EFAIL;
+	int status;
 	ocfs2_dinode *fe = NULL;
 	struct buffer_head *fe_bh = NULL;
 	ocfs2_extent_block *eb = NULL;
@@ -1209,7 +1209,7 @@
 		LOG_ERROR_ARGS ("vbo=%llu, fe->i_clusters=%u ip_alloc_size=%llu", 
 				Vbo, fe->i_clusters,
 				OCFS_I(inode)->ip_alloc_size);
-		status = -EFAIL;
+		status = -EINVAL;
 		goto finally;
 	}
 
@@ -1260,7 +1260,7 @@
 						localVbo, 
 						OCFS_I(inode)->ip_alloc_size,
 						eb->h_blkno);
-					status = -EFAIL;
+					status = -EINVAL;
 					goto finally;
 				}
 
@@ -1299,7 +1299,7 @@
 	if (status && cnt >= (u64)bytecount)
 		status = 0;
 	else {
-		status = -EFAIL;
+		status = -EINVAL;
 		if (cnt == 0)
 			printk("failed to lookup extmap... vbo=%llu "
 			       "mapcount=%d, inode = %lu, alloc_size = %llu, "

Modified: trunk/src/dlm.c
===================================================================
--- trunk/src/dlm.c	2004-10-07 21:08:30 UTC (rev 1554)
+++ trunk/src/dlm.c	2004-10-07 21:46:58 UTC (rev 1555)
@@ -205,7 +205,7 @@
 int ocfs_acquire_lock (ocfs_super * osb, __u32 lock_type,
 		   __u32 flags, struct buffer_head **bh, struct inode *inode)
 {
-	int status = -EFAIL;
+	int status;
 	__u32 updated;
 	ocfs_lock_res *lockres = GET_INODE_LOCKRES(inode);
 	int k = 0;
@@ -723,7 +723,7 @@
 				atomic_inc (&stats->enoent);
 				break;
 			case -EBUSY:
-			case -EFAIL:
+			case -ENETUNREACH:
 			case FLAG_VOTE_OIN_ALREADY_INUSE:
 				atomic_inc (&stats->efail);
 				break;

Modified: trunk/src/extmap.c
===================================================================
--- trunk/src/extmap.c	2004-10-07 21:08:30 UTC (rev 1554)
+++ trunk/src/extmap.c	2004-10-07 21:46:58 UTC (rev 1555)
@@ -284,7 +284,7 @@
 	OCFS_ASSERT (map != NULL);
 
 	if (!map->initialized) {
-		LOG_ERROR_STATUS (-EFAIL);
+		LOG_ERROR_STATUS (-EINVAL);
 		goto bail;
 	}
 	spin_lock(&EM_IP(map)->ip_lock);
@@ -514,7 +514,7 @@
 			   void *Buffer, __s64 *localVbo,
 			   __u64 *remainingLength, ocfs_ext_flag Flag)
 {
-	int ret = -EFAIL;
+	int ret = -EINVAL;
 	ocfs2_dinode *fe;
 	ocfs2_extent_block *eb;
 	ocfs2_extent_list *el;

Modified: trunk/src/file.c
===================================================================
--- trunk/src/file.c	2004-10-07 21:08:30 UTC (rev 1554)
+++ trunk/src/file.c	2004-10-07 21:46:58 UTC (rev 1555)
@@ -323,7 +323,7 @@
 			
 			if (!IS_VALID_EXTENT_BLOCK(eb) ||
 			    el->l_tree_depth) {
-				LOG_ERROR_STATUS(ret = -EFAIL);
+				LOG_ERROR_STATUS(ret = -EINVAL);
 				goto leave;
 			}
 			
@@ -341,7 +341,7 @@
 			
 			if (eb->h_next_leaf_blk > 0) {
 				if (!eb->h_next_leaf_blk) {
-					LOG_ERROR_STATUS (ret = -EFAIL);
+					LOG_ERROR_STATUS (ret = -EINVAL);
 					goto leave;
 				}
 				next_leaf = eb->h_next_leaf_blk;
@@ -452,12 +452,7 @@
 
 	fe = (ocfs2_dinode *) bh->b_data;
 
-	if (!IS_VALID_FILE_ENTRY(fe)) {
-		LOG_ERROR_ARGS("Invalid fe at blkno %llu",
-			       OCFS_I(inode)->ip_blkno);
-		status = -EFAIL;
-		goto leave;
-	}
+	OCFS_ASSERT_RO(IS_VALID_FILE_ENTRY(fe));
 
 	status = ocfs_journal_access(handle, bh, OCFS_JOURNAL_ACCESS_WRITE);
 	if (status < 0) {
@@ -1512,7 +1507,6 @@
 		}
 	}
 
-	status = -EFAIL;
 	status = ocfs_change_file_attrib(osb, attr, inode);
 	if (status < 0) {
 		if (status != -EINTR)

Modified: trunk/src/journal.c
===================================================================
--- trunk/src/journal.c	2004-10-07 21:08:30 UTC (rev 1554)
+++ trunk/src/journal.c	2004-10-07 21:46:58 UTC (rev 1555)
@@ -1753,7 +1753,7 @@
 						      ORPHAN_DIR_SYSTEM_INODE, 
 						      -1);
 	if  (!orphan_dir_inode) {
-		status = -EFAIL;
+		status = -ENOENT;
 		LOG_ERROR_STATUS(status);
 		goto bail;
 	}

Modified: trunk/src/localalloc.c
===================================================================
--- trunk/src/localalloc.c	2004-10-07 21:08:30 UTC (rev 1554)
+++ trunk/src/localalloc.c	2004-10-07 21:46:58 UTC (rev 1555)
@@ -185,7 +185,7 @@
 			       LOCAL_ALLOC(alloc)->la_bits_set, 
 			       LOCAL_ALLOC(alloc)->la_bm_bits,
 			       LOCAL_ALLOC(alloc)->la_bm_off);
-		status = -EFAIL;
+		status = -EBUSY;
 		goto bail;
 	}
 

Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c	2004-10-07 21:08:30 UTC (rev 1554)
+++ trunk/src/namei.c	2004-10-07 21:46:58 UTC (rev 1555)
@@ -2075,7 +2075,7 @@
 						      ORPHAN_DIR_SYSTEM_INODE, 
 						      -1);
 	if (!orphan_dir_inode) {
-		status = -EFAIL;
+		status = -ENOENT;
 		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
@@ -2136,7 +2136,7 @@
 						      ORPHAN_DIR_SYSTEM_INODE, 
 						      -1);
 	if (!orphan_dir_inode) {
-		status = -EFAIL;
+		status = -ENOENT;
 		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
@@ -2205,7 +2205,7 @@
 
 	name = kmalloc(OCFS2_MAX_FILENAME_LENGTH+1, GFP_KERNEL);
 	if (!name) {
-		status = -EFAIL;
+		status = -ENOMEM;
 		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
@@ -2216,7 +2216,7 @@
 		if (namelen)
 			status = namelen;
 		else
-			status = -EFAIL;
+			status = -EINVAL;
 		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
@@ -2228,7 +2228,7 @@
 	target_de_bh = ocfs_find_entry(name, namelen, orphan_dir_inode, 
 				       &target_de);
 	if (!target_de_bh) {
-		status = -EFAIL;
+		status = -ENOENT;
 		LOG_ERROR_STATUS(status);
 		goto leave;
 	}

Modified: trunk/src/nm.c
===================================================================
--- trunk/src/nm.c	2004-10-07 21:08:30 UTC (rev 1554)
+++ trunk/src/nm.c	2004-10-07 21:46:58 UTC (rev 1555)
@@ -512,7 +512,7 @@
 	}
 
 	if (!inode) {
-		status = -EFAIL;
+		status = -ENOENT;
 		LOG_ERROR_ARGS("Could not find inode: lock_id = %llu, "
 			       "node=%u, seq=%llu, flags=0x%x\n",
 			       lock_id, node_num, seq_num, flags);

Modified: trunk/src/ocfs.h
===================================================================
--- trunk/src/ocfs.h	2004-10-07 21:08:30 UTC (rev 1554)
+++ trunk/src/ocfs.h	2004-10-07 21:46:58 UTC (rev 1555)
@@ -247,9 +247,6 @@
 #define SHUTDOWN_SIGS   (sigmask(SIGKILL) | sigmask(SIGHUP) | \
 			 sigmask(SIGINT) | sigmask(SIGQUIT))
 
-#define EFAIL                      999
-#define EWARNING                   998
-
 #define OCFS_MAGIC                 0xa156f7eb
 
 #define OCFS_LINUX_MAX_FILE_SIZE   9223372036854775807LL

Modified: trunk/src/super.c
===================================================================
--- trunk/src/super.c	2004-10-07 21:08:30 UTC (rev 1554)
+++ trunk/src/super.c	2004-10-07 21:46:58 UTC (rev 1555)
@@ -991,7 +991,7 @@
 		LOG_ERROR_ARGS ("unable to launch ocfs2nm thread, error=%d",
 				child_pid);
 		up (&(osb->osb_res));
-		status = -EFAIL;
+		status = child_pid;
 		goto leave;
 	} else {
 		init_completion (&osb->dlm_complete);
@@ -1021,7 +1021,7 @@
 		if (child_pid >= 0) {
 			init_completion (&(OcfsIpcCtxt.complete));
 		} else {
-			status = -EFAIL;
+			status = child_pid;
 			LOG_ERROR_ARGS ("unable to launch ocfs2lsnr thread, error=%d", child_pid);
 			goto leave;
 		}
@@ -1064,7 +1064,7 @@
 		LOG_ERROR_ARGS ("unable to launch ocfs2commit thread, error=%d",
 				child_pid);
 		up (&(osb->osb_res));
-		status = -EFAIL;
+		status = child_pid;
 		goto leave;
 	} else {
 		init_completion (&osb->commit->c_complete);
@@ -1093,14 +1093,14 @@
 	LOG_ENTRY_ARGS ("(0x%p)\n", sb);
 
 	if (sb == NULL) {
-		LOG_ERROR_STATUS (status = -EFAIL);
+		LOG_ERROR_STATUS (status = -EINVAL);
 		goto leave;
 	}
 
 	osb = OCFS_SB(sb);
 
 	if (osb == NULL) {
-		LOG_ERROR_STATUS (status = -EFAIL);
+		LOG_ERROR_STATUS (status = -EINVAL);
 		goto leave;
 	}
 

Modified: trunk/src/volcfg.c
===================================================================
--- trunk/src/volcfg.c	2004-10-07 21:08:30 UTC (rev 1554)
+++ trunk/src/volcfg.c	2004-10-07 21:46:58 UTC (rev 1555)
@@ -406,7 +406,7 @@
 				status = ocfs_update_disk_config(osb, node_num,
 				       (ocfs_node_config_info *) cfg_buf);
 			else
-				status = -EFAIL;
+				status = -EINVAL;
 			if (status < 0) {
 				LOG_ERROR_STATUS (status);
 				goto finito;
@@ -425,7 +425,7 @@
 
 	}
 	if (i >= 50)
-		status = -EFAIL;
+		status = -EINVAL;
 
 finito:
 	ocfs_release_disk_lock (osb, lock_off);
@@ -798,7 +798,7 @@
 		else {
 			LOG_ERROR_STR("Re-mount volume with the reclaimid " \
 				      "option to reclaim the node number");
-			status = -EFAIL;
+			status = -EBUSY;
 			goto finally;
 		}
 	}

Modified: trunk/src/vote.c
===================================================================
--- trunk/src/vote.c	2004-10-07 21:08:30 UTC (rev 1554)
+++ trunk/src/vote.c	2004-10-07 21:46:58 UTC (rev 1555)
@@ -82,7 +82,7 @@
  */
 int ocfs_recv_udp_msg (ocfs_recv_ctxt * recv_ctxt)
 {
-	int status = -EFAIL, error;
+	int status = -ENETUNREACH, error;
 	mm_segment_t oldfs;
 	struct sockaddr_in sin;
 	struct iovec iov = { 
@@ -115,7 +115,7 @@
 			status = -EBADF;
 			LOG_TRACE_STR ("Shutting down ocfs2lsnr");
 		} else {
-			status = -EFAIL;
+			status = -ENETUNREACH;
 			LOG_ERROR_ARGS ("unable to recvmsg, error=%d", error);
 			LOG_ERROR_STATUS (status);
 		}
@@ -188,7 +188,7 @@
 			       ntohl(node->ipc_config.addr_u.ip_addr4),
 			       ntohs(node->ipc_config.ip_port));
 		
-		status = -EFAIL;
+		status = -ENETUNREACH;
 		if (OcfsIpcCtxt.send_sock) {
 			struct iovec iov = {
 				.iov_base = dlm_msg,
@@ -211,7 +211,7 @@
 		
 			if (error < 0) {
 				LOG_ERROR_ARGS ("unable to sendmsg, error=%d", error);
-				status = -EFAIL;
+				status = -ENETUNREACH;
 			} 
 		}
 		if (status < 0)
@@ -231,7 +231,7 @@
 		       struct socket **recv_sock)
 {
 	struct sockaddr_in sin;
-	int status = -EFAIL;
+	int status;
 	ocfs_comm_info *comm;
 
 	LOG_ENTRY ();
@@ -929,7 +929,7 @@
 			break;
 		case FLAG_VOTE_OIN_ALREADY_INUSE:
 			ocfs_node_map_set_bit(ctxt->got_vote_map, node_num);
-			status = -EFAIL;
+			status = -EINVAL;
 			if (ctxt->flags & FLAG_FILE_DELETE)
 				status = -EBUSY;
 			break;



More information about the Ocfs2-commits mailing list