diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-23 23:44:19 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-23 23:44:19 -0500 |
commit | 1ebbe2b20091d306453a5cf480a87e6cd28ae76f (patch) | |
tree | f5cd7a0fa69b8b1938cb5a0faed2e7b0628072a5 /fs/seq_file.c | |
parent | ac58c9059da8886b5e8cde012a80266b18ca146e (diff) | |
parent | 674a396c6d2ba0341ebdd7c1c9950f32f018e2dd (diff) |
Merge branch 'linus'
Diffstat (limited to 'fs/seq_file.c')
-rw-r--r-- | fs/seq_file.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/seq_file.c b/fs/seq_file.c index 7c40570b71dc..555b9ac04c25 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c | |||
@@ -37,7 +37,7 @@ int seq_open(struct file *file, struct seq_operations *op) | |||
37 | file->private_data = p; | 37 | file->private_data = p; |
38 | } | 38 | } |
39 | memset(p, 0, sizeof(*p)); | 39 | memset(p, 0, sizeof(*p)); |
40 | sema_init(&p->sem, 1); | 40 | mutex_init(&p->lock); |
41 | p->op = op; | 41 | p->op = op; |
42 | 42 | ||
43 | /* | 43 | /* |
@@ -71,7 +71,7 @@ ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos) | |||
71 | void *p; | 71 | void *p; |
72 | int err = 0; | 72 | int err = 0; |
73 | 73 | ||
74 | down(&m->sem); | 74 | mutex_lock(&m->lock); |
75 | /* | 75 | /* |
76 | * seq_file->op->..m_start/m_stop/m_next may do special actions | 76 | * seq_file->op->..m_start/m_stop/m_next may do special actions |
77 | * or optimisations based on the file->f_version, so we want to | 77 | * or optimisations based on the file->f_version, so we want to |
@@ -164,7 +164,7 @@ Done: | |||
164 | else | 164 | else |
165 | *ppos += copied; | 165 | *ppos += copied; |
166 | file->f_version = m->version; | 166 | file->f_version = m->version; |
167 | up(&m->sem); | 167 | mutex_unlock(&m->lock); |
168 | return copied; | 168 | return copied; |
169 | Enomem: | 169 | Enomem: |
170 | err = -ENOMEM; | 170 | err = -ENOMEM; |
@@ -237,7 +237,7 @@ loff_t seq_lseek(struct file *file, loff_t offset, int origin) | |||
237 | struct seq_file *m = (struct seq_file *)file->private_data; | 237 | struct seq_file *m = (struct seq_file *)file->private_data; |
238 | long long retval = -EINVAL; | 238 | long long retval = -EINVAL; |
239 | 239 | ||
240 | down(&m->sem); | 240 | mutex_lock(&m->lock); |
241 | m->version = file->f_version; | 241 | m->version = file->f_version; |
242 | switch (origin) { | 242 | switch (origin) { |
243 | case 1: | 243 | case 1: |
@@ -260,7 +260,7 @@ loff_t seq_lseek(struct file *file, loff_t offset, int origin) | |||
260 | } | 260 | } |
261 | } | 261 | } |
262 | } | 262 | } |
263 | up(&m->sem); | 263 | mutex_unlock(&m->lock); |
264 | file->f_version = m->version; | 264 | file->f_version = m->version; |
265 | return retval; | 265 | return retval; |
266 | } | 266 | } |