135135#define IS_POSIX (fl ) (fl->fl_flags & FL_POSIX)
136136#define IS_FLOCK (fl ) (fl->fl_flags & FL_FLOCK)
137137#define IS_LEASE (fl ) (fl->fl_flags & (FL_LEASE|FL_DELEG))
138- #define IS_FILE_PVT (fl ) (fl->fl_flags & FL_FILE_PVT )
138+ #define IS_OFDLCK (fl ) (fl->fl_flags & FL_OFDLCK )
139139
140140static bool lease_breaking (struct file_lock * fl )
141141{
@@ -564,7 +564,7 @@ static void __locks_insert_block(struct file_lock *blocker,
564564 BUG_ON (!list_empty (& waiter -> fl_block ));
565565 waiter -> fl_next = blocker ;
566566 list_add_tail (& waiter -> fl_block , & blocker -> fl_block );
567- if (IS_POSIX (blocker ) && !IS_FILE_PVT (blocker ))
567+ if (IS_POSIX (blocker ) && !IS_OFDLCK (blocker ))
568568 locks_insert_global_blocked (waiter );
569569}
570570
@@ -759,12 +759,12 @@ EXPORT_SYMBOL(posix_test_lock);
759759 * of tasks (such as posix threads) sharing the same open file table.
760760 * To handle those cases, we just bail out after a few iterations.
761761 *
762- * For FL_FILE_PVT locks, the owner is the filp, not the files_struct.
762+ * For FL_OFDLCK locks, the owner is the filp, not the files_struct.
763763 * Because the owner is not even nominally tied to a thread of
764764 * execution, the deadlock detection below can't reasonably work well. Just
765765 * skip it for those.
766766 *
767- * In principle, we could do a more limited deadlock detection on FL_FILE_PVT
767+ * In principle, we could do a more limited deadlock detection on FL_OFDLCK
768768 * locks that just checks for the case where two tasks are attempting to
769769 * upgrade from read to write locks on the same inode.
770770 */
@@ -791,9 +791,9 @@ static int posix_locks_deadlock(struct file_lock *caller_fl,
791791
792792 /*
793793 * This deadlock detector can't reasonably detect deadlocks with
794- * FL_FILE_PVT locks, since they aren't owned by a process, per-se.
794+ * FL_OFDLCK locks, since they aren't owned by a process, per-se.
795795 */
796- if (IS_FILE_PVT (caller_fl ))
796+ if (IS_OFDLCK (caller_fl ))
797797 return 0 ;
798798
799799 while ((block_fl = what_owner_is_waiting_for (block_fl ))) {
@@ -1890,7 +1890,7 @@ EXPORT_SYMBOL_GPL(vfs_test_lock);
18901890
18911891static int posix_lock_to_flock (struct flock * flock , struct file_lock * fl )
18921892{
1893- flock -> l_pid = IS_FILE_PVT (fl ) ? -1 : fl -> fl_pid ;
1893+ flock -> l_pid = IS_OFDLCK (fl ) ? -1 : fl -> fl_pid ;
18941894#if BITS_PER_LONG == 32
18951895 /*
18961896 * Make sure we can represent the posix lock via
@@ -1912,7 +1912,7 @@ static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl)
19121912#if BITS_PER_LONG == 32
19131913static void posix_lock_to_flock64 (struct flock64 * flock , struct file_lock * fl )
19141914{
1915- flock -> l_pid = IS_FILE_PVT (fl ) ? -1 : fl -> fl_pid ;
1915+ flock -> l_pid = IS_OFDLCK (fl ) ? -1 : fl -> fl_pid ;
19161916 flock -> l_start = fl -> fl_start ;
19171917 flock -> l_len = fl -> fl_end == OFFSET_MAX ? 0 :
19181918 fl -> fl_end - fl -> fl_start + 1 ;
@@ -1941,13 +1941,13 @@ int fcntl_getlk(struct file *filp, unsigned int cmd, struct flock __user *l)
19411941 if (error )
19421942 goto out ;
19431943
1944- if (cmd == F_GETLKP ) {
1944+ if (cmd == F_OFD_GETLK ) {
19451945 error = - EINVAL ;
19461946 if (flock .l_pid != 0 )
19471947 goto out ;
19481948
19491949 cmd = F_GETLK ;
1950- file_lock .fl_flags |= FL_FILE_PVT ;
1950+ file_lock .fl_flags |= FL_OFDLCK ;
19511951 file_lock .fl_owner = (fl_owner_t )filp ;
19521952 }
19531953
@@ -2073,25 +2073,25 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd,
20732073
20742074 /*
20752075 * If the cmd is requesting file-private locks, then set the
2076- * FL_FILE_PVT flag and override the owner.
2076+ * FL_OFDLCK flag and override the owner.
20772077 */
20782078 switch (cmd ) {
2079- case F_SETLKP :
2079+ case F_OFD_SETLK :
20802080 error = - EINVAL ;
20812081 if (flock .l_pid != 0 )
20822082 goto out ;
20832083
20842084 cmd = F_SETLK ;
2085- file_lock -> fl_flags |= FL_FILE_PVT ;
2085+ file_lock -> fl_flags |= FL_OFDLCK ;
20862086 file_lock -> fl_owner = (fl_owner_t )filp ;
20872087 break ;
2088- case F_SETLKPW :
2088+ case F_OFD_SETLKW :
20892089 error = - EINVAL ;
20902090 if (flock .l_pid != 0 )
20912091 goto out ;
20922092
20932093 cmd = F_SETLKW ;
2094- file_lock -> fl_flags |= FL_FILE_PVT ;
2094+ file_lock -> fl_flags |= FL_OFDLCK ;
20952095 file_lock -> fl_owner = (fl_owner_t )filp ;
20962096 /* Fallthrough */
20972097 case F_SETLKW :
@@ -2143,13 +2143,13 @@ int fcntl_getlk64(struct file *filp, unsigned int cmd, struct flock64 __user *l)
21432143 if (error )
21442144 goto out ;
21452145
2146- if (cmd == F_GETLKP ) {
2146+ if (cmd == F_OFD_GETLK ) {
21472147 error = - EINVAL ;
21482148 if (flock .l_pid != 0 )
21492149 goto out ;
21502150
21512151 cmd = F_GETLK64 ;
2152- file_lock .fl_flags |= FL_FILE_PVT ;
2152+ file_lock .fl_flags |= FL_OFDLCK ;
21532153 file_lock .fl_owner = (fl_owner_t )filp ;
21542154 }
21552155
@@ -2208,25 +2208,25 @@ int fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd,
22082208
22092209 /*
22102210 * If the cmd is requesting file-private locks, then set the
2211- * FL_FILE_PVT flag and override the owner.
2211+ * FL_OFDLCK flag and override the owner.
22122212 */
22132213 switch (cmd ) {
2214- case F_SETLKP :
2214+ case F_OFD_SETLK :
22152215 error = - EINVAL ;
22162216 if (flock .l_pid != 0 )
22172217 goto out ;
22182218
22192219 cmd = F_SETLK64 ;
2220- file_lock -> fl_flags |= FL_FILE_PVT ;
2220+ file_lock -> fl_flags |= FL_OFDLCK ;
22212221 file_lock -> fl_owner = (fl_owner_t )filp ;
22222222 break ;
2223- case F_SETLKPW :
2223+ case F_OFD_SETLKW :
22242224 error = - EINVAL ;
22252225 if (flock .l_pid != 0 )
22262226 goto out ;
22272227
22282228 cmd = F_SETLKW64 ;
2229- file_lock -> fl_flags |= FL_FILE_PVT ;
2229+ file_lock -> fl_flags |= FL_OFDLCK ;
22302230 file_lock -> fl_owner = (fl_owner_t )filp ;
22312231 /* Fallthrough */
22322232 case F_SETLKW64 :
@@ -2412,8 +2412,8 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
24122412 if (IS_POSIX (fl )) {
24132413 if (fl -> fl_flags & FL_ACCESS )
24142414 seq_printf (f , "ACCESS" );
2415- else if (IS_FILE_PVT (fl ))
2416- seq_printf (f , "FLPVT " );
2415+ else if (IS_OFDLCK (fl ))
2416+ seq_printf (f , "OFDLCK " );
24172417 else
24182418 seq_printf (f , "POSIX " );
24192419
0 commit comments