projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[firefly-linux-kernel-4.4.55.git]
/
fs
/
proc
/
proc_tty.c
diff --git
a/fs/proc/proc_tty.c
b/fs/proc/proc_tty.c
index c1bbfbeb035e4e5b72a9eb64a1bdb507496b93ce..49816e00b51a25899f860215166b97acd8584044 100644
(file)
--- a/
fs/proc/proc_tty.c
+++ b/
fs/proc/proc_tty.c
@@
-15,9
+15,6
@@
#include <linux/seq_file.h>
#include <linux/bitops.h>
#include <linux/seq_file.h>
#include <linux/bitops.h>
-static int tty_ldiscs_read_proc(char *page, char **start, off_t off,
- int count, int *eof, void *data);
-
/*
* The /proc/tty directory inodes...
*/
/*
* The /proc/tty directory inodes...
*/
@@
-69,7
+66,7
@@
static void show_tty_range(struct seq_file *m, struct tty_driver *p,
static int show_tty_driver(struct seq_file *m, void *v)
{
static int show_tty_driver(struct seq_file *m, void *v)
{
- struct tty_driver *p =
v
;
+ struct tty_driver *p =
list_entry(v, struct tty_driver, tty_drivers)
;
dev_t from = MKDEV(p->major, p->minor_start);
dev_t to = from + p->num;
dev_t from = MKDEV(p->major, p->minor_start);
dev_t to = from + p->num;
@@
-106,27
+103,21
@@
static int show_tty_driver(struct seq_file *m, void *v)
/* iterator */
static void *t_start(struct seq_file *m, loff_t *pos)
{
/* iterator */
static void *t_start(struct seq_file *m, loff_t *pos)
{
- struct list_head *p;
- loff_t l = *pos;
- list_for_each(p, &tty_drivers)
- if (!l--)
- return list_entry(p, struct tty_driver, tty_drivers);
- return NULL;
+ mutex_lock(&tty_mutex);
+ return seq_list_start(&tty_drivers, *pos);
}
static void *t_next(struct seq_file *m, void *v, loff_t *pos)
{
}
static void *t_next(struct seq_file *m, void *v, loff_t *pos)
{
- struct list_head *p = ((struct tty_driver *)v)->tty_drivers.next;
- (*pos)++;
- return p==&tty_drivers ? NULL :
- list_entry(p, struct tty_driver, tty_drivers);
+ return seq_list_next(v, &tty_drivers, pos);
}
static void t_stop(struct seq_file *m, void *v)
{
}
static void t_stop(struct seq_file *m, void *v)
{
+ mutex_unlock(&tty_mutex);
}
}
-static struct seq_operations tty_drivers_op = {
+static
const
struct seq_operations tty_drivers_op = {
.start = t_start,
.next = t_next,
.stop = t_stop,
.start = t_start,
.next = t_next,
.stop = t_stop,