Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


updated kernel version numbers for file interface
[palacios.git] / linux_module / iface-file.c
index 96a2477..39f909b 100644 (file)
@@ -106,7 +106,7 @@ static int mkdir_recursive(const char * path, unsigned short perms) {
 static int palacios_file_mkdir(const char * pathname, unsigned short perms, int recurse) {
     /* Welcome to the jungle... */
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,41)
     /* DO NOT REFERENCE THIS VARIABLE */
     /* It only exists to provide version compatibility */
     struct path tmp_path; 
@@ -123,12 +123,12 @@ static int palacios_file_mkdir(const char * pathname, unsigned short perms, int
     } 
 
     /* Before Linux 3.1 this was somewhat more difficult */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,41)
     {
        struct nameidata nd;
 
        // I'm not 100% sure about the version here, but it was around this time that the API changed
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,35) 
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,37) 
        ret = kern_path_parent(pathname, &nd);
 #else 
 
@@ -204,9 +204,12 @@ static void * palacios_file_open(const char * path, int mode, void * private_dat
     }
 
 
+    pfile->mode |= O_LARGEFILE;
+
+
     pfile->filp = filp_open(path, pfile->mode, 0);
     
-    if (pfile->filp == NULL) {
+    if (IS_ERR(pfile->filp)) {
        printk("Cannot open file: %s\n", path);
        return NULL;
     }