Skip to contentSkip to conversation

locks: show delegations as "DELEG" in /proc/locks

PATCH In review Jeff Layton 2 participants 2 messages Aug 6, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 locks: show delegations as "DELEG" in /proc/locks

Now that they are a distinct lease type, show them as such.

Cc J. Bruce Fields <[email protected]>
---
 fs/locks.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
fs/locks.c +5 -1
index 717fbc404e6b..51cdc9d3fafa 100644
@@ -2452,7 +2452,11 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
 			seq_puts(f, "FLOCK  ADVISORY  ");
 		}
 	} else if (IS_LEASE(fl)) {
-		seq_puts(f, "LEASE  ");
+		if (fl->fl_flags & FL_DELEG)
+			seq_puts(f, "DELEG  ");
+		else
+			seq_puts(f, "LEASE  ");
+
 		if (lease_breaking(fl))
 			seq_puts(f, "BREAKING  ");
 		else if (fl->fl_file)
Signature · 1 line
1.9.3
#1 lore raw
Quoted 1 line · Jeff Layton

Now that they are a distinct lease type, show them as such.

Makes sense, thanks!

--b.

Quoted 31 lines
Cc J. Bruce Fields <[email protected]>
---
 fs/locks.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
fs/locks.c +5 -1
index 717fbc404e6b..51cdc9d3fafa 100644
@@ -2452,7 +2452,11 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
 			seq_puts(f, "FLOCK  ADVISORY  ");
 		}
 	} else if (IS_LEASE(fl)) {
-		seq_puts(f, "LEASE  ");
+		if (fl->fl_flags & FL_DELEG)
+			seq_puts(f, "DELEG  ");
+		else
+			seq_puts(f, "LEASE  ");
+
 		if (lease_breaking(fl))
 			seq_puts(f, "BREAKING  ");
 		else if (fl->fl_file)
Signature · 6 lines
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html