Changeset 5984 in vbox
- Timestamp:
- Dec 6, 2007 1:06:54 PM (17 years ago)
- Location:
- trunk/src/VBox/Additions/linux/sharedfolders
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/regops.c
r5259 r5984 390 390 391 391 struct file_operations sf_reg_fops = { 392 .read = sf_reg_read, 393 .open = sf_reg_open, 394 .write = sf_reg_write, 395 .release = sf_reg_release, 396 .mmap = sf_reg_mmap 392 .read = sf_reg_read, 393 .open = sf_reg_open, 394 .write = sf_reg_write, 395 .release = sf_reg_release, 396 .mmap = sf_reg_mmap, 397 #if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 0) 398 .sendfile = generic_file_sendfile, 399 .fsync = simple_sync_file, 400 #endif 397 401 }; 398 402 -
trunk/src/VBox/Additions/linux/sharedfolders/utils.c
r5016 r5984 24 24 /* #define USE_VMALLOC */ 25 25 26 #if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 0) 27 /* 28 * sf_aops and sf_backing_dev_info are just quick implementations to make 29 * sendfile work. For more information have a look at 30 * 31 * http://us1.samba.org/samba/ftp/cifs-cvs/ols2006-fs-tutorial-smf.odp 32 * 33 * and the sample implementation 34 * 35 * http://pserver.samba.org/samba/ftp/cifs-cvs/samplefs.tar.gz 36 */ 37 static struct address_space_operations sf_aops = { 38 .readpage = simple_readpage, 39 .prepare_write = simple_prepare_write, 40 .commit_write = simple_commit_write, 41 }; 42 43 static struct backing_dev_info sf_backing_dev_info = { 44 .ra_pages = 0, /* No readahead */ 45 # if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 12) 46 .capabilities = BDI_CAP_MAP_DIRECT /* MAP_SHARED */ 47 | BDI_CAP_MAP_COPY /* MAP_PRIVATE */ 48 | BDI_CAP_READ_MAP /* can be mapped for reading */ 49 | BDI_CAP_WRITE_MAP /* can be mapped for writing */ 50 | BDI_CAP_EXEC_MAP, /* can be mapped for execution */ 51 # endif 52 }; 53 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 0) */ 54 26 55 #if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 0) 27 56 static void … … 76 105 mode |= mode_set (IXOTH); 77 106 #undef mode_set 107 108 #if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 0) 109 inode->i_mapping->a_ops = &sf_aops; 110 inode->i_mapping->backing_dev_info = &sf_backing_dev_info; 111 #endif 78 112 79 113 if (is_dir) { … … 95 129 inode->i_gid = sf_g->gid; 96 130 inode->i_size = info->cbObject; 97 #if LINUX_VERSION_CODE < KERNEL_VERSION (2,6,19) && !defined(KERNEL_FC6)131 #if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 19) && !defined(KERNEL_FC6) 98 132 inode->i_blksize = 4096; 99 133 #endif 100 #if LINUX_VERSION_CODE >= KERNEL_VERSION (2,4,11)134 #if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 4, 11) 101 135 inode->i_blkbits = 12; 102 136 #endif -
trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.h
r4909 r5984 118 118 #endif 119 119 120 #if LINUX_VERSION_CODE >= KERNEL_VERSION (2,6,19) || defined(KERNEL_FC6)120 #if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 19) || defined(KERNEL_FC6) 121 121 /* FC6 kernel 2.6.18, vanilla kernel 2.6.19+ */ 122 122 #define GET_INODE_INFO(i) ((struct sf_inode_info *) (i)->i_private)
Note:
See TracChangeset
for help on using the changeset viewer.