Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53965
b: refs/heads/master
c: 796e566
h: refs/heads/master
i:
  53963: 28f35be
v: v3
  • Loading branch information
Roland Dreier authored and Steve French committed May 3, 2007
1 parent d7311b0 commit baee1a9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 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: 0b2365f826f40d6e966365299d4e9dcc7ef4e93f
refs/heads/master: 796e5661f6b6be1600b3ab47c61ce61cf3e7a353
2 changes: 1 addition & 1 deletion trunk/fs/cifs/cifsglob.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ struct cifsFileInfo {
/* lock scope id (0 if none) */
struct file * pfile; /* needed for writepage */
struct inode * pInode; /* needed for oplock break */
struct semaphore lock_sem;
struct mutex lock_mutex;
struct list_head llist; /* list of byte range locks we have. */
unsigned closePend:1; /* file is marked to close */
unsigned invalidHandle:1; /* file closed via session abend */
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/cifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
pCifsFile->invalidHandle = FALSE;
pCifsFile->closePend = FALSE;
init_MUTEX(&pCifsFile->fh_sem);
init_MUTEX(&pCifsFile->lock_sem);
mutex_init(&pCifsFile->lock_mutex);
INIT_LIST_HEAD(&pCifsFile->llist);
atomic_set(&pCifsFile->wrtPending,0);

Expand Down
14 changes: 7 additions & 7 deletions trunk/fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static inline struct cifsFileInfo *cifs_init_private(
private_data->netfid = netfid;
private_data->pid = current->tgid;
init_MUTEX(&private_data->fh_sem);
init_MUTEX(&private_data->lock_sem);
mutex_init(&private_data->lock_mutex);
INIT_LIST_HEAD(&private_data->llist);
private_data->pfile = file; /* needed for writepage */
private_data->pInode = inode;
Expand Down Expand Up @@ -511,12 +511,12 @@ int cifs_close(struct inode *inode, struct file *file)

/* Delete any outstanding lock records.
We'll lose them when the file is closed anyway. */
down(&pSMBFile->lock_sem);
mutex_lock(&pSMBFile->lock_mutex);
list_for_each_entry_safe(li, tmp, &pSMBFile->llist, llist) {
list_del(&li->llist);
kfree(li);
}
up(&pSMBFile->lock_sem);
mutex_unlock(&pSMBFile->lock_mutex);

write_lock(&GlobalSMBSeslock);
list_del(&pSMBFile->flist);
Expand Down Expand Up @@ -601,9 +601,9 @@ static int store_file_lock(struct cifsFileInfo *fid, __u64 len,
li->offset = offset;
li->length = len;
li->type = lockType;
down(&fid->lock_sem);
mutex_lock(&fid->lock_mutex);
list_add(&li->llist, &fid->llist);
up(&fid->lock_sem);
mutex_unlock(&fid->lock_mutex);
return 0;
}

Expand Down Expand Up @@ -760,7 +760,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
struct cifsLockInfo *li, *tmp;

rc = 0;
down(&fid->lock_sem);
mutex_lock(&fid->lock_mutex);
list_for_each_entry_safe(li, tmp, &fid->llist, llist) {
if (pfLock->fl_start <= li->offset &&
length >= li->length) {
Expand All @@ -774,7 +774,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
kfree(li);
}
}
up(&fid->lock_sem);
mutex_unlock(&fid->lock_mutex);
}
}

Expand Down

0 comments on commit baee1a9

Please sign in to comment.