Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 339465
b: refs/heads/master
c: f152fd5
h: refs/heads/master
i:
  339463: b13c7fb
v: v3
  • Loading branch information
Pavel Shilovsky authored and Steve French committed Dec 5, 2012
1 parent 64fe72f commit 0b53f79
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b8db928b765b4b0fe1aec3eb7f1741fedbed9a33
refs/heads/master: f152fd5fffa78910c467b17f12d0aa060aa408a6
26 changes: 23 additions & 3 deletions trunk/fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,16 +505,36 @@ int cifs_open(struct inode *inode, struct file *file)
return rc;
}

static int cifs_push_posix_locks(struct cifsFileInfo *cfile);

/*
* Try to reacquire byte range locks that were released when session
* to server was lost
* to server was lost.
*/
static int cifs_relock_file(struct cifsFileInfo *cifsFile)
static int
cifs_relock_file(struct cifsFileInfo *cfile)
{
struct cifs_sb_info *cifs_sb = CIFS_SB(cfile->dentry->d_sb);
struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode);
struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
int rc = 0;

/* BB list all locks open on this file and relock */
/* we are going to update can_cache_brlcks here - need a write access */
down_write(&cinode->lock_sem);
if (cinode->can_cache_brlcks) {
/* can cache locks - no need to push them */
up_write(&cinode->lock_sem);
return rc;
}

if (cap_unix(tcon->ses) &&
(CIFS_UNIX_FCNTL_CAP & le64_to_cpu(tcon->fsUnixInfo.Capability)) &&
((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOPOSIXBRL) == 0))
rc = cifs_push_posix_locks(cfile);
else
rc = tcon->ses->server->ops->push_mand_locks(cfile);

up_write(&cinode->lock_sem);
return rc;
}

Expand Down

0 comments on commit 0b53f79

Please sign in to comment.