op->info.optype         = DLM_PLOCK_OP_LOCK;
        op->info.pid            = fl->fl_pid;
-       op->info.ex             = (fl->fl_type == F_WRLCK);
+       op->info.ex             = (lock_is_write(fl));
        op->info.wait           = !!(fl->fl_flags & FL_SLEEP);
        op->info.fsid           = ls->ls_global_id;
        op->info.number         = number;
        struct dlm_ls *ls;
        struct plock_op *op;
        int rv;
-       unsigned char fl_flags = fl->fl_flags;
+       unsigned char saved_flags = fl->fl_flags;
 
        ls = dlm_find_lockspace_local(lockspace);
        if (!ls)
        dlm_release_plock_op(op);
 out:
        dlm_put_lockspace(ls);
-       fl->fl_flags = fl_flags;
+       fl->fl_flags = saved_flags;
        return rv;
 }
 EXPORT_SYMBOL_GPL(dlm_posix_unlock);
 
        memset(&info, 0, sizeof(info));
        info.pid = fl->fl_pid;
-       info.ex = (fl->fl_type == F_WRLCK);
+       info.ex = (lock_is_write(fl));
        info.fsid = ls->ls_global_id;
        dlm_put_lockspace(ls);
        info.number = number;
 
        op->info.optype         = DLM_PLOCK_OP_GET;
        op->info.pid            = fl->fl_pid;
-       op->info.ex             = (fl->fl_type == F_WRLCK);
+       op->info.ex             = (lock_is_write(fl));
        op->info.fsid           = ls->ls_global_id;
        op->info.number         = number;
        op->info.start          = fl->fl_start;