 /* Report the first existing lock that would conflict with l.  * This implements the F_GETLK command of fcntl().  */ int fcntl_getlk(struct file *filp, unsigned int cmd, struct flock __user *l) {  struct file_lock file_lock;  struct flock flock;  int error;   error = -EFAULT;  if (copy_from_user(&flock, l, sizeof(flock)))   goto out;  error = -EINVAL;  if ((flock.l_type != F_RDLCK) && (flock.l_type != F_WRLCK))   goto out;   error = flock_to_posix_lock(filp, &file_lock, &flock);  if (error)   goto out;   if (cmd == F_OFD_GETLK) {   error = -EINVAL;   if (flock.l_pid != 0)    goto out;    cmd = F_GETLK;   file_lock.fl_flags |= FL_OFDLCK;   file_lock.fl_owner = filp;  }   error = vfs_test_lock(filp, &file_lock);  if (error)   goto out;    flock.l_type = file_lock.fl_type;  if (file_lock.fl_type != F_UNLCK) 