• Home
  • Raw
  • Download

Lines Matching refs:ctx

251 	struct file_lock_context *ctx;  in locks_get_lock_context()  local
254 ctx = smp_load_acquire(&inode->i_flctx); in locks_get_lock_context()
255 if (likely(ctx) || type == F_UNLCK) in locks_get_lock_context()
258 ctx = kmem_cache_alloc(flctx_cache, GFP_KERNEL); in locks_get_lock_context()
259 if (!ctx) in locks_get_lock_context()
262 spin_lock_init(&ctx->flc_lock); in locks_get_lock_context()
263 INIT_LIST_HEAD(&ctx->flc_flock); in locks_get_lock_context()
264 INIT_LIST_HEAD(&ctx->flc_posix); in locks_get_lock_context()
265 INIT_LIST_HEAD(&ctx->flc_lease); in locks_get_lock_context()
271 if (cmpxchg(&inode->i_flctx, NULL, ctx)) { in locks_get_lock_context()
272 kmem_cache_free(flctx_cache, ctx); in locks_get_lock_context()
273 ctx = smp_load_acquire(&inode->i_flctx); in locks_get_lock_context()
276 trace_locks_get_lock_context(inode, type, ctx); in locks_get_lock_context()
277 return ctx; in locks_get_lock_context()
293 struct file_lock_context *ctx = inode->i_flctx; in locks_check_ctx_lists() local
295 if (unlikely(!list_empty(&ctx->flc_flock) || in locks_check_ctx_lists()
296 !list_empty(&ctx->flc_posix) || in locks_check_ctx_lists()
297 !list_empty(&ctx->flc_lease))) { in locks_check_ctx_lists()
301 locks_dump_ctx_list(&ctx->flc_flock, "FLOCK"); in locks_check_ctx_lists()
302 locks_dump_ctx_list(&ctx->flc_posix, "POSIX"); in locks_check_ctx_lists()
303 locks_dump_ctx_list(&ctx->flc_lease, "LEASE"); in locks_check_ctx_lists()
326 struct file_lock_context *ctx = inode->i_flctx; in locks_free_lock_context() local
328 if (unlikely(ctx)) { in locks_free_lock_context()
330 kmem_cache_free(flctx_cache, ctx); in locks_free_lock_context()
955 struct file_lock_context *ctx; in posix_test_lock() local
958 ctx = smp_load_acquire(&inode->i_flctx); in posix_test_lock()
959 if (!ctx || list_empty_careful(&ctx->flc_posix)) { in posix_test_lock()
964 spin_lock(&ctx->flc_lock); in posix_test_lock()
965 list_for_each_entry(cfl, &ctx->flc_posix, fl_list) { in posix_test_lock()
973 spin_unlock(&ctx->flc_lock); in posix_test_lock()
1063 struct file_lock_context *ctx; in flock_lock_inode() local
1068 ctx = locks_get_lock_context(inode, request->fl_type); in flock_lock_inode()
1069 if (!ctx) { in flock_lock_inode()
1082 spin_lock(&ctx->flc_lock); in flock_lock_inode()
1086 list_for_each_entry(fl, &ctx->flc_flock, fl_list) { in flock_lock_inode()
1103 list_for_each_entry(fl, &ctx->flc_flock, fl_list) { in flock_lock_inode()
1117 locks_insert_lock_ctx(new_fl, &ctx->flc_flock); in flock_lock_inode()
1122 spin_unlock(&ctx->flc_lock); in flock_lock_inode()
1139 struct file_lock_context *ctx; in posix_lock_inode() local
1144 ctx = locks_get_lock_context(inode, request->fl_type); in posix_lock_inode()
1145 if (!ctx) in posix_lock_inode()
1162 spin_lock(&ctx->flc_lock); in posix_lock_inode()
1169 list_for_each_entry(fl, &ctx->flc_posix, fl_list) { in posix_lock_inode()
1204 list_for_each_entry(fl, &ctx->flc_posix, fl_list) { in posix_lock_inode()
1210 list_for_each_entry_safe_from(fl, tmp, &ctx->flc_posix, fl_list) { in posix_lock_inode()
1339 spin_unlock(&ctx->flc_lock); in posix_lock_inode()
1411 struct file_lock_context *ctx; in locks_mandatory_locked() local
1414 ctx = smp_load_acquire(&inode->i_flctx); in locks_mandatory_locked()
1415 if (!ctx || list_empty_careful(&ctx->flc_posix)) in locks_mandatory_locked()
1421 spin_lock(&ctx->flc_lock); in locks_mandatory_locked()
1423 list_for_each_entry(fl, &ctx->flc_posix, fl_list) { in locks_mandatory_locked()
1430 spin_unlock(&ctx->flc_lock); in locks_mandatory_locked()
1542 struct file_lock_context *ctx = inode->i_flctx; in time_out_leases() local
1545 lockdep_assert_held(&ctx->flc_lock); in time_out_leases()
1547 list_for_each_entry_safe(fl, tmp, &ctx->flc_lease, fl_list) { in time_out_leases()
1578 struct file_lock_context *ctx = inode->i_flctx; in any_leases_conflict() local
1581 lockdep_assert_held(&ctx->flc_lock); in any_leases_conflict()
1583 list_for_each_entry(fl, &ctx->flc_lease, fl_list) { in any_leases_conflict()
1606 struct file_lock_context *ctx; in __break_lease() local
1618 ctx = smp_load_acquire(&inode->i_flctx); in __break_lease()
1619 if (!ctx) { in __break_lease()
1625 spin_lock(&ctx->flc_lock); in __break_lease()
1639 list_for_each_entry_safe(fl, tmp, &ctx->flc_lease, fl_list) { in __break_lease()
1657 if (list_empty(&ctx->flc_lease)) in __break_lease()
1667 fl = list_first_entry(&ctx->flc_lease, struct file_lock, fl_list); in __break_lease()
1675 spin_unlock(&ctx->flc_lock); in __break_lease()
1684 spin_lock(&ctx->flc_lock); in __break_lease()
1699 spin_unlock(&ctx->flc_lock); in __break_lease()
1720 struct file_lock_context *ctx; in lease_get_mtime() local
1723 ctx = smp_load_acquire(&inode->i_flctx); in lease_get_mtime()
1724 if (ctx && !list_empty_careful(&ctx->flc_lease)) { in lease_get_mtime()
1725 spin_lock(&ctx->flc_lock); in lease_get_mtime()
1726 fl = list_first_entry_or_null(&ctx->flc_lease, in lease_get_mtime()
1730 spin_unlock(&ctx->flc_lock); in lease_get_mtime()
1765 struct file_lock_context *ctx; in fcntl_getlease() local
1769 ctx = smp_load_acquire(&inode->i_flctx); in fcntl_getlease()
1770 if (ctx && !list_empty_careful(&ctx->flc_lease)) { in fcntl_getlease()
1772 spin_lock(&ctx->flc_lock); in fcntl_getlease()
1774 list_for_each_entry(fl, &ctx->flc_lease, fl_list) { in fcntl_getlease()
1780 spin_unlock(&ctx->flc_lock); in fcntl_getlease()
1836 struct file_lock_context *ctx; in generic_add_lease() local
1845 ctx = locks_get_lock_context(inode, arg); in generic_add_lease()
1846 if (!ctx) in generic_add_lease()
1868 spin_lock(&ctx->flc_lock); in generic_add_lease()
1883 list_for_each_entry(fl, &ctx->flc_lease, fl_list) { in generic_add_lease()
1916 locks_insert_lock_ctx(lease, &ctx->flc_lease); in generic_add_lease()
1937 spin_unlock(&ctx->flc_lock); in generic_add_lease()
1952 struct file_lock_context *ctx; in generic_delete_lease() local
1955 ctx = smp_load_acquire(&inode->i_flctx); in generic_delete_lease()
1956 if (!ctx) { in generic_delete_lease()
1962 spin_lock(&ctx->flc_lock); in generic_delete_lease()
1963 list_for_each_entry(fl, &ctx->flc_lease, fl_list) { in generic_delete_lease()
1973 spin_unlock(&ctx->flc_lock); in generic_delete_lease()
2697 struct file_lock_context *ctx; in locks_remove_posix() local
2704 ctx = smp_load_acquire(&inode->i_flctx); in locks_remove_posix()
2705 if (!ctx || list_empty(&ctx->flc_posix)) in locks_remove_posix()
2751 locks_remove_lease(struct file *filp, struct file_lock_context *ctx) in locks_remove_lease() argument
2756 if (list_empty(&ctx->flc_lease)) in locks_remove_lease()
2760 spin_lock(&ctx->flc_lock); in locks_remove_lease()
2761 list_for_each_entry_safe(fl, tmp, &ctx->flc_lease, fl_list) in locks_remove_lease()
2764 spin_unlock(&ctx->flc_lock); in locks_remove_lease()
2775 struct file_lock_context *ctx; in locks_remove_file() local
2777 ctx = smp_load_acquire(&locks_inode(filp)->i_flctx); in locks_remove_file()
2778 if (!ctx) in locks_remove_file()
2785 locks_remove_flock(filp, ctx); in locks_remove_file()
2788 locks_remove_lease(filp, ctx); in locks_remove_file()
2790 spin_lock(&ctx->flc_lock); in locks_remove_file()
2791 locks_check_ctx_file_list(filp, &ctx->flc_posix, "POSIX"); in locks_remove_file()
2792 locks_check_ctx_file_list(filp, &ctx->flc_flock, "FLOCK"); in locks_remove_file()
2793 locks_check_ctx_file_list(filp, &ctx->flc_lease, "LEASE"); in locks_remove_file()
2794 spin_unlock(&ctx->flc_lock); in locks_remove_file()
2943 struct file_lock_context *ctx; in show_fd_locks() local
2946 ctx = smp_load_acquire(&inode->i_flctx); in show_fd_locks()
2947 if (!ctx) in show_fd_locks()
2950 spin_lock(&ctx->flc_lock); in show_fd_locks()
2951 __show_fd_locks(f, &ctx->flc_flock, &id, filp, files); in show_fd_locks()
2952 __show_fd_locks(f, &ctx->flc_posix, &id, filp, files); in show_fd_locks()
2953 __show_fd_locks(f, &ctx->flc_lease, &id, filp, files); in show_fd_locks()
2954 spin_unlock(&ctx->flc_lock); in show_fd_locks()