summaryrefslogtreecommitdiff
path: root/fs/gfs2/glock.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-01-13 02:09:35 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-13 02:09:35 (GMT)
commit4d58967783611c5676820b8d47a9b6b0bb456995 (patch)
tree6a20281fbff1a1a4e88d65d5851e51d8d6b2f02e /fs/gfs2/glock.c
parent33caf82acf4dc420bf0f0136b886f7b27ecf90c5 (diff)
parenta93a99838248bdab49db2eaac00236847670bc7f (diff)
downloadlinux-4d58967783611c5676820b8d47a9b6b0bb456995.tar.xz
Merge tag 'gfs2-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2
Pull GFS2 updates from Bob Peterson: "Here is a list of patches we've accumulated for GFS2 for the current upstream merge window. Last window's set was short, but I warned that this one would be bigger, and so it is. We've got 19 patches: - A patch from Abhi Das to propagate the GFS2_DIF_SYSTEM bit so that newly added journals don't get flagged, deleted, and recreated by fsck.gfs2. - Two patches from Andreas Gruenbacher to improve GFS2 performance where extended attributes are involved. - A patch from Andy Price to fix a suspicious rcu dereference error. - Two patches from Ben Marzinski that rework how GFS2's NFS cookies are managed. This fixes readdir problems with nfs-over-gfs2. - A patch from Ben Marzinski that fixes a race in unmounting GFS2. - A set of four patches from me to move the resource group reservations inside the gfs2 inode to improve performance and fix a bug whereby get_write_access improperly prevented some operations like chown. - A patch from me to spinlock-protect the setting of system statfs file data. This was causing small discrepancies between df and du. - A patch from me to reintroduce a timeout while clearing glocks which was accidentally dropped some time ago. - A patch from me to wait for iopen glock dequeues in order to improve deleting of files that were unlinked from a different cluster node. - A patch from me to ensure metadata address spaces get truncated when an inode is evicted. - A patch from me to fix a bug in which a memory leak could occur in some error cases when inodes were trying to be created. - A patch to consistently use iopen glocks to transition from the unlinked state to the deleted state. - A patch to fix a glock reference count error when inode creation fails. - A patch from Junxiao Bi to fix an flock panic. - A patch from Markus Elfring that removes an unnecessary if" * tag 'gfs2-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: fix flock panic issue GFS2: Don't do glock put on when inode creation fails GFS2: Always use iopen glock for gl_deletes GFS2: Release iopen glock in gfs2_create_inode error cases GFS2: Truncate address space mapping when deleting an inode GFS2: Wait for iopen glock dequeues gfs2: clear journal live bit in gfs2_log_flush gfs2: change gfs2 readdir cookie gfs2: keep offset when splitting dir leaf blocks GFS2: Reintroduce a timeout in function gfs2_gl_hash_clear GFS2: Update master statfs buffer with sd_statfs_spin locked GFS2: Reduce size of incore inode GFS2: Make rgrp reservations part of the gfs2_inode structure GFS2: Extract quota data from reservations structure (revert 5407e24) gfs2: Extended attribute readahead optimization gfs2: Extended attribute readahead GFS2: Use rht_for_each_entry_rcu in glock_hash_walk GFS2: Delete an unnecessary check before the function call "iput" gfs2: Automatically set GFS2_DIF_SYSTEM flag on system files
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r--fs/gfs2/glock.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 32e7471..a4ff7b5 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -446,7 +446,7 @@ __acquires(&gl->gl_lockref.lock)
{
const struct gfs2_glock_operations *glops = gl->gl_ops;
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
- unsigned int lck_flags = gh ? gh->gh_flags : 0;
+ unsigned int lck_flags = (unsigned int)(gh ? gh->gh_flags : 0);
int ret;
lck_flags &= (LM_FLAG_TRY | LM_FLAG_TRY_1CB | LM_FLAG_NOEXP |
@@ -750,7 +750,7 @@ again:
*
*/
-void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state, unsigned flags,
+void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state, u16 flags,
struct gfs2_holder *gh)
{
INIT_LIST_HEAD(&gh->gh_list);
@@ -774,7 +774,7 @@ void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state, unsigned flags,
*
*/
-void gfs2_holder_reinit(unsigned int state, unsigned flags, struct gfs2_holder *gh)
+void gfs2_holder_reinit(unsigned int state, u16 flags, struct gfs2_holder *gh)
{
gh->gh_state = state;
gh->gh_flags = flags;
@@ -1080,7 +1080,7 @@ void gfs2_glock_dq_uninit(struct gfs2_holder *gh)
int gfs2_glock_nq_num(struct gfs2_sbd *sdp, u64 number,
const struct gfs2_glock_operations *glops,
- unsigned int state, int flags, struct gfs2_holder *gh)
+ unsigned int state, u16 flags, struct gfs2_holder *gh)
{
struct gfs2_glock *gl;
int error;
@@ -1417,14 +1417,14 @@ static struct shrinker glock_shrinker = {
static void glock_hash_walk(glock_examiner examiner, const struct gfs2_sbd *sdp)
{
struct gfs2_glock *gl;
- struct rhash_head *pos, *next;
+ struct rhash_head *pos;
const struct bucket_table *tbl;
int i;
rcu_read_lock();
tbl = rht_dereference_rcu(gl_hash_table.tbl, &gl_hash_table);
for (i = 0; i < tbl->size; i++) {
- rht_for_each_entry_safe(gl, pos, next, tbl, i, gl_node) {
+ rht_for_each_entry_rcu(gl, pos, tbl, i, gl_node) {
if ((gl->gl_name.ln_sbd == sdp) &&
lockref_get_not_dead(&gl->gl_lockref))
examiner(gl);
@@ -1506,7 +1506,9 @@ void gfs2_gl_hash_clear(struct gfs2_sbd *sdp)
flush_workqueue(glock_workqueue);
glock_hash_walk(clear_glock, sdp);
flush_workqueue(glock_workqueue);
- wait_event(sdp->sd_glock_wait, atomic_read(&sdp->sd_glock_disposal) == 0);
+ wait_event_timeout(sdp->sd_glock_wait,
+ atomic_read(&sdp->sd_glock_disposal) == 0,
+ HZ * 600);
glock_hash_walk(dump_glock_func, sdp);
}
@@ -1539,7 +1541,7 @@ static const char *state2str(unsigned state)
return "??";
}
-static const char *hflags2str(char *buf, unsigned flags, unsigned long iflags)
+static const char *hflags2str(char *buf, u16 flags, unsigned long iflags)
{
char *p = buf;
if (flags & LM_FLAG_TRY)