locks: make /proc/locks show IS_FILE_PVT locks as type "FLPVT"
[GitHub/LineageOS/android_kernel_samsung_universal7580.git] / fs / locks.c
index 74c9f1db6fca89bdcd05e912d52cd1b9783184ab..c4a9c7a17fa4e89db9ccd0f92469a08fa278a599 100644 (file)
 #define IS_POSIX(fl)   (fl->fl_flags & FL_POSIX)
 #define IS_FLOCK(fl)   (fl->fl_flags & FL_FLOCK)
 #define IS_LEASE(fl)   (fl->fl_flags & FL_LEASE)
+#define IS_FILE_PVT(fl)        (fl->fl_flags & FL_FILE_PVT)
 
 static bool lease_breaking(struct file_lock *fl)
 {
@@ -2164,8 +2165,14 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
 
        seq_printf(f, "%lld:%s ", id, pfx);
        if (IS_POSIX(fl)) {
-               seq_printf(f, "%6s %s ",
-                            (fl->fl_flags & FL_ACCESS) ? "ACCESS" : "POSIX ",
+               if (fl->fl_flags & FL_ACCESS)
+                       seq_printf(f, "ACCESS");
+               else if (IS_FILE_PVT(fl))
+                       seq_printf(f, "FLPVT ");
+               else
+                       seq_printf(f, "POSIX ");
+
+               seq_printf(f, " %s ",
                             (inode == NULL) ? "*NOINODE*" :
                             mandatory_lock(inode) ? "MANDATORY" : "ADVISORY ");
        } else if (IS_FLOCK(fl)) {