Function report |
Source Code:fs\pipe.c |
Create Date:2022-07-28 20:04:29 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:pipe_write
Proto:static ssize_t pipe_write(struct kiocb *iocb, struct iov_iter *from)
Type:ssize_t
Parameter:
Type | Parameter | Name |
---|---|---|
struct kiocb * | iocb | |
struct iov_iter * | from |
436 | ret = 0 |
437 | total_len = iov_iter_count(from) |
439 | bool was_empty = false |
442 | If Value for the false possibility is greater at compile time(total_len == 0) Then Return 0 |
445 | __pipe_lock(pipe) |
447 | If Not readers Then |
465 | was_empty = pipe_empty - Return true if the pipe is empty*@head: The pipe ring head pointer*@tail: The pipe ring tail pointer |
472 | If pipe_buf_can_merge(buf) && offset + chars <= PAGE_SIZE Then |
489 | cycle |
490 | If Not readers Then |
504 | If Not page Then |
505 | page = alloc_page(GFP_HIGHUSER | __GFP_ACCOUNT) |
518 | spin_lock_irq( & lock) |
522 | spin_unlock_irq( & lock) |
523 | Continue |
527 | spin_unlock_irq( & lock) |
533 | offset = 0 |
534 | len = 0 |
535 | flags = 0 |
536 | If is_packetized(filp) Then |
537 | ops = packet_pipe_buf_ops |
538 | flags = ad() as a packet |
540 | tmp_page = NULL |
542 | copied = copy_page_from_iter(page, 0, PAGE_SIZE, from) |
543 | If Value for the false possibility is greater at compile time(copied < PAGE_SIZE && iov_iter_count(from)) Then |
549 | offset = 0 |
552 | If Not iov_iter_count(from) Then Break |
556 | If Not pipe_full - Return true if the pipe is full*@head: The pipe ring head pointer*@tail: The pipe ring tail pointer*@limit: The maximum amount of slots available. Then Continue |
560 | If f_flags & O_NONBLOCK Then |
565 | If signal_pending(current process) Then |
568 | Break |
577 | __pipe_unlock(pipe) |
578 | If was_empty Then |
583 | __pipe_lock(pipe) |
586 | out : |
587 | __pipe_unlock(pipe) |
598 | If was_empty Then |
602 | If ret > 0 && sb_start_write_trylock(i_sb) Then |
603 | err = file_update_time(filp) |
608 | Return ret |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |