locks: consolidate checks for compatible filp->f_mode values in setlk handlers
locks: consolidate checks for compatible filp->f_mode values in setlk handlers

Move this check into flock64_to_posix_lock instead of duplicating it in
two places. This also fixes a minor wart in the code where we continue
referring to the struct flock after converting it to struct file_lock.

Acked-by: J. Bruce Fields <51738506c1b2ccb0761f23bdc612c93babf738ea@fieldses.org>
Signed-off-by: Jeff Layton <4376fbf8623cd7b7c0232225289bb91cedc0a27f@redhat.com>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs