nfs: convert to using new filelock helpers
[linux-2.6-microblaze.git] / fs / nfs / write.c
index bb79d3a..d16f2b9 100644 (file)
@@ -1301,7 +1301,7 @@ static bool
 is_whole_file_wrlock(struct file_lock *fl)
 {
        return fl->fl_start == 0 && fl->fl_end == OFFSET_MAX &&
-                       fl->fl_type == F_WRLCK;
+                       lock_is_write(fl);
 }
 
 /* If we know the page is up to date, and we're not using byte range locks (or
@@ -1341,7 +1341,7 @@ static int nfs_can_extend_write(struct file *file, struct folio *folio,
        } else if (!list_empty(&flctx->flc_flock)) {
                fl = list_first_entry(&flctx->flc_flock, struct file_lock,
                                        fl_list);
-               if (fl->fl_type == F_WRLCK)
+               if (lock_is_write(fl))
                        ret = 1;
        }
        spin_unlock(&flctx->flc_lock);