Changeset 77706 in vbox for trunk/src/VBox/Additions/linux/sharedfolders
- Timestamp:
- Mar 14, 2019 8:10:40 PM (6 years ago)
- Location:
- trunk/src/VBox/Additions/linux/sharedfolders
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/dirops.c
r77704 r77706 35 35 #include "vfsmod.h" 36 36 #include <iprt/err.h> 37 38 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0) 39 # define d_in_lookup(a_pDirEntry) (d_unhashed(a_pDirEntry)) 40 #endif 41 37 42 38 43 … … 903 908 * of that approach. The call combines the lookup and open. 904 909 */ 905 static int vbsf_inode_atomic_open(struct inode *pDirInode, struct dentry *dentry, struct file *file, unsigned fOpen, umode_t fMode) 910 static int vbsf_inode_atomic_open(struct inode *pDirInode, struct dentry *dentry, struct file *file, unsigned fOpen, 911 umode_t fMode 912 # if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) 913 , int *opened 914 # endif 915 ) 906 916 { 907 917 SFLOGFLOW(("vbsf_inode_atomic_open: pDirInode=%p dentry=%p file=%p fOpen=%#x, fMode=%#x\n", pDirInode, dentry, file, fOpen, fMode)); … … 952 962 * and call finish_open() to do the remaining open() work. 953 963 */ 964 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) 954 965 if (fCreated) 955 966 file->f_mode |= FMODE_CREATED; 956 967 rc = finish_open(file, dentry, generic_file_open); 968 # else 969 if (fCreated) 970 *opened |= FILE_CREATED; 971 rc = finish_open(file, dentry, generic_file_open, opened); 972 # endif 957 973 if (rc == 0) { 958 974 /* … … 1013 1029 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0) 1014 1030 static int vbsf_inode_create(struct inode *parent, struct dentry *dentry, umode_t mode, struct nameidata *nd) 1015 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)1031 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 75) 1016 1032 static int vbsf_inode_create(struct inode *parent, struct dentry *dentry, int mode, struct nameidata *nd) 1017 1033 #else … … 1019 1035 #endif 1020 1036 { 1021 /** @todo @a nd (struct nameidata) contains intent with partial open flags for 1022 * 2.6.0-3.5.999. In 3.6.0 atomic_open was introduced and stuff 1023 * changed (investigate)... */ 1037 uint32_t fCreateFlags = SHFL_CF_ACT_CREATE_IF_NEW 1038 | SHFL_CF_ACT_FAIL_IF_EXISTS 1039 | SHFL_CF_ACCESS_READWRITE; 1040 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 75) 1041 /* Clear the RD flag if write-only access requested. Otherwise assume we 1042 need write access to create stuff. */ 1043 if (!(nd->intent.open.flags & 1) ) { 1044 fCreateFlags &= SHFL_CF_ACCESS_READWRITE; 1045 fCreateFlags |= SHFL_CF_ACCESS_WRITE; 1046 } 1047 /* (file since 2.6.15) */ 1048 #endif 1024 1049 TRACE(); 1025 1050 AssertMsg(!(mode & S_IFMT) || (mode & S_IFMT) == S_IFREG, ("0%o\n", mode)); 1026 return vbsf_create_worker(parent, dentry, (mode & ~S_IFMT) | S_IFREG, 1027 SHFL_CF_ACT_CREATE_IF_NEW 1028 | SHFL_CF_ACT_FAIL_IF_EXISTS 1029 | SHFL_CF_ACCESS_READWRITE, 1051 return vbsf_create_worker(parent, dentry, (mode & ~S_IFMT) | S_IFREG, fCreateFlags, 1030 1052 true /*fStashHandle*/, false /*fDoLookup*/, NULL /*phHandle*/, NULL /*fCreated*/); 1031 1053 } -
trunk/src/VBox/Additions/linux/sharedfolders/regops.c
r77704 r77706 53 53 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) 54 54 # define SEEK_END 2 55 #endif 56 57 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) 58 # define iter_is_iovec(a_pIter) ( !((a_pIter)->type & (ITER_KVEC | ITER_BVEC)) ) 55 59 #endif 56 60 … … 1795 1799 /** @todo This should be handled by the host, it returning the new file 1796 1800 * offset when appending. We may have an outdated i_size value here! */ 1801 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0) 1797 1802 if (kio->ki_flags & IOCB_APPEND) 1803 #else 1804 if (kio->ki_filp->f_flags & O_APPEND) 1805 #endif 1798 1806 kio->ki_pos = offFile = i_size_read(inode); 1799 1807
Note:
See TracChangeset
for help on using the changeset viewer.