summaryrefslogtreecommitdiff
path: root/fs/gfs2/glock.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-09-21 14:42:59 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-09-21 14:42:59 -0700
commitf7c3bf8fa7e5a8e45f4a8e82be6466157854b59b (patch)
treeace565b119da1c379f4873d38c205eac7740a6d3 /fs/gfs2/glock.h
parentfbc246a12aac27f7b25a37f9398bb3bc552cec92 (diff)
parentf0b444b349e33ae0d3dd93e25ca365482a5d17d4 (diff)
Merge tag 'gfs2-for-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2
Pull gfs2 updates from Andreas Gruenbacher: - Use asynchronous glocks and timeouts to recover from deadlocks during rename and exchange: the lock ordering constraints the vfs uses are not sufficient to prevent deadlocks across multiple nodes. - Add support for IOMAP_ZERO and use iomap_zero_range to replace gfs2 specific code. - Various other minor fixes and cleanups. * tag 'gfs2-for-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: clear buf_in_tr when ending a transaction in sweep_bh_for_rgrps gfs2: Improve mmap write vs. truncate consistency gfs2: Use async glocks for rename gfs2: create function gfs2_glock_update_hold_time gfs2: separate holder for rgrps in gfs2_rename gfs2: Delete an unnecessary check before brelse() gfs2: Minor PAGE_SIZE arithmetic cleanups gfs2: Fix recovery slot bumping gfs2: Fix possible fs name overflows gfs2: untangle the logic in gfs2_drevalidate gfs2: Always mark inode dirty in fallocate gfs2: Minor gfs2_alloc_inode cleanup gfs2: implement gfs2_block_zero_range using iomap_zero_range gfs2: Add support for IOMAP_ZERO gfs2: gfs2_iomap_begin cleanup
Diffstat (limited to 'fs/gfs2/glock.h')
-rw-r--r--fs/gfs2/glock.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/gfs2/glock.h b/fs/gfs2/glock.h
index e4e0bed5257c..b8adaf80e4c5 100644
--- a/fs/gfs2/glock.h
+++ b/fs/gfs2/glock.h
@@ -190,6 +190,7 @@ extern void gfs2_holder_uninit(struct gfs2_holder *gh);
extern int gfs2_glock_nq(struct gfs2_holder *gh);
extern int gfs2_glock_poll(struct gfs2_holder *gh);
extern int gfs2_glock_wait(struct gfs2_holder *gh);
+extern int gfs2_glock_async_wait(unsigned int num_gh, struct gfs2_holder *ghs);
extern void gfs2_glock_dq(struct gfs2_holder *gh);
extern void gfs2_glock_dq_wait(struct gfs2_holder *gh);
extern void gfs2_glock_dq_uninit(struct gfs2_holder *gh);
@@ -260,6 +261,11 @@ static inline bool gfs2_holder_initialized(struct gfs2_holder *gh)
return gh->gh_gl;
}
+static inline bool gfs2_holder_queued(struct gfs2_holder *gh)
+{
+ return !list_empty(&gh->gh_list);
+}
+
/**
* glock_set_object - set the gl_object field of a glock
* @gl: the glock