From c5fd363d771393a7b42bbbe051f30f97d4867a40 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Mon, 23 Jul 2012 13:28:37 -0400 Subject: cifs: move file_lock off stack in cifs_push_posix_locks struct file_lock is pretty large, so we really don't want that on the stack in a potentially long call chain. Reorganize the arguments to CIFSSMBPosixLock to eliminate the need for that. Eliminate the get_flag and simply use a non-NULL pLockInfo to indicate that this is a "get" operation. In order to do that, need to add a new loff_t argument for the start_offset. Reported-by: Al Viro Signed-off-by: Jeff Layton Signed-off-by: Steve French --- fs/cifs/file.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'fs/cifs/file.c') diff --git a/fs/cifs/file.c b/fs/cifs/file.c index dd28caa0a5ce..e9a8ac0047c7 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -1039,12 +1039,10 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile) unlock_flocks(); list_for_each_entry_safe(lck, tmp, &locks_to_send, llist) { - struct file_lock tmp_lock; int stored_rc; - tmp_lock.fl_start = lck->offset; stored_rc = CIFSSMBPosixLock(xid, tcon, lck->netfid, lck->pid, - 0, lck->length, &tmp_lock, + lck->offset, lck->length, NULL, lck->type, 0); if (stored_rc) rc = stored_rc; @@ -1159,7 +1157,7 @@ cifs_getlk(struct file *file, struct file_lock *flock, __u32 type, else posix_lock_type = CIFS_WRLCK; rc = CIFSSMBPosixLock(xid, tcon, netfid, current->tgid, - 1 /* get */, length, flock, + flock->fl_start, length, flock, posix_lock_type, wait_flag); return rc; } @@ -1353,7 +1351,7 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type, posix_lock_type = CIFS_UNLCK; rc = CIFSSMBPosixLock(xid, tcon, netfid, current->tgid, - 0 /* set */, length, flock, + flock->fl_start, length, NULL, posix_lock_type, wait_flag); goto out; } -- cgit v1.2.1