Lines Matching full:mutex
43 static inline struct mutex *kernfs_open_file_mutex_ptr(struct kernfs_node *kn) in kernfs_open_file_mutex_ptr()
50 static inline struct mutex *kernfs_open_file_mutex_lock(struct kernfs_node *kn) in kernfs_open_file_mutex_lock()
52 struct mutex *lock; in kernfs_open_file_mutex_lock()
100 * the caller guarantees that this mutex is being held, other updaters can't
169 * @of->mutex nests outside active ref and is primarily to ensure that in kernfs_seq_start()
172 mutex_lock(&of->mutex); in kernfs_seq_start()
214 mutex_unlock(&of->mutex); in kernfs_seq_stop()
255 * @of->mutex nests outside active ref and is used both to ensure that in kernfs_file_read_iter()
258 mutex_lock(&of->mutex); in kernfs_file_read_iter()
261 mutex_unlock(&of->mutex); in kernfs_file_read_iter()
274 mutex_unlock(&of->mutex); in kernfs_file_read_iter()
340 * @of->mutex nests outside active ref and is used both to ensure that in kernfs_fop_write_iter()
343 mutex_lock(&of->mutex); in kernfs_fop_write_iter()
345 mutex_unlock(&of->mutex); in kernfs_fop_write_iter()
357 mutex_unlock(&of->mutex); in kernfs_fop_write_iter()
464 * mmap path and of->mutex are prone to triggering spurious lockdep in kernfs_fop_mmap()
467 * without grabbing @of->mutex by testing HAS_MMAP flag. See the in kernfs_fop_mmap()
473 mutex_lock(&of->mutex); in kernfs_fop_mmap()
513 mutex_unlock(&of->mutex); in kernfs_fop_mmap()
536 struct mutex *mutex; in kernfs_get_open_node() local
538 mutex = kernfs_open_file_mutex_lock(kn); in kernfs_get_open_node()
545 mutex_unlock(mutex); in kernfs_get_open_node()
558 mutex_unlock(mutex); in kernfs_get_open_node()
581 struct mutex *mutex; in kernfs_unlink_open_file() local
583 mutex = kernfs_open_file_mutex_lock(kn); in kernfs_unlink_open_file()
587 mutex_unlock(mutex); in kernfs_unlink_open_file()
607 mutex_unlock(mutex); in kernfs_unlink_open_file()
647 * @of->mutex for files which implement mmap. This is a rather in kernfs_fop_open()
649 * mm->mmap_lock - mmap nests @of->mutex under mm->mmap_lock and in kernfs_fop_open()
651 * which mm->mmap_lock nests, while holding @of->mutex. As each in kernfs_fop_open()
652 * open file has a separate mutex, it's okay as long as those don't in kernfs_fop_open()
663 * look that way and give @of->mutex different static lockdep keys. in kernfs_fop_open()
666 mutex_init(&of->mutex); in kernfs_fop_open()
668 mutex_init(&of->mutex); in kernfs_fop_open()
670 mutex_init(&of->mutex); in kernfs_fop_open()
723 /* nobody has access to @of yet, skip @of->mutex */ in kernfs_fop_open()
752 * @kernfs_open_file_mutex_ptr(kn) is enough. @of->mutex can't be used in kernfs_release_file()
776 struct mutex *mutex; in kernfs_fop_release() local
778 mutex = kernfs_open_file_mutex_lock(kn); in kernfs_fop_release()
780 mutex_unlock(mutex); in kernfs_fop_release()
815 struct mutex *mutex; in kernfs_drain_open_files() local
817 mutex = kernfs_open_file_mutex_lock(kn); in kernfs_drain_open_files()
820 mutex_unlock(mutex); in kernfs_drain_open_files()
838 mutex_unlock(mutex); in kernfs_drain_open_files()
892 * @of->mutex nests outside active ref and is primarily to ensure that in kernfs_fop_llseek()
895 mutex_lock(&of->mutex); in kernfs_fop_llseek()
897 mutex_unlock(&of->mutex); in kernfs_fop_llseek()
908 mutex_unlock(&of->mutex); in kernfs_fop_llseek()