Function report |
Source Code:fs\locks.c |
Create Date:2022-07-28 20:25:30 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:revoke all outstanding leases on file
Proto:int __break_lease(struct inode *inode, unsigned int mode, unsigned int type)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct inode * | inode | |
unsigned int | mode | |
unsigned int | type |
1580 | error = 0 |
1584 | want_write = (mode & O_ACCMODE) != O_RDONLY |
1593 | ctx = smp_load_acquire( & i_flctx) |
1594 | If Not ctx Then |
1595 | WARN_ON_ONCE(1) |
1596 | Go to free_lock |
1599 | percpu_down_read( & file_rwsem) |
1602 | time_out_leases(inode, & dispose) |
1604 | If Not any_leases_conflict(inode, new_fl) Then Go to out |
1607 | break_time = 0 |
1608 | If lease_break_time > 0 Then |
1609 | break_time = jiffies + lease_break_time * HZ |
1610 | If break_time == 0 Then break_time++ |
1615 | If Not leases_conflict(fl, new_fl) Then Continue |
1617 | If want_write Then |
1618 | If fl_flags & Lease is being broken Then Continue |
1620 | fl_flags |= Lease is being broken |
1621 | for lease breaks: = break_time |
1622 | Else |
1623 | If lease_breaking(fl) Then Continue |
1625 | fl_flags |= Lease is being downgraded |
1626 | fl_downgrade_time = break_time |
1628 | If lm_break(fl) Then locks_delete_lock_ctx(fl, & dispose) |
1632 | If list_empty - tests whether a list is empty*@head: the list to test. Then Go to out |
1635 | If mode & O_NONBLOCK Then |
1641 | restart : |
1643 | break_time = for lease breaks: |
1644 | If break_time != 0 Then break_time -= jiffies |
1646 | If break_time == 0 Then break_time++ |
1649 | trace_break_lease_block(inode, new_fl) |
1650 | spin_unlock( & flc_lock) |
1651 | percpu_up_read( & file_rwsem) |
1653 | locks_dispose_list( & dispose) |
1657 | percpu_down_read( & file_rwsem) |
1659 | trace_break_lease_unblock(inode, new_fl) |
1661 | If error >= 0 Then |
1666 | If error == 0 Then time_out_leases(inode, & dispose) |
1668 | If any_leases_conflict(inode, new_fl) Then Go to restart |
1670 | error = 0 |
1672 | out : |
1673 | spin_unlock( & flc_lock) |
1674 | percpu_up_read( & file_rwsem) |
1675 | locks_dispose_list( & dispose) |
1676 | free_lock : |
1678 | Return error |
Name | Describe |
---|---|
break_lease | |
break_deleg | |
break_layout |
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 |