Changeset 77543 in vbox for trunk/src/VBox/Additions/linux/sharedfolders
- Timestamp:
- Mar 3, 2019 4:42:04 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/dirops.c
r77539 r77543 34 34 35 35 /** 36 * Open a directory .37 * 38 * @ param inode inode39 * @param file file40 * @ returns 0 on success, Linux error code otherwise36 * Open a directory (implements file_operations::open). 37 * 38 * @returns 0 on success, negative errno otherwise. 39 * @param inode inode 40 * @param file file 41 41 */ 42 42 static int vbsf_dir_open(struct inode *inode, struct file *file) 43 43 { 44 struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(inode->i_sb);45 struct vbsf_inode_info *sf_i = VBSF_GET_INODE_INFO(inode);44 struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(inode->i_sb); 45 struct vbsf_inode_info *sf_i = VBSF_GET_INODE_INFO(inode); 46 46 struct dentry *dentry = VBSF_GET_F_DENTRY(file); 47 47 struct vbsf_dir_info *sf_d; … … 98 98 file->private_data = sf_d; 99 99 VbglR0PhysHeapFree(pReq); 100 SFLOGFLOW(("vbsf_dir_open(%p,%p): returns 0; hHost=%#llx\n", inode, file, sf_d->Handle.hHost)); 100 101 return 0; 101 102 … … 123 124 } else 124 125 rc = -ENOMEM; 126 SFLOGFLOW(("vbsf_dir_open(%p,%p): returns %d\n", inode, file, rc)); 125 127 return rc; 126 128 } … … 140 142 struct vbsf_dir_info *sf_d = (struct vbsf_dir_info *)file->private_data; 141 143 142 TRACE();144 SFLOGFLOW(("vbsf_dir_release(%p,%p): sf_d=%p hHost=%#llx\n", inode, file, sf_d, sf_d ? sf_d->Handle.hHost : SHFL_HANDLE_NIL)); 143 145 144 146 if (sf_d) { … … 166 168 /** 167 169 * Translate RTFMODE into DT_xxx (in conjunction to rtDirType()). 168 * @param fMode file mode169 170 * returns d_type 170 */ 171 static int vbsf_get_d_type(RTFMODE fMode) 171 * @param fMode file mode 172 */ 173 DECLINLINE(int) vbsf_get_d_type(RTFMODE fMode) 172 174 { 173 175 switch (fMode & RTFS_TYPE_MASK) { … … 200 202 */ 201 203 if (sf_d->fNoMoreFiles) { 202 if (!fRestart) 204 if (!fRestart) { 205 SFLOGFLOW(("vbsf_dir_read_more: no more files\n")); 203 206 return 0; 207 } 204 208 sf_d->fNoMoreFiles = false; 205 209 } 206 207 210 208 211 /* … … 257 260 } else 258 261 rc = -ENOMEM; 262 SFLOGFLOW(("vbsf_dir_read_more: returns %d; cbValid=%#x cEntriesLeft=%#x fNoMoreFiles=%d\n", 263 rc, sf_d->cbValid, sf_d->cEntriesLeft, sf_d->fNoMoreFiles)); 259 264 return rc; 260 265 } … … 282 287 #endif 283 288 } 289 284 290 /* Assuming this is a buffer overflow issue, just silently skip it. */ 291 SFLOGFLOW(("vbsf_dir_emit_nls: vbsf_nlscopy failed with %d for '%s'\n", rc, pszSrcName)); 285 292 return true; 286 293 } … … 317 324 { 318 325 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) 319 loff_t offPos 320 #else 321 loff_t offPos 322 #endif 323 struct vbsf_dir_info *sf_d 324 struct vbsf_super_info *sf_g 326 loff_t offPos = ctx->pos; 327 #else 328 loff_t offPos = dir->f_pos; 329 #endif 330 struct vbsf_dir_info *sf_d = (struct vbsf_dir_info *)dir->private_data; 331 struct vbsf_super_info *sf_g = VBSF_GET_SUPER_INFO(VBSF_GET_F_DENTRY(dir)->d_sb); 325 332 int rc; 326 333
Note:
See TracChangeset
for help on using the changeset viewer.