Changeset 77515 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Feb 28, 2019 10:35:07 PM (6 years ago)
- Location:
- trunk/src/VBox/Additions/linux/sharedfolders
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/regops.c
r77492 r77515 50 50 # define SEEK_END 2 51 51 #endif 52 53 54 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)55 56 /*57 * inode compatibility glue.58 */59 #include <iprt/asm.h>60 61 DECLINLINE(loff_t) i_size_read(struct inode *inode)62 {63 AssertCompile(sizeof(loff_t) == sizeof(uint64_t));64 return ASMAtomicReadU64((uint64_t volatile *)&inode->i_size);65 }66 67 DECLINLINE(void) i_size_write(struct inode *inode, loff_t i_size)68 {69 AssertCompile(sizeof(inode->i_size) == sizeof(uint64_t));70 ASMAtomicWriteU64((uint64_t volatile *)&inode->i_size, i_size);71 }72 73 #endif /* < 2.6.0 */74 52 75 53 … … 1181 1159 case SEEK_END: { 1182 1160 struct sf_reg_info *sf_r = file->private_data; 1183 int rc = sf_inode_revalidate_with_handle(GET_F_DENTRY(file), sf_r->Handle.hHost, true /*fForce*/); 1161 int rc = sf_inode_revalidate_with_handle(GET_F_DENTRY(file), sf_r->Handle.hHost, true /*fForce*/, 1162 false /*fInodeLocked*/); 1184 1163 if (rc == 0) 1185 1164 break; -
trunk/src/VBox/Additions/linux/sharedfolders/utils.c
r77505 r77515 37 37 #include <linux/vfs.h> 38 38 39 /* 40 * sf_reg_aops and sf_backing_dev_info are just quick implementations to make 41 * sendfile work. For more information have a look at 39 40 /** 41 * Convert from VBox to linux time. 42 */ 43 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) 44 DECLINLINE(void) sf_ftime_from_timespec(time_t *pLinuxDst, PCRTTIMESPEC pVBoxSrc) 45 { 46 int64_t t = RTTimeSpecGetNano(pVBoxSrc); 47 do_div(t, RT_NS_1SEC); 48 *pLinuxDst = t; 49 } 50 #else /* >= 2.6.0 */ 51 # if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0) 52 DECLINLINE(void) sf_ftime_from_timespec(struct timespec *pLinuxDst, PCRTTIMESPEC pVBoxSrc) 53 # else 54 DECLINLINE(void) sf_ftime_from_timespec(struct timespec64 *pLinuxDst, PCRTTIMESPEC pVBoxSrc) 55 # endif 56 { 57 int64_t t = RTTimeSpecGetNano(pVBoxSrc); 58 pLinuxDst->tv_nsec = do_div(t, RT_NS_1SEC); 59 pLinuxDst->tv_sec = t; 60 } 61 #endif /* >= 2.6.0 */ 62 63 64 /** 65 * Convert from linux to VBox time. 66 */ 67 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) 68 DECLINLINE(void) sf_timespec_from_ftime(PRTTIMESPEC pVBoxDst, time_t *pLinuxSrc) 69 { 70 RTTimeSpecSetNano(pVBoxDst, RT_NS_1SEC_64 * *pLinuxSrc); 71 } 72 #else /* >= 2.6.0 */ 73 # if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0) 74 DECLINLINE(void) sf_timespec_from_ftime(PRTTIMESPEC pVBoxDst, struct timespec const *pLinuxSrc) 75 # else 76 DECLINLINE(void) sf_timespec_from_ftime(PRTTIMESPEC pVBoxDst, struct timespec64 const *pLinuxSrc) 77 # endif 78 { 79 RTTimeSpecSetNano(pVBoxDst, pLinuxSrc->tv_nsec + pLinuxSrc->tv_sec * (int64_t)RT_NS_1SEC); 80 } 81 #endif /* >= 2.6.0 */ 82 83 84 /** 85 * Converts VBox access permissions to Linux ones (mode & 0777). 42 86 * 43 * http://us1.samba.org/samba/ftp/cifs-cvs/ols2006-fs-tutorial-smf.odp 44 * 45 * and the sample implementation 46 * 47 * http://pserver.samba.org/samba/ftp/cifs-cvs/samplefs.tar.gz 48 */ 49 50 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) 51 52 DECLINLINE(void) sf_ftime_from_timespec(time_t * time, RTTIMESPEC *ts) 53 { 54 int64_t t = RTTimeSpecGetNano(ts); 55 do_div(t, RT_NS_1SEC); 56 *time = t; 57 } 58 59 DECLINLINE(void) sf_timespec_from_ftime(RTTIMESPEC * ts, time_t *time) 60 { 61 RTTimeSpecSetNano(ts, RT_NS_1SEC_64 * *time); 62 } 63 64 #else /* >= 2.6.0 */ 65 66 # if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0) 67 DECLINLINE(void) sf_ftime_from_timespec(struct timespec *tv, RTTIMESPEC *ts) 68 # else 69 DECLINLINE(void) sf_ftime_from_timespec(struct timespec64 *tv, RTTIMESPEC *ts) 70 # endif 71 { 72 int64_t t = RTTimeSpecGetNano(ts); 73 tv->tv_nsec = do_div(t, RT_NS_1SEC); 74 tv->tv_sec = t; 75 } 76 77 # if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0) 78 DECLINLINE(void) sf_timespec_from_ftime(RTTIMESPEC *ts, struct timespec *tv) 79 # else 80 DECLINLINE(void) sf_timespec_from_ftime(RTTIMESPEC *ts, struct timespec64 *tv) 81 # endif 82 { 83 RTTimeSpecSetNano(ts, tv->tv_nsec + tv->tv_sec * (int64_t)RT_NS_1SEC); 84 } 85 86 #endif /* >= 2.6.0 */ 87 88 /* set [inode] attributes based on [info], uid/gid based on [sf_g] */ 89 void sf_init_inode(struct inode *inode, struct sf_inode_info *sf_i, PSHFLFSOBJINFO info, struct sf_glob_info *sf_g) 90 { 91 PCSHFLFSOBJATTR attr = &info->Attr; 92 int mode; 87 * @note Currently identical. 88 */ 89 DECLINLINE(int) sf_convert_access_perms(uint32_t fAttr) 90 { 91 /* Access bits should be the same: */ 92 AssertCompile(RTFS_UNIX_IRUSR == S_IRUSR); 93 AssertCompile(RTFS_UNIX_IWUSR == S_IWUSR); 94 AssertCompile(RTFS_UNIX_IXUSR == S_IXUSR); 95 AssertCompile(RTFS_UNIX_IRGRP == S_IRGRP); 96 AssertCompile(RTFS_UNIX_IWGRP == S_IWGRP); 97 AssertCompile(RTFS_UNIX_IXGRP == S_IXGRP); 98 AssertCompile(RTFS_UNIX_IROTH == S_IROTH); 99 AssertCompile(RTFS_UNIX_IWOTH == S_IWOTH); 100 AssertCompile(RTFS_UNIX_IXOTH == S_IXOTH); 101 102 return fAttr & RTFS_UNIX_ALL_ACCESS_PERMS; 103 } 104 105 106 /** 107 * Produce the Linux mode mask, given VBox, mount options and file type. 108 */ 109 DECLINLINE(int) sf_convert_file_mode(uint32_t fVBoxMode, int fFixedMode, int fClearMask, int fType) 110 { 111 int fLnxMode = sf_convert_access_perms(fVBoxMode); 112 if (fFixedMode != ~0) 113 fLnxMode = fFixedMode & 0777; 114 fLnxMode &= ~fClearMask; 115 fLnxMode |= fType; 116 return fLnxMode; 117 } 118 119 120 /** 121 * Initializes the @a inode attributes based on @a pObjInfo and @a sf_g options. 122 */ 123 void sf_init_inode(struct inode *inode, struct sf_inode_info *sf_i, PSHFLFSOBJINFO pObjInfo, struct sf_glob_info *sf_g) 124 { 125 PCSHFLFSOBJATTR pAttr = &pObjInfo->Attr; 93 126 94 127 TRACE(); … … 96 129 sf_i->ts_up_to_date = jiffies; 97 130 sf_i->force_restat = 0; 98 99 #define mode_set(r) attr->fMode & (RTFS_UNIX_##r) ? (S_##r) : 0;100 mode = mode_set(IRUSR);101 mode |= mode_set(IWUSR);102 mode |= mode_set(IXUSR);103 104 mode |= mode_set(IRGRP);105 mode |= mode_set(IWGRP);106 mode |= mode_set(IXGRP);107 108 mode |= mode_set(IROTH);109 mode |= mode_set(IWOTH);110 mode |= mode_set(IXOTH);111 112 #undef mode_set113 131 114 132 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) … … 118 136 # endif 119 137 #endif 120 121 if (RTFS_IS_DIRECTORY(attr->fMode)) { 122 inode->i_mode = sf_g->dmode != ~0 ? (sf_g->dmode & 0777) : mode; 123 inode->i_mode &= ~sf_g->dmask; 124 inode->i_mode |= S_IFDIR; 138 if (RTFS_IS_DIRECTORY(pAttr->fMode)) { 139 inode->i_mode = sf_convert_file_mode(pAttr->fMode, sf_g->dmode, sf_g->dmask, S_IFDIR); 125 140 inode->i_op = &sf_dir_iops; 126 141 inode->i_fop = &sf_dir_fops; 142 127 143 /* XXX: this probably should be set to the number of entries 128 144 in the directory plus two (. ..) */ 129 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)130 145 set_nlink(inode, 1); 131 #else132 inode->i_nlink = 1;133 #endif134 146 } 135 147 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 8) 136 else if (RTFS_IS_SYMLINK( attr->fMode)) {137 inode->i_mode = sf_g->fmode != ~0 ? (sf_g->fmode & 0777) : mode;138 inode->i_mode &= ~sf_g->fmask;139 inode->i_mode |= S_IFLNK;148 else if (RTFS_IS_SYMLINK(pAttr->fMode)) { 149 /** @todo r=bird: Aren't System V symlinks w/o any mode mask? IIRC there is 150 * no lchmod on Linux. */ 151 inode->i_mode = sf_convert_file_mode(pAttr->fMode, sf_g->fmode, sf_g->fmask, S_IFLNK); 140 152 inode->i_op = &sf_lnk_iops; 141 # if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)142 153 set_nlink(inode, 1); 143 # else144 inode->i_nlink = 1;145 # endif146 154 } 147 155 #endif 148 156 else { 149 inode->i_mode = sf_g->fmode != ~0 ? (sf_g->fmode & 0777) : mode; 150 inode->i_mode &= ~sf_g->fmask; 151 inode->i_mode |= S_IFREG; 157 inode->i_mode = sf_convert_file_mode(pAttr->fMode, sf_g->fmode, sf_g->fmask, S_IFREG); 152 158 inode->i_op = &sf_reg_iops; 153 159 inode->i_fop = &sf_reg_fops; 154 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)155 160 set_nlink(inode, 1); 156 #else157 inode->i_nlink = 1;158 #endif159 161 } 160 162 … … 167 169 #endif 168 170 169 inode->i_size = info->cbObject;171 inode->i_size = pObjInfo->cbObject; 170 172 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) && !defined(KERNEL_FC6) 171 173 inode->i_blksize = 4096; … … 175 177 #endif 176 178 /* i_blocks always in units of 512 bytes! */ 177 inode->i_blocks = (info->cbAllocated + 511) / 512; 178 179 sf_ftime_from_timespec(&inode->i_atime, &info->AccessTime); 180 sf_ftime_from_timespec(&inode->i_ctime, &info->ChangeTime); 181 sf_ftime_from_timespec(&inode->i_mtime, &info->ModificationTime); 179 inode->i_blocks = (pObjInfo->cbAllocated + 511) / 512; 180 181 sf_ftime_from_timespec(&inode->i_atime, &pObjInfo->AccessTime); 182 sf_ftime_from_timespec(&inode->i_ctime, &pObjInfo->ChangeTime); 183 sf_ftime_from_timespec(&inode->i_mtime, &pObjInfo->ModificationTime); 184 sf_i->BirthTime = pObjInfo->BirthTime; 182 185 } 183 186 184 187 /** 185 188 * Update the inode with new object info from the host. 186 */ 187 void sf_update_inode(struct inode *pInode, struct sf_inode_info *pInfoInfo, PSHFLFSOBJINFO pObjInfo, struct sf_glob_info *sf_g) 188 { 189 /** @todo make lock/rcu safe. */ 190 sf_init_inode(pInode, pInfoInfo, pObjInfo, sf_g); 189 * 190 * Called by sf_inode_revalidate() and sf_inode_revalidate_with_handle(), the 191 * inode is probably locked... 192 * 193 * @todo sort out the inode locking situation. 194 */ 195 static void sf_update_inode(struct inode *pInode, struct sf_inode_info *pInodeInfo, PSHFLFSOBJINFO pObjInfo, 196 struct sf_glob_info *sf_g, bool fInodeLocked) 197 { 198 PCSHFLFSOBJATTR pAttr = &pObjInfo->Attr; 199 int fMode; 200 201 TRACE(); 202 203 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) 204 if (!fInodeLocked) 205 inode_lock(pInode); 206 #endif 207 208 /* 209 * Calc new mode mask and update it if it changed. 210 */ 211 if (RTFS_IS_DIRECTORY(pAttr->fMode)) 212 fMode = sf_convert_file_mode(pAttr->fMode, sf_g->dmode, sf_g->dmask, S_IFDIR); 213 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 8) 214 else if (RTFS_IS_SYMLINK(pAttr->fMode)) 215 /** @todo r=bird: Aren't System V symlinks w/o any mode mask? IIRC there is 216 * no lchmod on Linux. */ 217 fMode = sf_convert_file_mode(pAttr->fMode, sf_g->fmode, sf_g->fmask, S_IFLNK); 218 #endif 219 else 220 fMode = sf_convert_file_mode(pAttr->fMode, sf_g->fmode, sf_g->fmask, S_IFREG); 221 222 if (fMode == pInode->i_mode) { 223 /* likely */ 224 } else { 225 if ((fMode & S_IFMT) == (pInode->i_mode & S_IFMT)) 226 pInode->i_mode = fMode; 227 else { 228 SFLOGFLOW(("sf_update_inode: Changed from %o to %o (%s)\n", 229 pInode->i_mode & S_IFMT, fMode & S_IFMT, pInodeInfo->path->String.ach)); 230 /** @todo we probably need to be more drastic... */ 231 sf_init_inode(pInode, pInodeInfo, pObjInfo, sf_g); 232 233 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) 234 if (!fInodeLocked) 235 inode_unlock(pInode); 236 #endif 237 return; 238 } 239 } 240 241 /* 242 * Update the sizes. 243 * Note! i_blocks is always in units of 512 bytes! 244 */ 245 pInode->i_blocks = (pObjInfo->cbAllocated + 511) / 512; 246 i_size_write(pInode, pObjInfo->cbObject); 247 248 /* 249 * Update the timestamps. 250 */ 251 sf_ftime_from_timespec(&pInode->i_atime, &pObjInfo->AccessTime); 252 sf_ftime_from_timespec(&pInode->i_ctime, &pObjInfo->ChangeTime); 253 sf_ftime_from_timespec(&pInode->i_mtime, &pObjInfo->ModificationTime); 254 pInodeInfo->BirthTime = pObjInfo->BirthTime; 255 256 /* 257 * Mark it as up to date. 258 */ 259 pInodeInfo->ts_up_to_date = jiffies; 260 pInodeInfo->force_restat = 0; 261 262 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) 263 if (!fInodeLocked) 264 inode_unlock(pInode); 265 #endif 191 266 } 192 267 … … 235 310 236 311 /** 237 * Revalidate an inode .312 * Revalidate an inode, inner worker. 238 313 * 239 * This is called directly as inode-op on 2.4, indirectly as dir-op 240 * sf_dentry_revalidate() on 2.4/2.6, indirectly as inode-op through 241 * sf_getattr() on 2.6. The job is to find out whether dentry/inode is still 242 * valid. The test fails if @a dentry does not have an inode or sf_stat() is 243 * unsuccessful, otherwise we return success and update inode attributes. 244 */ 245 int sf_inode_revalidate(struct dentry *dentry) 314 * @sa sf_inode_revalidate() 315 */ 316 int sf_inode_revalidate_worker(struct dentry *dentry, bool fForced) 246 317 { 247 318 int rc; … … 256 327 * Can we get away without any action here? 257 328 */ 258 if ( !sf_i->force_restat 329 if ( !fForced 330 && !sf_i->force_restat 259 331 && jiffies - sf_i->ts_up_to_date < sf_g->ttl) 260 332 rc = 0; … … 275 347 * Reset the TTL and copy the info over into the inode structure. 276 348 */ 277 sf_update_inode(pInode, sf_i, &pReq->ObjInfo, sf_g );349 sf_update_inode(pInode, sf_i, &pReq->ObjInfo, sf_g, true /*fInodeLocked??*/); 278 350 } else if (rc == VERR_INVALID_HANDLE) { 279 351 rc = -ENOENT; /* Restore.*/ … … 285 357 } else 286 358 rc = -ENOMEM; 287 sf_handle_release(pHandle, sf_g, "sf_inode_revalidate ");359 sf_handle_release(pHandle, sf_g, "sf_inode_revalidate_worker"); 288 360 289 361 } else { … … 303 375 * Reset the TTL and copy the info over into the inode structure. 304 376 */ 305 sf_update_inode(pInode, sf_i, &pReq->CreateParms.Info, sf_g); 377 sf_update_inode(pInode, sf_i, &pReq->CreateParms.Info, 378 sf_g, true /*fInodeLocked??*/); 306 379 rc = 0; 307 380 } else { … … 327 400 } 328 401 402 403 /** 404 * Revalidate an inode. 405 * 406 * This is called directly as inode-op on 2.4, indirectly as dir-op 407 * sf_dentry_revalidate() on 2.4/2.6. The job is to find out whether 408 * dentry/inode is still valid. The test fails if @a dentry does not have an 409 * inode or sf_stat() is unsuccessful, otherwise we return success and update 410 * inode attributes. 411 */ 412 int sf_inode_revalidate(struct dentry *dentry) 413 { 414 return sf_inode_revalidate_worker(dentry, false /*fForced*/); 415 } 416 417 329 418 /** 330 419 * Similar to sf_inode_revalidate, but uses associated host file handle as that 331 420 * is quite a bit faster. 332 421 */ 333 int sf_inode_revalidate_with_handle(struct dentry *dentry, SHFLHANDLE hHostFile, bool fForced )422 int sf_inode_revalidate_with_handle(struct dentry *dentry, SHFLHANDLE hHostFile, bool fForced, bool fInodeLocked) 334 423 { 335 424 int err; … … 363 452 * Reset the TTL and copy the info over into the inode structure. 364 453 */ 365 sf_update_inode(pInode, sf_i, &pReq->ObjInfo, sf_g );454 sf_update_inode(pInode, sf_i, &pReq->ObjInfo, sf_g, fInodeLocked); 366 455 } else { 367 456 LogFunc(("VbglR0SfHostReqQueryObjInfo failed on %#RX64: %Rrc\n", hHostFile, err)); … … 400 489 # endif 401 490 402 rc = sf_inode_revalidate(dentry); 491 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) 492 /* 493 * With the introduction of statx() userland can control whether we 494 * update the inode information or not. 495 */ 496 switch (flags & AT_STATX_SYNC_TYPE) { 497 default: 498 rc = sf_inode_revalidate_worker(dentry, false /*fForced*/); 499 break; 500 501 case AT_STATX_FORCE_SYNC: 502 rc = sf_inode_revalidate_worker(dentry, true /*fForced*/); 503 break; 504 505 case AT_STATX_DONT_SYNC: 506 rc = 0; 507 break; 508 } 509 # else 510 rc = sf_inode_revalidate_worker(dentry, false /*fForced*/); 511 # endif 403 512 if (rc == 0) { 513 /* Do generic filling in of info. */ 404 514 generic_fillattr(dentry->d_inode, kstat); 515 516 /* Add birth time. */ 517 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) 518 if (dentry->d_inode) { 519 struct sf_inode_info *pInodeInfo = GET_INODE_INFO(dentry->d_inode); 520 if (pInodeInfo) { 521 sf_ftime_from_timespec(&kstat->btime, &pInodeInfo->BirthTime); 522 kstat->result_mask |= STATX_BTIME; 523 } 524 } 525 #endif 405 526 406 527 /* … … 554 675 * dentry and all its parent entries are valid and could touch their timestamps 555 676 * extending their TTL (CIFS does that). */ 556 sf_i->force_restat = 1; /* temp fix */ 557 return sf_inode_revalidate(dentry); 677 return sf_inode_revalidate_worker(dentry, true /*fForced*/); 558 678 559 679 fail1: … … 975 1095 * This is called during name resolution/lookup to check if the @a dentry in the 976 1096 * cache is still valid. The actual validation is job is handled by 977 * sf_inode_revalidate ().1097 * sf_inode_revalidate_worker(). 978 1098 */ 979 1099 static int … … 1029 1149 SFLOGFLOW(("sf_dentry_revalidate: age: %lu vs. TTL %lu -> 1\n", cJiffiesAge, sf_g->ttl)); 1030 1150 rc = 1; 1031 } else if (!sf_inode_revalidate (dentry /** @todo force*/)) {1151 } else if (!sf_inode_revalidate_worker(dentry, true /*fForced*/)) { 1032 1152 sf_dentry_set_update_jiffies(dentry, jiffies); /** @todo get jiffies from inode. */ 1033 1153 SFLOGFLOW(("sf_dentry_revalidate: age: %lu vs. TTL %lu -> reval -> 1\n", cJiffiesAge, sf_g->ttl)); … … 1079 1199 1080 1200 /** For logging purposes only. */ 1201 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38) 1081 1202 static int sf_dentry_delete(const struct dentry *pDirEntry) 1203 # else 1204 static int sf_dentry_delete(struct dentry *pDirEntry) 1205 # endif 1082 1206 { 1083 1207 SFLOGFLOW(("sf_dentry_delete: %p\n", pDirEntry)); -
trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c
r77502 r77515 31 31 /** 32 32 * @note Anyone wishing to make changes here might wish to take a look at 33 * 33 * https://github.com/torvalds/linux/blob/master/Documentation/filesystems/vfs.txt 34 34 * which seems to be the closest there is to official documentation on 35 35 * writing filesystem drivers for Linux. 36 * 37 * See also: http://us1.samba.org/samba/ftp/cifs-cvs/ols2006-fs-tutorial-smf.odp 36 38 */ 37 39 -
trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.h
r77492 r77515 52 52 #include <VBox/VBoxGuestLibSharedFolders.h> 53 53 #include <VBox/VBoxGuestLibSharedFoldersInline.h> 54 #include <iprt/asm.h> 54 55 #include "vbsfmount.h" 56 57 58 /* 59 * inode compatibility glue. 60 */ 61 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) 62 63 DECLINLINE(loff_t) i_size_read(struct inode *pInode) 64 { 65 AssertCompile(sizeof(loff_t) == sizeof(uint64_t)); 66 return ASMAtomicReadU64((uint64_t volatile *)&pInode->i_size); 67 } 68 69 DECLINLINE(void) i_size_write(struct inode *pInode, loff_t cbNew) 70 { 71 AssertCompile(sizeof(pInode->i_size) == sizeof(uint64_t)); 72 ASMAtomicWriteU64((uint64_t volatile *)&pInode->i_size, cbNew); 73 } 74 75 #endif /* < 2.6.0 */ 76 77 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) 78 DECLINLINE(void) set_nlink(struct inode *pInode, unsigned int cLinks) 79 { 80 pInode->i_nlink = cLinks; 81 } 82 #endif 83 55 84 56 85 #define DIR_BUFFER_SIZE (16*_1K) … … 121 150 SHFLSTRING *path; 122 151 /** Some information was changed, update data on next revalidate */ 123 intforce_restat;152 bool force_restat; 124 153 /** directory content changed, update the whole directory on next sf_getdent */ 125 intforce_reread;154 bool force_reread; 126 155 /** The timestamp (jiffies) where the inode info was last updated. */ 127 unsigned long ts_up_to_date; 156 unsigned long ts_up_to_date; 157 /** The birth time. */ 158 RTTIMESPEC BirthTime; 128 159 129 160 /** handle valid if a file was created with sf_create_aux until it will … … 265 296 SHFLSTRING * path, PSHFLFSOBJINFO result, int ok_to_fail); 266 297 extern int sf_inode_revalidate(struct dentry *dentry); 267 int sf_inode_revalidate_with_handle(struct dentry *dentry, SHFLHANDLE hHostFile, bool fForced); 298 extern int sf_inode_revalidate_worker(struct dentry *dentry, bool fForced); 299 extern int sf_inode_revalidate_with_handle(struct dentry *dentry, SHFLHANDLE hHostFile, bool fForced, bool fInodeLocked); 268 300 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) 269 301 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
Note:
See TracChangeset
for help on using the changeset viewer.