Lines 44-52
Link Here
|
44 |
/* File system operations */ |
44 |
/* File system operations */ |
45 |
|
45 |
|
46 |
#if defined(VMW_GETSB_2618) |
46 |
#if defined(VMW_GETSB_2618) |
|
|
47 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) |
47 |
static int FsOpGetSb(struct file_system_type *fsType, int flags, |
48 |
static int FsOpGetSb(struct file_system_type *fsType, int flags, |
48 |
const char *devName, void *rawData, struct vfsmount *mnt); |
49 |
const char *devName, void *rawData, struct vfsmount *mnt); |
49 |
#else |
50 |
#else |
|
|
51 |
static struct dentry *FsOpMount(struct file_system_type *fsType, int flags, |
52 |
const char *devName, void *rawData); |
53 |
#endif |
54 |
#else |
50 |
static struct super_block *FsOpGetSb(struct file_system_type *fsType, int flags, |
55 |
static struct super_block *FsOpGetSb(struct file_system_type *fsType, int flags, |
51 |
const char *devName, void *rawData); |
56 |
const char *devName, void *rawData); |
52 |
#endif |
57 |
#endif |
Lines 66-72
Link Here
|
66 |
static struct file_system_type fsType = { |
71 |
static struct file_system_type fsType = { |
67 |
.owner = THIS_MODULE, |
72 |
.owner = THIS_MODULE, |
68 |
.name = VMBLOCK_FS_NAME, |
73 |
.name = VMBLOCK_FS_NAME, |
|
|
74 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) |
69 |
.get_sb = FsOpGetSb, |
75 |
.get_sb = FsOpGetSb, |
|
|
76 |
#else |
77 |
.mount = FsOpMount, |
78 |
#endif |
70 |
.kill_sb = kill_anon_super, |
79 |
.kill_sb = kill_anon_super, |
71 |
}; |
80 |
}; |
72 |
|
81 |
|
Lines 336-342
Link Here
|
336 |
goto error_inode; |
345 |
goto error_inode; |
337 |
} |
346 |
} |
338 |
|
347 |
|
|
|
348 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) |
339 |
if (compat_path_lookup(iinfo->name, 0, &actualNd)) { |
349 |
if (compat_path_lookup(iinfo->name, 0, &actualNd)) { |
|
|
350 |
#else |
351 |
if (kern_path(iinfo->name, 0, &(actualNd.path))) { |
352 |
#endif |
340 |
/* |
353 |
/* |
341 |
* This file does not exist, so we create an inode that doesn't know |
354 |
* This file does not exist, so we create an inode that doesn't know |
342 |
* about its underlying file. Operations that create files and |
355 |
* about its underlying file. Operations that create files and |
Lines 533-550
Link Here
|
533 |
return 0; |
546 |
return 0; |
534 |
} |
547 |
} |
535 |
|
548 |
|
536 |
|
|
|
537 |
#if defined(VMW_GETSB_2618) |
549 |
#if defined(VMW_GETSB_2618) |
538 |
/* |
550 |
/* |
539 |
*----------------------------------------------------------------------------- |
551 |
*----------------------------------------------------------------------------- |
540 |
* |
552 |
* |
541 |
* FsOpGetSb -- |
553 |
* FsOpGetSb/FsOpMount -- |
542 |
* |
554 |
* |
543 |
* Invokes generic kernel code to prepare superblock for |
555 |
* Invokes generic kernel code to prepare superblock for |
544 |
* deviceless filesystem. |
556 |
* deviceless filesystem. |
545 |
* |
557 |
* |
546 |
* Results: |
558 |
* Results: |
547 |
* 0 on success |
559 |
* 0/dentry on success |
548 |
* negative error code on failure |
560 |
* negative error code on failure |
549 |
* |
561 |
* |
550 |
* Side effects: |
562 |
* Side effects: |
Lines 552-558
Link Here
|
552 |
* |
564 |
* |
553 |
*----------------------------------------------------------------------------- |
565 |
*----------------------------------------------------------------------------- |
554 |
*/ |
566 |
*/ |
555 |
|
567 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) |
556 |
static int |
568 |
static int |
557 |
FsOpGetSb(struct file_system_type *fs_type, // IN: file system type of mount |
569 |
FsOpGetSb(struct file_system_type *fs_type, // IN: file system type of mount |
558 |
int flags, // IN: mount flags |
570 |
int flags, // IN: mount flags |
Lines 563-568
Link Here
|
563 |
return get_sb_nodev(fs_type, flags, rawData, FsOpReadSuper, mnt); |
575 |
return get_sb_nodev(fs_type, flags, rawData, FsOpReadSuper, mnt); |
564 |
} |
576 |
} |
565 |
#else |
577 |
#else |
|
|
578 |
struct dentry * |
579 |
FsOpMount(struct file_system_type *fs_type, // IN: file system type of mount |
580 |
int flags, // IN: mount flags |
581 |
const char *dev_name, // IN: device mounting on |
582 |
void *rawData) // IN: mount arguments |
583 |
{ |
584 |
return mount_nodev(fs_type, flags, rawData, FsOpReadSuper); |
585 |
} |
586 |
#endif |
587 |
#else |
566 |
/* |
588 |
/* |
567 |
*----------------------------------------------------------------------------- |
589 |
*----------------------------------------------------------------------------- |
568 |
* |
590 |
* |