- Timestamp:
- Mar 28, 2019 4:03:06 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/regops.c
r77939 r77940 41 41 # include <linux/buffer_head.h> 42 42 #endif 43 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) \44 && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 12)43 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 12) \ 44 && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) 45 45 # include <linux/writeback.h> 46 46 #endif … … 48 48 && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) 49 49 # include <linux/splice.h> 50 #endif 51 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) \ 52 && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) 53 # include <linux/pipe_fs_i.h> 50 54 #endif 51 55 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 10) … … 520 524 521 525 /********************************************************************************************************************************* 522 * Pipe / splice stuff for 2.6. 23>= linux < 2.6.31 (where no fallbacks were available) *526 * Pipe / splice stuff for 2.6.17 >= linux < 2.6.31 (where no fallbacks were available) * 523 527 *********************************************************************************************************************************/ 524 528 525 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) \529 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) \ 526 530 && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) 527 531 528 532 529 533 /** Verify pipe buffer content (needed for page-cache to ensure idle page). */ 530 static int vbsf_pipe_buf_confirm(struct pipe_inode_info * info, struct pipe_buffer *pPipeBuf)534 static int vbsf_pipe_buf_confirm(struct pipe_inode_info *pPipe, struct pipe_buffer *pPipeBuf) 531 535 { 532 536 /*SFLOG3(("vbsf_pipe_buf_confirm: %p\n", pPipeBuf));*/ … … 535 539 536 540 /** Maps the buffer page. */ 537 static void *vbsf_pipe_buf_map(struct pipe_inode_info *p ipe, struct pipe_buffer *pPipeBuf, int atomic)541 static void *vbsf_pipe_buf_map(struct pipe_inode_info *pPipe, struct pipe_buffer *pPipeBuf, int atomic) 538 542 { 539 543 void *pvRet; … … 549 553 550 554 /** Unmaps the buffer page. */ 551 static void vbsf_pipe_buf_unmap(struct pipe_inode_info *p ipe, struct pipe_buffer *pPipeBuf, void *pvMapping)555 static void vbsf_pipe_buf_unmap(struct pipe_inode_info *pPipe, struct pipe_buffer *pPipeBuf, void *pvMapping) 552 556 { 553 557 /*SFLOG3(("vbsf_pipe_buf_unmap: %p/%p\n", pPipeBuf, pvMapping)); */ … … 561 565 562 566 /** Gets a reference to the page. */ 563 static void vbsf_pipe_buf_get(struct pipe_inode_info *p ipe, struct pipe_buffer *pPipeBuf)567 static void vbsf_pipe_buf_get(struct pipe_inode_info *pPipe, struct pipe_buffer *pPipeBuf) 564 568 { 565 569 page_cache_get(pPipeBuf->page); … … 568 572 569 573 /** Release the buffer page (counter to vbsf_pipe_buf_get). */ 570 static void vbsf_pipe_buf_release(struct pipe_inode_info *p ipe, struct pipe_buffer *pPipeBuf)574 static void vbsf_pipe_buf_release(struct pipe_inode_info *pPipe, struct pipe_buffer *pPipeBuf) 571 575 { 572 576 /*SFLOG3(("vbsf_pipe_buf_release: %p (incoming count=%d)\n", pPipeBuf, page_count(pPipeBuf->page)));*/ … … 576 580 /** Attempt to steal the page. 577 581 * @returns 0 success, 1 on failure. */ 578 static int vbsf_pipe_buf_steal(struct pipe_inode_info *p ipe, struct pipe_buffer *pPipeBuf)582 static int vbsf_pipe_buf_steal(struct pipe_inode_info *pPipe, struct pipe_buffer *pPipeBuf) 579 583 { 580 584 if (page_count(pPipeBuf->page) == 1) { … … 604 608 }; 605 609 606 # define LOCK_PIPE( pipe) do { if ((pipe)->inode) mutex_lock(&(pipe)->inode->i_mutex); } while (0)607 # define UNLOCK_PIPE( pipe) do { if ((pipe)->inode) mutex_unlock(&(pipe)->inode->i_mutex); } while (0)610 # define LOCK_PIPE(a_pPipe) do { if ((a_pPipe)->inode) mutex_lock(&(a_pPipe)->inode->i_mutex); } while (0) 611 # define UNLOCK_PIPE(a_pPipe) do { if ((a_pPipe)->inode) mutex_unlock(&(a_pPipe)->inode->i_mutex); } while (0) 608 612 609 613 /** Waits for the pipe buffer status to change. */ … … 796 800 } 797 801 798 #endif /* 2.6. 23<= LINUX_VERSION_CODE < 2.6.31 */802 #endif /* 2.6.17 <= LINUX_VERSION_CODE < 2.6.31 */ 799 803 800 804 … … 2965 2969 .mmap = generic_file_mmap, 2966 2970 #endif 2967 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17)2971 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) 2968 2972 .splice_read = vbsf_splice_read, 2969 2973 /// @todo .splice_write = vbsf_splice_write,
Note:
See TracChangeset
for help on using the changeset viewer.