Commit 4e09bf0b authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] missing file_lock conversions

A few places were missing the rwlock->spinlock conversion.
parent 9c22f1bc
...@@ -34,7 +34,7 @@ static struct tty_struct *get_tty(int fd) ...@@ -34,7 +34,7 @@ static struct tty_struct *get_tty(int fd)
struct file *filp; struct file *filp;
struct tty_struct *ttyp = NULL; struct tty_struct *ttyp = NULL;
read_lock(&current->files->file_lock); spin_lock(&current->files->file_lock);
filp = fcheck(fd); filp = fcheck(fd);
if(filp && filp->private_data) { if(filp && filp->private_data) {
ttyp = (struct tty_struct *) filp->private_data; ttyp = (struct tty_struct *) filp->private_data;
...@@ -42,7 +42,7 @@ static struct tty_struct *get_tty(int fd) ...@@ -42,7 +42,7 @@ static struct tty_struct *get_tty(int fd)
if(ttyp->magic != TTY_MAGIC) if(ttyp->magic != TTY_MAGIC)
ttyp =NULL; ttyp =NULL;
} }
read_unlock(&current->files->file_lock); spin_unlock(&current->files->file_lock);
return ttyp; return ttyp;
} }
......
...@@ -26,16 +26,16 @@ match_comm(const struct sk_buff *skb, const char *comm) ...@@ -26,16 +26,16 @@ match_comm(const struct sk_buff *skb, const char *comm)
task_lock(p); task_lock(p);
files = p->files; files = p->files;
if(files) { if(files) {
read_lock(&files->file_lock); spin_lock(&files->file_lock);
for (i=0; i < files->max_fds; i++) { for (i=0; i < files->max_fds; i++) {
if (fcheck_files(files, i) == skb->sk->socket->file) { if (fcheck_files(files, i) == skb->sk->socket->file) {
read_unlock(&files->file_lock); spin_unlock(&files->file_lock);
task_unlock(p); task_unlock(p);
read_unlock(&tasklist_lock); read_unlock(&tasklist_lock);
return 1; return 1;
} }
} }
read_unlock(&files->file_lock); spin_unlock(&files->file_lock);
} }
task_unlock(p); task_unlock(p);
} while_each_thread(g, p); } while_each_thread(g, p);
...@@ -57,16 +57,16 @@ match_pid(const struct sk_buff *skb, pid_t pid) ...@@ -57,16 +57,16 @@ match_pid(const struct sk_buff *skb, pid_t pid)
task_lock(p); task_lock(p);
files = p->files; files = p->files;
if(files) { if(files) {
read_lock(&files->file_lock); spin_lock(&files->file_lock);
for (i=0; i < files->max_fds; i++) { for (i=0; i < files->max_fds; i++) {
if (fcheck_files(files, i) == skb->sk->socket->file) { if (fcheck_files(files, i) == skb->sk->socket->file) {
read_unlock(&files->file_lock); spin_unlock(&files->file_lock);
task_unlock(p); task_unlock(p);
read_unlock(&tasklist_lock); read_unlock(&tasklist_lock);
return 1; return 1;
} }
} }
read_unlock(&files->file_lock); spin_unlock(&files->file_lock);
} }
task_unlock(p); task_unlock(p);
out: out:
...@@ -90,14 +90,14 @@ match_sid(const struct sk_buff *skb, pid_t sid) ...@@ -90,14 +90,14 @@ match_sid(const struct sk_buff *skb, pid_t sid)
task_lock(p); task_lock(p);
files = p->files; files = p->files;
if (files) { if (files) {
read_lock(&files->file_lock); spin_lock(&files->file_lock);
for (i=0; i < files->max_fds; i++) { for (i=0; i < files->max_fds; i++) {
if (fcheck_files(files, i) == file) { if (fcheck_files(files, i) == file) {
found = 1; found = 1;
break; break;
} }
} }
read_unlock(&files->file_lock); spin_unlock(&files->file_lock);
} }
task_unlock(p); task_unlock(p);
if (found) if (found)
......
...@@ -29,16 +29,16 @@ match_pid(const struct sk_buff *skb, pid_t pid) ...@@ -29,16 +29,16 @@ match_pid(const struct sk_buff *skb, pid_t pid)
task_lock(p); task_lock(p);
files = p->files; files = p->files;
if(files) { if(files) {
read_lock(&files->file_lock); spin_lock(&files->file_lock);
for (i=0; i < files->max_fds; i++) { for (i=0; i < files->max_fds; i++) {
if (fcheck_files(files, i) == skb->sk->socket->file) { if (fcheck_files(files, i) == skb->sk->socket->file) {
read_unlock(&files->file_lock); spin_unlock(&files->file_lock);
task_unlock(p); task_unlock(p);
read_unlock(&tasklist_lock); read_unlock(&tasklist_lock);
return 1; return 1;
} }
} }
read_unlock(&files->file_lock); spin_unlock(&files->file_lock);
} }
task_unlock(p); task_unlock(p);
out: out:
...@@ -62,14 +62,14 @@ match_sid(const struct sk_buff *skb, pid_t sid) ...@@ -62,14 +62,14 @@ match_sid(const struct sk_buff *skb, pid_t sid)
task_lock(p); task_lock(p);
files = p->files; files = p->files;
if (files) { if (files) {
read_lock(&files->file_lock); spin_lock(&files->file_lock);
for (i=0; i < files->max_fds; i++) { for (i=0; i < files->max_fds; i++) {
if (fcheck_files(files, i) == file) { if (fcheck_files(files, i) == file) {
found = 1; found = 1;
break; break;
} }
} }
read_unlock(&files->file_lock); spin_unlock(&files->file_lock);
} }
task_unlock(p); task_unlock(p);
if (found) if (found)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment