Changeset 26102 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Jan 29, 2010 2:46:26 PM (15 years ago)
- Location:
- trunk/src/VBox/Additions/linux/sharedfolders
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/utils.c
r25637 r26102 28 28 /* #define USE_VMALLOC */ 29 29 30 #if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 0)31 30 /* 32 31 * sf_reg_aops and sf_backing_dev_info are just quick implementations to make … … 40 39 */ 41 40 42 static struct backing_dev_info sf_backing_dev_info = {43 .ra_pages = 0, /* No readahead */44 # if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 12)45 .capabilities = BDI_CAP_MAP_DIRECT /* MAP_SHARED */46 | BDI_CAP_MAP_COPY /* MAP_PRIVATE */47 | BDI_CAP_READ_MAP /* can be mapped for reading */48 | BDI_CAP_WRITE_MAP /* can be mapped for writing */49 | BDI_CAP_EXEC_MAP, /* can be mapped for execution */50 # endif51 };52 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 0) */53 54 41 #if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 0) 55 42 static void … … 121 108 #if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 0) 122 109 inode->i_mapping->a_ops = &sf_reg_aops; 123 inode->i_mapping->backing_dev_info = &sf_ backing_dev_info;110 inode->i_mapping->backing_dev_info = &sf_g->bdi; 124 111 #endif 125 112 … … 813 800 }; 814 801 815 void sf_init_backing_dev(void) 802 int sf_init_backing_dev(struct sf_glob_info *sf_g, const char *name) 803 { 804 int rc = 0; 805 806 #if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 0) 807 sf_g->bdi.ra_pages = 0; /* No readahead */ 808 # if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 12) 809 sf_g->bdi.capabilities = BDI_CAP_MAP_DIRECT /* MAP_SHARED */ 810 | BDI_CAP_MAP_COPY /* MAP_PRIVATE */ 811 | BDI_CAP_READ_MAP /* can be mapped for reading */ 812 | BDI_CAP_WRITE_MAP /* can be mapped for writing */ 813 | BDI_CAP_EXEC_MAP; /* can be mapped for execution */ 814 # endif /* >= 2.6.12 */ 815 # if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 24) 816 rc = bdi_init(&sf_g->bdi); 817 if (!rc) 818 rc = bdi_register(&sf_g->bdi, NULL, "vboxvfs-%s", name); 819 # endif /* >= 2.6.24 */ 820 #endif /* >= 2.6.0 */ 821 return rc; 822 } 823 824 void sf_done_backing_dev(struct sf_glob_info *sf_g) 816 825 { 817 826 #if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 24) 818 bdi_ init(&sf_backing_dev_info);819 #endif 820 } 827 bdi_destroy(&sf_g->bdi); 828 #endif 829 } -
trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c
r25637 r26102 287 287 } 288 288 289 if (sf_init_backing_dev(sf_g, info->name)) { 290 err = -EINVAL; 291 LogFunc(("could not init bdi\n")); 292 goto fail4; 293 } 294 289 295 sf_init_inode (sf_g, iroot, &fsinfo); 290 296 SET_INODE_INFO (iroot, sf_i); … … 298 304 err = -ENOMEM; /* XXX */ 299 305 LogFunc(("d_alloc_root failed\n")); 300 goto fail 4;306 goto fail5; 301 307 } 302 308 … … 305 311 return 0; 306 312 313 fail5: 314 sf_done_backing_dev(sf_g); 307 315 fail4: 308 316 iput (iroot); … … 372 380 sf_g = GET_GLOB_INFO (sb); 373 381 BUG_ON (!sf_g); 382 sf_done_backing_dev(sf_g); 374 383 sf_glob_free (sf_g); 375 384 } … … 468 477 } 469 478 470 sf_init_backing_dev();471 472 479 err = register_filesystem (&vboxsf_fs_type); 473 480 if (err) { -
trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.h
r25637 r26102 26 26 #include "version-generated.h" 27 27 28 #if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 0) 29 # include <linux/backing-dev.h> 30 #endif 31 28 32 #include "VBoxCalls.h" 29 33 #include "vbsfmount.h" … … 40 44 int dmask; 41 45 int fmask; 46 #if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 0) 47 struct backing_dev_info bdi; 48 #endif 42 49 }; 43 50 … … 108 115 sf_dir_read_all (struct sf_glob_info *sf_g, struct sf_inode_info *sf_i, 109 116 struct sf_dir_info *sf_d, SHFLHANDLE handle); 117 extern int 118 sf_init_backing_dev (struct sf_glob_info *sf_g, const char *name); 110 119 extern void 111 sf_ init_backing_dev(void);120 sf_done_backing_dev (struct sf_glob_info *sf_g); 112 121 113 122 #if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 0)
Note:
See TracChangeset
for help on using the changeset viewer.