Changeset 76744 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Jan 9, 2019 4:29:03 PM (6 years ago)
- Location:
- trunk/src/VBox/Additions/linux/sharedfolders
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/dirops.c
r76733 r76744 1 1 /* $Id$ */ 2 2 /** @file 3 * vboxsf - VBox Linux Shared Folders VFS, directory inode and file operations 3 * vboxsf - VBox Linux Shared Folders VFS, directory inode and file operations. 4 4 */ 5 5 … … 352 352 .read = generic_read_dir 353 353 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) 354 ,.llseek = generic_file_llseek354 , .llseek = generic_file_llseek 355 355 #endif 356 356 }; … … 875 875 return err; 876 876 } 877 #endif 877 #endif /* LINUX_VERSION_CODE >= 2.6.0 */ 878 878 879 879 struct inode_operations sf_dir_iops = { -
trunk/src/VBox/Additions/linux/sharedfolders/lnkops.c
r76733 r76744 33 33 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) 34 34 35 # if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)36 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)35 # if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0) 36 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) 37 37 static const char *sf_follow_link(struct dentry *dentry, void **cookie) 38 # else38 # else 39 39 static void *sf_follow_link(struct dentry *dentry, struct nameidata *nd) 40 # endif40 # endif 41 41 { 42 42 struct inode *inode = dentry->d_inode; … … 57 57 } 58 58 } 59 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)59 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) 60 60 return error ? ERR_PTR(error) : (*cookie = path); 61 # else61 # else 62 62 nd_set_link(nd, error ? ERR_PTR(error) : path); 63 63 return NULL; 64 # endif64 # endif 65 65 } 66 66 67 # if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0)67 # if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) 68 68 static void sf_put_link(struct dentry *dentry, struct nameidata *nd, 69 69 void *cookie) … … 73 73 free_page((unsigned long)page); 74 74 } 75 # endif75 # endif 76 76 77 # else /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)*/77 # else /* LINUX_VERSION_CODE >= 4.5.0 */ 78 78 static const char *sf_get_link(struct dentry *dentry, struct inode *inode, 79 79 struct delayed_call *done) … … 100 100 return path; 101 101 } 102 # endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)*/102 # endif /* LINUX_VERSION_CODE >= 4.5.0 */ 103 103 104 104 struct inode_operations sf_lnk_iops = { 105 # if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)105 # if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) 106 106 .readlink = generic_readlink, 107 # endif108 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)107 # endif 108 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) 109 109 .get_link = sf_get_link 110 # elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)110 # elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) 111 111 .follow_link = sf_follow_link, 112 112 .put_link = free_page_put_link, 113 # else113 # else 114 114 .follow_link = sf_follow_link, 115 115 .put_link = sf_put_link 116 # endif116 # endif 117 117 }; 118 118 119 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)*/119 #endif /* LINUX_VERSION_CODE >= 2.6.0 */ -
trunk/src/VBox/Additions/linux/sharedfolders/regops.c
r76736 r76744 1 1 /* $Id$ */ 2 2 /** @file 3 * vboxsf - VBox Linux Shared Folders VFS, Regular file inode and file operations.3 * vboxsf - VBox Linux Shared Folders VFS, regular file inode and file operations. 4 4 */ 5 5 … … 102 102 } 103 103 104 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) &&\105 104 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) \ 105 && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) 106 106 107 107 void free_pipebuf(struct page *kpage) … … 254 254 } 255 255 256 #endif 256 #endif /* 2.6.23 <= LINUX_VERSION_CODE < 2.6.31 */ 257 257 258 258 /** … … 596 596 static struct page *sf_reg_nopage(struct vm_area_struct *vma, 597 597 unsigned long vaddr, int *type) 598 # define SET_TYPE(t) *type = (t)599 #else 598 # define SET_TYPE(t) *type = (t) 599 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) */ 600 600 static struct page *sf_reg_nopage(struct vm_area_struct *vma, 601 601 unsigned long vaddr, int unused) 602 # define SET_TYPE(t)602 # define SET_TYPE(t) 603 603 #endif 604 604 { … … 709 709 .mmap = sf_reg_mmap, 710 710 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) 711 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)711 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) 712 712 /** @todo This code is known to cause caching of data which should not be 713 713 * cached. Investigate. */ 714 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23)714 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) 715 715 .splice_read = sf_splice_read, 716 # else716 # else 717 717 .sendfile = generic_file_sendfile, 718 # endif718 # endif 719 719 .aio_read = generic_file_aio_read, 720 720 .aio_write = generic_file_aio_write, 721 # endif722 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)721 # endif 722 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) 723 723 .fsync = noop_fsync, 724 # else724 # else 725 725 .fsync = simple_sync_file, 726 # endif726 # endif 727 727 .llseek = generic_file_llseek, 728 728 #endif … … 739 739 740 740 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) 741 741 742 static int sf_readpage(struct file *file, struct page *page) 742 743 { … … 809 810 } 810 811 811 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) 812 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) 813 812 814 int sf_write_begin(struct file *file, struct address_space *mapping, loff_t pos, 813 815 unsigned len, unsigned flags, struct page **pagep, … … 848 850 849 851 unlock_page(page); 850 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)852 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) 851 853 put_page(page); 852 # else854 # else 853 855 page_cache_release(page); 854 # endif856 # endif 855 857 856 858 return nwritten; 857 859 } 858 860 859 # endif/* KERNEL_VERSION >= 2.6.24 */861 # endif /* KERNEL_VERSION >= 2.6.24 */ 860 862 861 863 struct address_space_operations sf_reg_aops = { 862 864 .readpage = sf_readpage, 863 865 .writepage = sf_writepage, 864 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)866 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) 865 867 .write_begin = sf_write_begin, 866 868 .write_end = sf_write_end, 867 # else869 # else 868 870 .prepare_write = simple_prepare_write, 869 871 .commit_write = simple_commit_write, 870 # endif872 # endif 871 873 }; 872 #endif 874 875 #endif /* LINUX_VERSION_CODE >= 2.6.0 */ 876 -
trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c
r76733 r76744 279 279 * correct limit but MAX_LFS_FILESIZE (8TB-1 on 32-bit boxes) takes the 280 280 * page cache into account and is the suggested limit. */ 281 # if defined MAX_LFS_FILESIZE281 # if defined MAX_LFS_FILESIZE 282 282 sb->s_maxbytes = MAX_LFS_FILESIZE; 283 # else283 # else 284 284 sb->s_maxbytes = 0x7fffffffffffffffULL; 285 # endif285 # endif 286 286 #endif 287 287 sb->s_op = &sf_super_ops; … … 384 384 SET_INODE_INFO(inode, NULL); 385 385 } 386 #else 386 #else /* LINUX_VERSION_CODE >= 2.6.36 */ 387 387 static void sf_evict_inode(struct inode *inode) 388 388 { … … 391 391 TRACE(); 392 392 truncate_inode_pages(&inode->i_data, 0); 393 # if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)393 # if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0) 394 394 clear_inode(inode); 395 # else395 # else 396 396 end_writeback(inode); 397 # endif397 # endif 398 398 399 399 sf_i = GET_INODE_INFO(inode); … … 406 406 SET_INODE_INFO(inode, NULL); 407 407 } 408 #endif 408 #endif /* LINUX_VERSION_CODE >= 2.6.36 */ 409 409 410 410 /* this is called by vfs when it wants to populate [inode] with data. … … 492 492 /*unlock_new_inode(iroot); */ 493 493 return 0; 494 #else 494 #else /* LINUX_VERSION_CODE < 2.4.23 */ 495 495 return -ENOSYS; 496 #endif 496 #endif /* LINUX_VERSION_CODE < 2.4.23 */ 497 497 } 498 498 … … 552 552 } 553 553 554 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)554 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) 555 555 static struct super_block *sf_get_sb(struct file_system_type *fs_type, 556 556 int flags, const char *dev_name, … … 560 560 return get_sb_nodev(fs_type, flags, data, sf_read_super_26); 561 561 } 562 # elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)562 # elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) 563 563 static int sf_get_sb(struct file_system_type *fs_type, int flags, 564 564 const char *dev_name, void *data, struct vfsmount *mnt) … … 567 567 return get_sb_nodev(fs_type, flags, data, sf_read_super_26, mnt); 568 568 } 569 # else569 # else /* LINUX_VERSION_CODE >= 2.6.39 */ 570 570 static struct dentry *sf_mount(struct file_system_type *fs_type, int flags, 571 571 const char *dev_name, void *data) … … 574 574 return mount_nodev(fs_type, flags, data, sf_read_super_26); 575 575 } 576 # endif576 # endif /* LINUX_VERSION_CODE >= 2.6.39 */ 577 577 578 578 static struct file_system_type vboxsf_fs_type = { 579 579 .owner = THIS_MODULE, 580 580 .name = "vboxsf", 581 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)581 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) 582 582 .get_sb = sf_get_sb, 583 # else583 # else 584 584 .mount = sf_mount, 585 # endif585 # endif 586 586 .kill_sb = kill_anon_super 587 587 }; 588 #endif 588 589 #endif /* LINUX_VERSION_CODE >= 2.6.0 */ 589 590 590 591 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
Note:
See TracChangeset
for help on using the changeset viewer.