From 4e09bf0b229f73da9aa521269d284777c5241fac Mon Sep 17 00:00:00 2001 From: Andrew Morton <akpm@digeo.com> Date: Mon, 14 Apr 2003 06:09:28 -0700 Subject: [PATCH] [PATCH] missing file_lock conversions A few places were missing the rwlock->spinlock conversion. --- arch/mips/kernel/irixioctl.c | 4 ++-- net/ipv4/netfilter/ipt_owner.c | 16 ++++++++-------- net/ipv6/netfilter/ip6t_owner.c | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/arch/mips/kernel/irixioctl.c b/arch/mips/kernel/irixioctl.c index a30ae52c715c..e1d446c382eb 100644 --- a/arch/mips/kernel/irixioctl.c +++ b/arch/mips/kernel/irixioctl.c @@ -34,7 +34,7 @@ static struct tty_struct *get_tty(int fd) struct file *filp; struct tty_struct *ttyp = NULL; - read_lock(¤t->files->file_lock); + spin_lock(¤t->files->file_lock); filp = fcheck(fd); if(filp && filp->private_data) { ttyp = (struct tty_struct *) filp->private_data; @@ -42,7 +42,7 @@ static struct tty_struct *get_tty(int fd) if(ttyp->magic != TTY_MAGIC) ttyp =NULL; } - read_unlock(¤t->files->file_lock); + spin_unlock(¤t->files->file_lock); return ttyp; } diff --git a/net/ipv4/netfilter/ipt_owner.c b/net/ipv4/netfilter/ipt_owner.c index 30f458312892..d1d439096820 100644 --- a/net/ipv4/netfilter/ipt_owner.c +++ b/net/ipv4/netfilter/ipt_owner.c @@ -26,16 +26,16 @@ match_comm(const struct sk_buff *skb, const char *comm) task_lock(p); files = p->files; if(files) { - read_lock(&files->file_lock); + spin_lock(&files->file_lock); for (i=0; i < files->max_fds; i++) { if (fcheck_files(files, i) == skb->sk->socket->file) { - read_unlock(&files->file_lock); + spin_unlock(&files->file_lock); task_unlock(p); read_unlock(&tasklist_lock); return 1; } } - read_unlock(&files->file_lock); + spin_unlock(&files->file_lock); } task_unlock(p); } while_each_thread(g, p); @@ -57,16 +57,16 @@ match_pid(const struct sk_buff *skb, pid_t pid) task_lock(p); files = p->files; if(files) { - read_lock(&files->file_lock); + spin_lock(&files->file_lock); for (i=0; i < files->max_fds; i++) { if (fcheck_files(files, i) == skb->sk->socket->file) { - read_unlock(&files->file_lock); + spin_unlock(&files->file_lock); task_unlock(p); read_unlock(&tasklist_lock); return 1; } } - read_unlock(&files->file_lock); + spin_unlock(&files->file_lock); } task_unlock(p); out: @@ -90,14 +90,14 @@ match_sid(const struct sk_buff *skb, pid_t sid) task_lock(p); files = p->files; if (files) { - read_lock(&files->file_lock); + spin_lock(&files->file_lock); for (i=0; i < files->max_fds; i++) { if (fcheck_files(files, i) == file) { found = 1; break; } } - read_unlock(&files->file_lock); + spin_unlock(&files->file_lock); } task_unlock(p); if (found) diff --git a/net/ipv6/netfilter/ip6t_owner.c b/net/ipv6/netfilter/ip6t_owner.c index 4a9f0bee30c4..411b0499328e 100644 --- a/net/ipv6/netfilter/ip6t_owner.c +++ b/net/ipv6/netfilter/ip6t_owner.c @@ -29,16 +29,16 @@ match_pid(const struct sk_buff *skb, pid_t pid) task_lock(p); files = p->files; if(files) { - read_lock(&files->file_lock); + spin_lock(&files->file_lock); for (i=0; i < files->max_fds; i++) { if (fcheck_files(files, i) == skb->sk->socket->file) { - read_unlock(&files->file_lock); + spin_unlock(&files->file_lock); task_unlock(p); read_unlock(&tasklist_lock); return 1; } } - read_unlock(&files->file_lock); + spin_unlock(&files->file_lock); } task_unlock(p); out: @@ -62,14 +62,14 @@ match_sid(const struct sk_buff *skb, pid_t sid) task_lock(p); files = p->files; if (files) { - read_lock(&files->file_lock); + spin_lock(&files->file_lock); for (i=0; i < files->max_fds; i++) { if (fcheck_files(files, i) == file) { found = 1; break; } } - read_unlock(&files->file_lock); + spin_unlock(&files->file_lock); } task_unlock(p); if (found) -- 2.30.9