Re-encode struct fcntl back into Linux's struct file_lock so

that fcntl(F_GETLK) returns proper values to the user.
This commit is contained in:
Nickolai Zeldovich 2002-07-27 19:06:08 +00:00
parent 094adf6b12
commit b8ebb1a225

View File

@ -640,6 +640,13 @@ static int afs_linux_lock(struct file *fp, int cmd, struct file_lock *flp)
AFS_GLOCK();
code = afs_lockctl(vcp, &flock, cmd, credp);
AFS_GUNLOCK();
/* Convert flock back to Linux's file_lock */
flp->fl_type = flock.l_type;
flp->fl_pid = flock.l_pid;
flp->fl_start = flock.l_start;
flp->fl_end = flock.l_start + flock.l_len;
crfree(credp);
return -code;