[Pvfs2-cvs] commit by pw in pvfs2/src/io/dev: pint-dev-shared.h
pint-dev.c
CVS commit program
cvs at parl.clemson.edu
Fri Jul 20 10:02:32 EDT 2007
Update of /projects/cvsroot/pvfs2/src/io/dev
In directory parlweb1:/tmp/cvs-serv21709/src/io/dev
Modified Files:
pint-dev-shared.h pint-dev.c
Log Message:
Machines without ioctl will complain on the uses of _IOR and so forth,
as well as ioctl, poll calls. The code to implement getting requests
through a character device runs through about 12 files in the source
tree. Rather than hacking out all the linux-kmod-related bits, selectively
disable just the main commands but leave it all harmlessly compiled in.
A new configure variable tells if a linux kernel module was requested.
Index: pint-dev-shared.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/dev/pint-dev-shared.h,v
diff -u -p -p -u -r1.20 -r1.21
--- pint-dev-shared.h 2 Feb 2007 02:08:57 -0000 1.20
+++ pint-dev-shared.h 20 Jul 2007 14:02:32 -0000 1.21
@@ -89,6 +89,12 @@ struct PVFS_dev_map_desc
int32_t count;
};
+/*
+ * Disable this code when not compiling for the use of the linux kernel
+ * module helper code. Not all client machines have ioctl, poll.
+ */
+#ifdef WITH_LINUX_KMOD
+
#define PVFS_DEV_MAGIC 'k'
#define DEV_GET_MAGIC 0x1
@@ -109,6 +115,8 @@ PVFS_DEV_REMOUNT_ALL = _IO(PVFS_
PVFS_DEV_DEBUG = _IOR(PVFS_DEV_MAGIC, DEV_DEBUG, int32_t),
PVFS_DEV_MAXNR = DEV_MAX_NR,
};
+
+#endif /* WITH_LINUX_KMOD */
#endif /* __PINT_DEV_SHARED_H */
Index: pint-dev.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/dev/pint-dev.c,v
diff -u -p -p -u -r1.36 -r1.37
--- pint-dev.c 13 Apr 2007 05:14:24 -0000 1.36
+++ pint-dev.c 20 Jul 2007 14:02:32 -0000 1.37
@@ -29,6 +29,7 @@
#include "pvfs2-dev-proto.h"
#include "pvfs2-internal.h"
+#ifdef WITH_LINUX_KMOD
static int setup_dev_entry(
const char *dev_name);
@@ -36,10 +37,13 @@ static int parse_devices(
const char *targetfile,
const char *devname,
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;
int32_t pvfs2_bufmap_total_size, pvfs2_bufmap_desc_size;
@@ -55,6 +59,7 @@ int PINT_dev_initialize(
const char *dev_name,
int flags)
{
+#ifdef WITH_LINUX_KMOD
int ret = -1;
char *debug_string = getenv("PVFS2_KMODMASK");
int32_t debug_mask = 0;
@@ -126,6 +131,7 @@ int PINT_dev_initialize(
close(pdev_fd);
return -(PVFS_ENODEV|PVFS_ERROR_DEV);
}
+#endif /* WITH_LINUX_KMOD */
return 0;
}
@@ -154,6 +160,7 @@ void PINT_dev_finalize(void)
int PINT_dev_get_mapped_regions(int ndesc, struct PVFS_dev_map_desc *desc,
struct PINT_dev_params *params)
{
+#ifdef WITH_LINUX_KMOD
int i, ret = -1;
uint64_t page_size = sysconf(_SC_PAGE_SIZE), total_size;
void *ptr = NULL;
@@ -224,6 +231,7 @@ int PINT_dev_get_mapped_regions(int ndes
}
return -(PVFS_ENOMEM|PVFS_ERROR_DEV);
}
+#endif /* WITH_LINUX_KMOD */
return 0;
}
@@ -294,7 +302,9 @@ int PINT_dev_test_unexpected(
struct PINT_dev_unexp_info *info_array,
int max_idle_time)
{
- int ret = -1, avail = -1, i = 0;
+ int ret = -1;
+#ifdef WITH_LINUX_KMOD
+ int avail = -1, i = 0;
struct pollfd pfd;
int32_t *magic = NULL;
int32_t *proto_ver = NULL;
@@ -495,6 +505,7 @@ dev_test_unexp_error:
}
*outcount = 0;
+#endif /* WITH_LINUX_KMOD */
return ret;
}
@@ -595,6 +606,7 @@ int PINT_dev_remount(void)
{
int ret = -PVFS_EINVAL;
+#ifdef WITH_LINUX_KMOD
if (pdev_fd > -1)
{
ret = ((ioctl(pdev_fd, PVFS_DEV_REMOUNT_ALL, NULL) < 0) ?
@@ -604,6 +616,7 @@ int PINT_dev_remount(void)
gossip_err("Error: ioctl PVFS_DEV_REMOUNT_ALL failure\n");
}
}
+#endif /* WITH_LINUX_KMOD */
return ret;
}
@@ -645,6 +658,7 @@ void PINT_dev_memfree(void *buffer, int
free(buffer);
}
+#ifdef WITH_LINUX_KMOD
/* setup_dev_entry()
*
* sets up the device file
@@ -772,6 +786,7 @@ static int parse_devices(
fclose(devfile);
return 0;
}
+#endif /* WITH_LINUX_KMOD */
/*
* Local variables:
More information about the Pvfs2-cvs
mailing list