[Ocfs2-commits] manish commits r2228 - in trunk/fs/ocfs2: . cluster dlm

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu May 12 16:02:21 CDT 2005


Author: manish
Signed-off-by: mfasheh
Date: 2005-05-12 16:02:19 -0500 (Thu, 12 May 2005)
New Revision: 2228

Modified:
   trunk/fs/ocfs2/aio.c
   trunk/fs/ocfs2/aio.h
   trunk/fs/ocfs2/cluster/heartbeat.c
   trunk/fs/ocfs2/cluster/nodemanager.c
   trunk/fs/ocfs2/cluster/tcp.c
   trunk/fs/ocfs2/dlm/dlmcommon.h
   trunk/fs/ocfs2/dlm/dlmdebug.c
   trunk/fs/ocfs2/dlm/dlmdomain.c
   trunk/fs/ocfs2/dlm/dlmfs.c
   trunk/fs/ocfs2/dlm/dlmmaster.c
   trunk/fs/ocfs2/dlm/dlmthread.c
   trunk/fs/ocfs2/dlmglue.c
   trunk/fs/ocfs2/file.c
   trunk/fs/ocfs2/mmap.c
   trunk/fs/ocfs2/mmap.h
   trunk/fs/ocfs2/ocfs2_fs.h
   trunk/fs/ocfs2/proc.c
   trunk/fs/ocfs2/super.c
   trunk/fs/ocfs2/symlink.c
Log:
Cleanups for things found by sparse

Signed-off-by: mfasheh


Modified: trunk/fs/ocfs2/aio.c
===================================================================
--- trunk/fs/ocfs2/aio.c	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/aio.c	2005-05-12 21:02:19 UTC (rev 2228)
@@ -36,6 +36,7 @@
 #include "ocfs.h"
 #include "ocfs2.h"
 
+#include "aio.h"
 #include "alloc.h"
 #include "dir.h"
 #include "dlmglue.h"
@@ -236,7 +237,7 @@
 
 /* this is called as iocb->ki_retry so it is careful to only repeat
  * what is needed */
-ssize_t ocfs2_file_aio_read(struct kiocb *iocb, char *buf, size_t count,
+ssize_t ocfs2_file_aio_read(struct kiocb *iocb, char __user *buf, size_t count,
 			    loff_t pos)
 {
 	struct ocfs2_kiocb_private *okp = iocb->private;
@@ -292,14 +293,14 @@
 
 /* this is called as iocb->ki_retry so it is careful to only repeat
  * what is needed */
-ssize_t ocfs2_file_aio_write(struct kiocb *iocb, const char *buf,
+ssize_t ocfs2_file_aio_write(struct kiocb *iocb, const char __user *buf,
 			     size_t count, loff_t pos)
 {
 	struct ocfs2_kiocb_private *okp = iocb->private;
 	struct file *filp = iocb->ki_filp;
 	struct inode *inode = filp->f_dentry->d_inode;
 	ssize_t ret = 0;
-	struct iovec local_iov = { .iov_base = (void *)buf,
+	struct iovec local_iov = { .iov_base = (void __user *)buf,
 				   .iov_len = count };
 
 	mlog(0, "iocb %p okp %p\n", iocb, okp);

Modified: trunk/fs/ocfs2/aio.h
===================================================================
--- trunk/fs/ocfs2/aio.h	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/aio.h	2005-05-12 21:02:19 UTC (rev 2228)
@@ -26,9 +26,9 @@
 #ifndef OCFS2_AIO_H
 #define OCFS2_AIO_H
 
-ssize_t ocfs2_file_aio_write(struct kiocb *iocb, const char *buf,
+ssize_t ocfs2_file_aio_write(struct kiocb *iocb, const char __user *buf,
 			     size_t count, loff_t pos);
-ssize_t ocfs2_file_aio_read(struct kiocb *iocb, char *buf, size_t count,
+ssize_t ocfs2_file_aio_read(struct kiocb *iocb, char __user *buf, size_t count,
 			    loff_t pos);
 
 void okp_teardown_from_list(void *data);

Modified: trunk/fs/ocfs2/cluster/heartbeat.c
===================================================================
--- trunk/fs/ocfs2/cluster/heartbeat.c	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/cluster/heartbeat.c	2005-05-12 21:02:19 UTC (rev 2228)
@@ -1213,7 +1213,7 @@
 	.drop_item	= hb_heartbeat_group_drop_item,
 };
 
-struct config_item_type hb_heartbeat_group_type = {
+static struct config_item_type hb_heartbeat_group_type = {
 	.ct_group_ops	= &hb_heartbeat_group_group_ops,
 	.ct_owner	= THIS_MODULE,
 };

Modified: trunk/fs/ocfs2/cluster/nodemanager.c
===================================================================
--- trunk/fs/ocfs2/cluster/nodemanager.c	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/cluster/nodemanager.c	2005-05-12 21:02:19 UTC (rev 2228)
@@ -271,7 +271,7 @@
 	return sprintf(page, "%d\n", node->nd_num);
 }
 
-struct nm_cluster *to_nm_cluster_from_node(struct nm_node *node)
+static struct nm_cluster *to_nm_cluster_from_node(struct nm_node *node)
 {
 	/* through the first node_set .parent
 	 * mycluster/nodes/mynode == nm_cluster->nm_node_group->nm_node */
@@ -839,7 +839,7 @@
 		goto out_callbacks;
 	}
 
-	nm_proc = proc_mkdir(NM_PROC_PATH, 0);
+	nm_proc = proc_mkdir(NM_PROC_PATH, NULL);
 	if (nm_proc == NULL) {
 		ret = -ENOMEM; /* shrug */
 		goto out_subsys;

Modified: trunk/fs/ocfs2/cluster/tcp.c
===================================================================
--- trunk/fs/ocfs2/cluster/tcp.c	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/cluster/tcp.c	2005-05-12 21:02:19 UTC (rev 2228)
@@ -626,7 +626,7 @@
 	return nmh;
 }
 
-void net_handler_put(struct net_msg_handler *nmh)
+static void net_handler_put(struct net_msg_handler *nmh)
 {
 	kref_put(&nmh->nh_kref, net_handler_kref_release);
 }

Modified: trunk/fs/ocfs2/dlm/dlmcommon.h
===================================================================
--- trunk/fs/ocfs2/dlm/dlmcommon.h	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/dlm/dlmcommon.h	2005-05-12 21:02:19 UTC (rev 2228)
@@ -928,7 +928,7 @@
 #define DLM_MLE_DEBUG 1
 
 #ifdef DLM_MLE_DEBUG
-void dlm_dump_all_mles(char *data, int len);
+void dlm_dump_all_mles(const char __user *data, int len);
 #endif
 
 

Modified: trunk/fs/ocfs2/dlm/dlmdebug.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmdebug.c	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/dlm/dlmdebug.c	2005-05-12 21:02:19 UTC (rev 2228)
@@ -38,19 +38,20 @@
 
 #include "dlmapi.h"
 #include "dlmcommon.h"
+#include "dlmdebug.h"
 
 #include "dlmdomain.h"
 
 #define MLOG_MASK_PREFIX ML_DLM
 #include "cluster/masklog.h"
 
-static void dlm_dump_all_lock_resources(char *data, int len);
+static void dlm_dump_all_lock_resources(const char __user *data, int len);
 static void dlm_dump_lock_resources(dlm_ctxt *dlm);
 static void dlm_dump_purge_list(dlm_ctxt *dlm);
-static void dlm_dump_all_purge_lists(char *data, int len);
-static void dlm_trigger_migration(char *data, int len);
+static void dlm_dump_all_purge_lists(const char __user *data, int len);
+static void dlm_trigger_migration(const char __user *data, int len);
 
-typedef void (dlm_debug_func_t)(char *data, int len);
+typedef void (dlm_debug_func_t)(const char __user *data, int len);
 
 typedef struct _dlm_debug_funcs
 {
@@ -89,7 +90,7 @@
 		if (c == d->key) {
 			fn = d->func;
 			if (fn)
-				(fn)((char *)buf, count);
+				(fn)(buf, count);
 			break;
 		}
 	}
@@ -108,7 +109,7 @@
 		entry->proc_fops = &dlm_debug_operations;
 }
 
-static void dlm_dump_all_lock_resources(char *data, int len)
+static void dlm_dump_all_lock_resources(const char __user *data, int len)
 {
 	dlm_ctxt *dlm;
 	struct list_head *iter;
@@ -204,7 +205,7 @@
 	spin_unlock(&dlm->spinlock);
 }
 
-static void dlm_dump_all_purge_lists(char *data, int len)
+static void dlm_dump_all_purge_lists(const char __user *data, int len)
 {
 	dlm_ctxt *dlm;
 	struct list_head *iter;
@@ -217,7 +218,7 @@
 	spin_unlock(&dlm_domain_lock);
 }
 
-static void dlm_trigger_migration(char *data, int len)
+static void dlm_trigger_migration(const char __user *data, int len)
 {
 	dlm_lock_resource *res;
 	dlm_ctxt *dlm;

Modified: trunk/fs/ocfs2/dlm/dlmdomain.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmdomain.c	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/dlm/dlmdomain.c	2005-05-12 21:02:19 UTC (rev 2228)
@@ -41,6 +41,7 @@
 #include "dlmcommon.h"
 
 #include "dlmdebug.h"
+#include "dlmdomain.h"
 
 #include "dlmver.h"
 
@@ -62,7 +63,7 @@
 
 spinlock_t dlm_domain_lock = SPIN_LOCK_UNLOCKED;
 LIST_HEAD(dlm_domains);
-DECLARE_WAIT_QUEUE_HEAD(dlm_domain_events);
+static DECLARE_WAIT_QUEUE_HEAD(dlm_domain_events);
 
 static int dlm_query_join_handler(net_msg *msg, u32 len, void *data);
 static int dlm_assert_joined_handler(net_msg *msg, u32 len, void *data);

Modified: trunk/fs/ocfs2/dlm/dlmfs.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmfs.c	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/dlm/dlmfs.c	2005-05-12 21:02:19 UTC (rev 2228)
@@ -161,7 +161,7 @@
 }
 
 static ssize_t dlmfs_file_read(struct file *filp,
-			       char *buf,
+			       char __user *buf,
 			       size_t count,
 			       loff_t *ppos)
 {
@@ -205,7 +205,7 @@
 }
 
 static ssize_t dlmfs_file_write(struct file *filp,
-				const char *buf,
+				const char __user *buf,
 				size_t count,
 				loff_t *ppos)
 {

Modified: trunk/fs/ocfs2/dlm/dlmmaster.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmmaster.c	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/dlm/dlmmaster.c	2005-05-12 21:02:19 UTC (rev 2228)
@@ -98,7 +98,7 @@
 extern spinlock_t dlm_domain_lock;
 extern struct list_head dlm_domains;
 
-void dlm_dump_all_mles(char *data, int len)
+void dlm_dump_all_mles(const char __user *data, int len)
 {
 	struct list_head *iter;
 	dlm_ctxt *dlm;
@@ -115,7 +115,7 @@
 #endif
 
 
-kmem_cache_t *dlm_mle_cache = NULL;
+static kmem_cache_t *dlm_mle_cache = NULL;
 
 
 static void dlm_mle_release(struct kref *kref);

Modified: trunk/fs/ocfs2/dlm/dlmthread.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmthread.c	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/dlm/dlmthread.c	2005-05-12 21:02:19 UTC (rev 2228)
@@ -55,7 +55,6 @@
 extern struct list_head dlm_domains;
 
 static int dlm_thread(void *data);
-struct task_struct *dlm_thread_task;
 
 #define dlm_lock_is_remote(dlm, lock)     ((lock)->ml.node != (dlm)->node_num)
 

Modified: trunk/fs/ocfs2/dlmglue.c
===================================================================
--- trunk/fs/ocfs2/dlmglue.c	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/dlmglue.c	2005-05-12 21:02:19 UTC (rev 2228)
@@ -64,9 +64,9 @@
 #define OCFS2_LOCK_ID_PAD "000000"
 
 static char ocfs2_lock_type_char[OCFS_NUM_LOCK_TYPES] = {
-	[OCFS_TYPE_META]	'M',
-	[OCFS_TYPE_DATA] 	'D',
-	[OCFS_TYPE_SUPER]       'S'
+	[OCFS_TYPE_META]  = 'M',
+	[OCFS_TYPE_DATA]  = 'D',
+	[OCFS_TYPE_SUPER] = 'S'
 };
 
 static int ocfs2_build_lock_name(enum ocfs2_lock_type type,
@@ -104,7 +104,7 @@
 	int  (*unblock)(ocfs2_lock_res *, int *);
 };
 
-struct ocfs2_lock_res_ops ocfs2_inode_meta_lops = {
+static struct ocfs2_lock_res_ops ocfs2_inode_meta_lops = {
 	.ast = ocfs2_inode_ast_func,
 	.bast = ocfs2_inode_bast_func,
 	.unlock_ast = ocfs2_unlock_ast_func,
@@ -114,14 +114,14 @@
 static void ocfs2_data_convert_worker(ocfs2_lock_res *lockres,
 				      int blocking);
 
-struct ocfs2_lock_res_ops ocfs2_inode_data_lops = {
+static struct ocfs2_lock_res_ops ocfs2_inode_data_lops = {
 	.ast = ocfs2_inode_ast_func,
 	.bast = ocfs2_inode_bast_func,
 	.unlock_ast = ocfs2_unlock_ast_func,
 	.unblock = ocfs2_unblock_data,
 };
 
-struct ocfs2_lock_res_ops ocfs2_super_lops = {
+static struct ocfs2_lock_res_ops ocfs2_super_lops = {
 	.ast = ocfs2_super_ast_func,
 	.bast = ocfs2_super_bast_func,
 	.unlock_ast = ocfs2_unlock_ast_func,

Modified: trunk/fs/ocfs2/file.c
===================================================================
--- trunk/fs/ocfs2/file.c	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/file.c	2005-05-12 21:02:19 UTC (rev 2228)
@@ -197,7 +197,7 @@
  * Linux 2.6 TODO: Remove all O_DIRECT conditionals here, they are no longer
  * needed.
  */
-static ssize_t ocfs_file_write(struct file *filp, const char *buf,
+static ssize_t ocfs_file_write(struct file *filp, const char __user *buf,
 		size_t count, loff_t *ppos)
 {
 	struct iovec local_iov = { .iov_base = (void __user *)buf, 
@@ -269,7 +269,7 @@
  * Linux 2.6 TODO: Remove all O_DIRECT conditionals here, they are no longer
  * needed.
  */
-static ssize_t ocfs_file_read(struct file *filp, char *buf,
+static ssize_t ocfs_file_read(struct file *filp, char __user *buf,
 		size_t count, loff_t *ppos)
 {
 	unsigned int savedflags;

Modified: trunk/fs/ocfs2/mmap.c
===================================================================
--- trunk/fs/ocfs2/mmap.c	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/mmap.c	2005-05-12 21:02:19 UTC (rev 2228)
@@ -51,7 +51,7 @@
 					 ocfs2_backing_inode **binode_ret);
 static int ocfs2_fill_ctxt_from_buf(struct super_block *sb,
 				    struct inode *target_inode,
-				    char *buf,
+				    char __user *buf,
 				    size_t size,
 				    ocfs2_buffer_lock_ctxt *ctxt);
 
@@ -142,7 +142,7 @@
 }
 
 static struct vm_operations_struct ocfs2_file_vm_ops = {
-	nopage:         ocfs2_nopage,
+	.nopage = ocfs2_nopage,
 };
 
 int ocfs2_mmap(struct file *file,
@@ -223,7 +223,7 @@
 
 static int ocfs2_fill_ctxt_from_buf(struct super_block *sb,
 				    struct inode *target_inode,
-				    char *buf,
+				    char __user *buf,
 				    size_t size,
 				    ocfs2_buffer_lock_ctxt *ctxt)
 {
@@ -258,7 +258,7 @@
 
 int ocfs2_setup_io_locks(struct super_block *sb,
 			 struct inode *target_inode,
-			 char *buf,
+			 char __user *buf,
 			 size_t size,
 			 ocfs2_buffer_lock_ctxt *ctxt,
 			 ocfs2_backing_inode **target_binode)
@@ -437,7 +437,7 @@
  * in when it thinks the dlm won't block any more.  Thus, the caller must zero
  * the info struct before calling in the first time.
  */
-ssize_t ocfs_write_lock_maybe_extend(struct file *filp, const char *buf,
+ssize_t ocfs_write_lock_maybe_extend(struct file *filp, const char __user *buf,
 				     size_t count, loff_t *ppos,
 				     struct ocfs2_write_lock_info *info,
 				     ocfs2_buffer_lock_ctxt *ctxt)
@@ -459,7 +459,8 @@
 	 * doesn't get a data lock and when appending it gets a level 1 meta
 	 * lock.  we use target_binode to set its flags accordingly */ 
 	if (info->wl_target_binode == NULL) {
-		ret = ocfs2_setup_io_locks(inode->i_sb, inode, (char *) buf,
+		ret = ocfs2_setup_io_locks(inode->i_sb, inode,
+					   (char __user *) buf,
 					   count, ctxt, 
 					   &info->wl_target_binode);
 		if (ret < 0) {

Modified: trunk/fs/ocfs2/mmap.h
===================================================================
--- trunk/fs/ocfs2/mmap.h	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/mmap.h	2005-05-12 21:02:19 UTC (rev 2228)
@@ -101,7 +101,7 @@
 
 int ocfs2_setup_io_locks(struct super_block *sb,
 			 struct inode *target_inode,
-			 char *buf,
+			 char __user *buf,
 			 size_t size,
 			 ocfs2_buffer_lock_ctxt *ctxt,
 			 ocfs2_backing_inode **target_binode);
@@ -123,7 +123,7 @@
 	ocfs2_backing_inode	*wl_target_binode;
 };
 
-ssize_t ocfs_write_lock_maybe_extend(struct file *filp, const char *buf,
+ssize_t ocfs_write_lock_maybe_extend(struct file *filp, const char __user *buf,
 				     size_t count, loff_t *ppos,
 				     struct ocfs2_write_lock_info *info,
 				     ocfs2_buffer_lock_ctxt *ctxt);

Modified: trunk/fs/ocfs2/ocfs2_fs.h
===================================================================
--- trunk/fs/ocfs2/ocfs2_fs.h	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/ocfs2_fs.h	2005-05-12 21:02:19 UTC (rev 2228)
@@ -169,20 +169,20 @@
 static struct ocfs2_system_inode_info ocfs2_system_inodes[NUM_SYSTEM_INODES] = {
 	/* Global system inodes (single copy) */
 	/* The first two are only used from userspace mfks/tunefs */
-	[BAD_BLOCK_SYSTEM_INODE]		{ "bad_blocks", 0, S_IFREG | 0644 },
-	[GLOBAL_INODE_ALLOC_SYSTEM_INODE] 	{ "global_inode_alloc", OCFS2_BITMAP_FL | OCFS2_CHAIN_FL, S_IFREG | 0644 },
+	[BAD_BLOCK_SYSTEM_INODE]		= { "bad_blocks", 0, S_IFREG | 0644 },
+	[GLOBAL_INODE_ALLOC_SYSTEM_INODE] 	= { "global_inode_alloc", OCFS2_BITMAP_FL | OCFS2_CHAIN_FL, S_IFREG | 0644 },
 
 	/* These are used by the running filesystem */
-	[SLOT_MAP_SYSTEM_INODE]			{ "slot_map", 0, S_IFREG | 0644 },
-	[HEARTBEAT_SYSTEM_INODE]		{ "heartbeat", OCFS2_HEARTBEAT_FL, S_IFREG | 0644 },
-	[GLOBAL_BITMAP_SYSTEM_INODE]		{ "global_bitmap", 0, S_IFREG | 0644 },
+	[SLOT_MAP_SYSTEM_INODE]			= { "slot_map", 0, S_IFREG | 0644 },
+	[HEARTBEAT_SYSTEM_INODE]		= { "heartbeat", OCFS2_HEARTBEAT_FL, S_IFREG | 0644 },
+	[GLOBAL_BITMAP_SYSTEM_INODE]		= { "global_bitmap", 0, S_IFREG | 0644 },
 
 	/* Node-specific system inodes (one copy per node) */
-	[ORPHAN_DIR_SYSTEM_INODE]		{ "orphan_dir:%04d", 0, S_IFDIR | 0755 },
-	[EXTENT_ALLOC_SYSTEM_INODE]		{ "extent_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_CHAIN_FL, S_IFREG | 0644 },
-	[INODE_ALLOC_SYSTEM_INODE]		{ "inode_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_CHAIN_FL, S_IFREG | 0644 },
-	[JOURNAL_SYSTEM_INODE]			{ "journal:%04d", OCFS2_JOURNAL_FL, S_IFREG | 0644 },
-	[LOCAL_ALLOC_SYSTEM_INODE]		{ "local_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_LOCAL_ALLOC_FL, S_IFREG | 0644 }
+	[ORPHAN_DIR_SYSTEM_INODE]		= { "orphan_dir:%04d", 0, S_IFDIR | 0755 },
+	[EXTENT_ALLOC_SYSTEM_INODE]		= { "extent_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_CHAIN_FL, S_IFREG | 0644 },
+	[INODE_ALLOC_SYSTEM_INODE]		= { "inode_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_CHAIN_FL, S_IFREG | 0644 },
+	[JOURNAL_SYSTEM_INODE]			= { "journal:%04d", OCFS2_JOURNAL_FL, S_IFREG | 0644 },
+	[LOCAL_ALLOC_SYSTEM_INODE]		= { "local_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_LOCAL_ALLOC_FL, S_IFREG | 0644 }
 };
 
 /* Parameter passed from mount.ocfs2 to module */
@@ -219,13 +219,13 @@
 
 #define S_SHIFT			12
 static unsigned char ocfs_type_by_mode[S_IFMT >> S_SHIFT] = {
-	[S_IFREG >> S_SHIFT]    OCFS2_FT_REG_FILE,
-	[S_IFDIR >> S_SHIFT]    OCFS2_FT_DIR,
-	[S_IFCHR >> S_SHIFT]    OCFS2_FT_CHRDEV,
-	[S_IFBLK >> S_SHIFT]    OCFS2_FT_BLKDEV,
-	[S_IFIFO >> S_SHIFT]    OCFS2_FT_FIFO,
-	[S_IFSOCK >> S_SHIFT]   OCFS2_FT_SOCK,
-	[S_IFLNK >> S_SHIFT]    OCFS2_FT_SYMLINK,
+	[S_IFREG >> S_SHIFT]  = OCFS2_FT_REG_FILE,
+	[S_IFDIR >> S_SHIFT]  = OCFS2_FT_DIR,
+	[S_IFCHR >> S_SHIFT]  = OCFS2_FT_CHRDEV,
+	[S_IFBLK >> S_SHIFT]  = OCFS2_FT_BLKDEV,
+	[S_IFIFO >> S_SHIFT]  = OCFS2_FT_FIFO,
+	[S_IFSOCK >> S_SHIFT] = OCFS2_FT_SOCK,
+	[S_IFLNK >> S_SHIFT]  = OCFS2_FT_SYMLINK,
 };
 
 

Modified: trunk/fs/ocfs2/proc.c
===================================================================
--- trunk/fs/ocfs2/proc.c	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/proc.c	2005-05-12 21:02:19 UTC (rev 2228)
@@ -65,13 +65,13 @@
 	mode_t mode;
 } ocfs_proc_list;
 
-ocfs_proc_list top_dir[] = {
+static ocfs_proc_list top_dir[] = {
 	{ "version", NULL, ocfs_proc_version, NULL, S_IFREG | S_IRUGO, },
 	{ "nodename", NULL, ocfs_proc_nodename, NULL, S_IFREG | S_IRUGO, },
 	{ NULL }
 };
 
-ocfs_proc_list sub_dir[] = {
+static ocfs_proc_list sub_dir[] = {
 	{ "nodenum", NULL, ocfs_proc_nodenum, NULL, S_IFREG | S_IRUGO, },
 	{ "uuid", NULL, ocfs2_proc_uuid, NULL, S_IFREG | S_IRUGO, },
 	{ "slotnum", NULL, ocfs_proc_slotnum, NULL, S_IFREG | S_IRUGO, },
@@ -95,7 +95,7 @@
 
 	mlog_entry_void ();
 
-	parent = proc_mkdir (OCFS2_PROC_BASENAME, 0);
+	parent = proc_mkdir (OCFS2_PROC_BASENAME, NULL);
 	if (parent) {
 		ocfs2_proc_root_dir = parent;
 		for (p = top_dir; p->name; p++) {
@@ -129,7 +129,7 @@
 	if (parent) {
 		for (p = top_dir; p->name; p++)
 			remove_proc_entry (p->name, parent);
-		remove_proc_entry (OCFS2_PROC_BASENAME, 0);
+		remove_proc_entry (OCFS2_PROC_BASENAME, NULL);
 	}
 
 	mlog_exit_void ();

Modified: trunk/fs/ocfs2/super.c
===================================================================
--- trunk/fs/ocfs2/super.c	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/super.c	2005-05-12 21:02:19 UTC (rev 2228)
@@ -68,9 +68,10 @@
 /*
  * Globals
  */
-spinlock_t ocfs2_globals_lock = SPIN_LOCK_UNLOCKED;
-u32 osb_id;             /* Keeps track of next available OSB Id */
+static spinlock_t ocfs2_globals_lock = SPIN_LOCK_UNLOCKED;
 
+static u32 osb_id;             /* Keeps track of next available OSB Id */
+
 kmem_cache_t *ocfs2_inode_cache = NULL;
 kmem_cache_t *ocfs2_lock_cache = NULL;
 
@@ -112,7 +113,7 @@
 };
 
 struct dentry *ocfs_get_parent(struct dentry *child);
-struct export_operations ocfs_export_ops = {
+static struct export_operations ocfs_export_ops = {
 	.get_parent	= ocfs_get_parent,
 };
 

Modified: trunk/fs/ocfs2/symlink.c
===================================================================
--- trunk/fs/ocfs2/symlink.c	2005-05-12 20:42:57 UTC (rev 2227)
+++ trunk/fs/ocfs2/symlink.c	2005-05-12 21:02:19 UTC (rev 2228)
@@ -65,7 +65,7 @@
 static char *ocfs2_fast_symlink_getlink(struct inode *inode,
 					struct buffer_head **bh);
 static int ocfs2_readlink(struct dentry *dentry,
-			  char *buffer,
+			  char __user *buffer,
 			  int buflen);
 
 /* Context Dependent Symbolic Link (CDSL) code  */
@@ -371,7 +371,7 @@
 }
 
 static int ocfs2_readlink(struct dentry *dentry,
-			  char *buffer,
+			  char __user *buffer,
 			  int buflen)
 {
 	int ret;



More information about the Ocfs2-commits mailing list