Loading fs/cifs/file.c +35 −40 Original line number Diff line number Diff line Loading @@ -1266,54 +1266,49 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, int xid) continue; if (types[i] != li->type) continue; if (!cinode->can_cache_brlcks) { if (cinode->can_cache_brlcks) { /* * We can cache brlock requests - simply remove * a lock from the file's list. */ list_del(&li->llist); cifs_del_lock_waiters(li); kfree(li); continue; } cur->Pid = cpu_to_le16(li->pid); cur->LengthLow = cpu_to_le32((u32)li->length); cur->LengthHigh = cpu_to_le32((u32)(li->length>>32)); cur->LengthHigh = cpu_to_le32((u32)(li->length>>32)); cur->OffsetLow = cpu_to_le32((u32)li->offset); cur->OffsetHigh = cpu_to_le32((u32)(li->offset>>32)); cur->OffsetHigh = cpu_to_le32((u32)(li->offset>>32)); /* * We need to save a lock here to let us add * it again to the file's list if the unlock * range request fails on the server. * We need to save a lock here to let us add it again to * the file's list if the unlock range request fails on * the server. */ list_move(&li->llist, &tmp_llist); if (++num == max_num) { stored_rc = cifs_lockv(xid, tcon, cfile->netfid, li->type, num, 0, buf); stored_rc = cifs_lockv(xid, tcon, cfile->netfid, li->type, num, 0, buf); if (stored_rc) { /* * We failed on the unlock range * request - add all locks from * the tmp list to the head of * the file's list. * request - add all locks from the tmp * list to the head of the file's list. */ cifs_move_llist(&tmp_llist, &cfile->llist); rc = stored_rc; } else /* * The unlock range request * succeed - free the tmp list. * The unlock range request succeed - * free the tmp list. */ cifs_free_llist(&tmp_llist); cur = buf; num = 0; } else cur++; } else { /* * We can cache brlock requests - simply remove * a lock from the file's list. */ list_del(&li->llist); cifs_del_lock_waiters(li); kfree(li); } } if (num) { stored_rc = cifs_lockv(xid, tcon, cfile->netfid, Loading Loading
fs/cifs/file.c +35 −40 Original line number Diff line number Diff line Loading @@ -1266,54 +1266,49 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, int xid) continue; if (types[i] != li->type) continue; if (!cinode->can_cache_brlcks) { if (cinode->can_cache_brlcks) { /* * We can cache brlock requests - simply remove * a lock from the file's list. */ list_del(&li->llist); cifs_del_lock_waiters(li); kfree(li); continue; } cur->Pid = cpu_to_le16(li->pid); cur->LengthLow = cpu_to_le32((u32)li->length); cur->LengthHigh = cpu_to_le32((u32)(li->length>>32)); cur->LengthHigh = cpu_to_le32((u32)(li->length>>32)); cur->OffsetLow = cpu_to_le32((u32)li->offset); cur->OffsetHigh = cpu_to_le32((u32)(li->offset>>32)); cur->OffsetHigh = cpu_to_le32((u32)(li->offset>>32)); /* * We need to save a lock here to let us add * it again to the file's list if the unlock * range request fails on the server. * We need to save a lock here to let us add it again to * the file's list if the unlock range request fails on * the server. */ list_move(&li->llist, &tmp_llist); if (++num == max_num) { stored_rc = cifs_lockv(xid, tcon, cfile->netfid, li->type, num, 0, buf); stored_rc = cifs_lockv(xid, tcon, cfile->netfid, li->type, num, 0, buf); if (stored_rc) { /* * We failed on the unlock range * request - add all locks from * the tmp list to the head of * the file's list. * request - add all locks from the tmp * list to the head of the file's list. */ cifs_move_llist(&tmp_llist, &cfile->llist); rc = stored_rc; } else /* * The unlock range request * succeed - free the tmp list. * The unlock range request succeed - * free the tmp list. */ cifs_free_llist(&tmp_llist); cur = buf; num = 0; } else cur++; } else { /* * We can cache brlock requests - simply remove * a lock from the file's list. */ list_del(&li->llist); cifs_del_lock_waiters(li); kfree(li); } } if (num) { stored_rc = cifs_lockv(xid, tcon, cfile->netfid, Loading