[Pvfs2-cvs] commit by mtmoore in pvfs2/src/io/dev: pint-dev.c pint-dev.h

CVS commit program cvs at parl.clemson.edu
Thu Jul 8 10:02:57 EDT 2010


Update of /projects/cvsroot/pvfs2/src/io/dev
In directory parlweb1:/tmp/cvs-serv12057/pvfs2/src/io/dev

Modified Files:
      Tag: mtmoore-meta-mirror
	pint-dev.c pint-dev.h 
Log Message:
merging Orange Branch changes in


Index: pint-dev.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/dev/pint-dev.c,v
diff -p -u -r1.41 -r1.41.34.1
--- pint-dev.c	24 Nov 2008 15:21:55 -0000	1.41
+++ pint-dev.c	8 Jul 2010 14:02:57 -0000	1.41.34.1
@@ -40,10 +40,12 @@ static int parse_devices(
     int *majornum);
 #endif  /* WITH_LINUX_KMOD */
 
+
 static int pdev_fd = -1;
 static int32_t pdev_magic;
 #ifdef WITH_LINUX_KMOD
 static int32_t pdev_max_upsize;
+
 #endif  /* WITH_LINUX_KMOD */
 static int32_t pdev_max_downsize;
 
@@ -63,7 +65,13 @@ int PINT_dev_initialize(
 #ifdef WITH_LINUX_KMOD
     int ret = -1;
     char *debug_string = getenv("PVFS2_KMODMASK");
-    int32_t debug_mask = 0;
+    uint64_t debug_mask = 0;
+    dev_mask_info_t mask_info;
+
+    if (!debug_string)
+    {
+        debug_string = "none";
+    }
 
     /* we have to be root to access the device */
     if ((getuid() != 0) && (geteuid() != 0))
@@ -119,16 +127,33 @@ int PINT_dev_initialize(
         return(-(PVFS_ENODEV|PVFS_ERROR_DEV));
     }
 
-    /* set the debug mask through an ioctl */
-    if (!debug_string)
-        return 0;
+    /* push the kernel debug mask into the kernel, set gossip_debug_mask in the
+     * kernel and initialize the kernel debug string used by 
+     * /proc/sys/pvfs2/kernel-debug.
+    */
+    mask_info.mask_type  = KERNEL_MASK;
+    mask_info.mask_value = PVFS_kmod_eventlog_to_mask(debug_string);
+    ret = ioctl(pdev_fd, PVFS_DEV_DEBUG, &mask_info);
+    if (ret < 0)
+    {
+        gossip_err("Error: ioctl() PVFS_DEV_DEBUG failure (kernel debug mask to"
+                   " %x)\n"
+                  ,(unsigned int)debug_mask);
+        close(pdev_fd);
+        return -(PVFS_ENODEV|PVFS_ERROR_DEV);
+    }
 
-    /* truncate it to a 32 bit mask since we dont have a need for more than that anyways */
-    debug_mask = (int32_t) PVFS_kmod_eventlog_to_mask(debug_string);
-    ret = ioctl(pdev_fd, PVFS_DEV_DEBUG, &debug_mask);
+    /* push the client debug mask into the kernel and initialize the client 
+     * debug string used by /proc/sys/pvfs2/client-debug.  
+    */
+    mask_info.mask_type  = CLIENT_MASK;
+    mask_info.mask_value = gossip_debug_mask;
+    ret = ioctl(pdev_fd, PVFS_DEV_DEBUG, &mask_info);
     if (ret < 0)
     {
-        gossip_err("Error: ioctl() PVFS_DEV_DEBUG failure (debug mask to %x)\n", debug_mask);
+        gossip_err("Error: ioctl() PVFS_DEV_DEBUG failure (client debug mask to"
+                   " %x)\n"
+                  ,(unsigned int)gossip_debug_mask);
         close(pdev_fd);
         return -(PVFS_ENODEV|PVFS_ERROR_DEV);
     }

Index: pint-dev.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/dev/pint-dev.h,v
diff -p -u -r1.15 -r1.15.52.1
--- pint-dev.h	4 Dec 2006 06:18:25 -0000	1.15
+++ pint-dev.h	8 Jul 2010 14:02:57 -0000	1.15.52.1
@@ -9,6 +9,20 @@
 #include "pvfs2-types.h"
 #include "pint-dev-shared.h"
 
+
+/* parameter structure used in PVFS_DEV_DEBUG ioctl command */
+typedef struct
+{
+  enum 
+  {
+     KERNEL_MASK,
+     CLIENT_MASK,
+  } mask_type;
+  uint64_t mask_value;
+} dev_mask_info_t;
+
+
+
 enum pvfs_bufmap_type {
     BM_IO = 0,
     BM_READDIR = 1,



More information about the Pvfs2-cvs mailing list