|
@@ -6394,16 +6394,11 @@ static void md_seq_stop(struct seq_file *seq, void *v)
|
|
mddev_put(mddev);
|
|
mddev_put(mddev);
|
|
}
|
|
}
|
|
|
|
|
|
-struct mdstat_info {
|
|
|
|
- int event;
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
static int md_seq_show(struct seq_file *seq, void *v)
|
|
static int md_seq_show(struct seq_file *seq, void *v)
|
|
{
|
|
{
|
|
mddev_t *mddev = v;
|
|
mddev_t *mddev = v;
|
|
sector_t sectors;
|
|
sector_t sectors;
|
|
mdk_rdev_t *rdev;
|
|
mdk_rdev_t *rdev;
|
|
- struct mdstat_info *mi = seq->private;
|
|
|
|
struct bitmap *bitmap;
|
|
struct bitmap *bitmap;
|
|
|
|
|
|
if (v == (void*)1) {
|
|
if (v == (void*)1) {
|
|
@@ -6415,7 +6410,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
|
|
|
|
|
|
spin_unlock(&pers_lock);
|
|
spin_unlock(&pers_lock);
|
|
seq_printf(seq, "\n");
|
|
seq_printf(seq, "\n");
|
|
- mi->event = atomic_read(&md_event_count);
|
|
|
|
|
|
+ seq->poll_event = atomic_read(&md_event_count);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
if (v == (void*)2) {
|
|
if (v == (void*)2) {
|
|
@@ -6527,26 +6522,21 @@ static const struct seq_operations md_seq_ops = {
|
|
|
|
|
|
static int md_seq_open(struct inode *inode, struct file *file)
|
|
static int md_seq_open(struct inode *inode, struct file *file)
|
|
{
|
|
{
|
|
|
|
+ struct seq_file *seq;
|
|
int error;
|
|
int error;
|
|
- struct mdstat_info *mi = kmalloc(sizeof(*mi), GFP_KERNEL);
|
|
|
|
- if (mi == NULL)
|
|
|
|
- return -ENOMEM;
|
|
|
|
|
|
|
|
error = seq_open(file, &md_seq_ops);
|
|
error = seq_open(file, &md_seq_ops);
|
|
if (error)
|
|
if (error)
|
|
- kfree(mi);
|
|
|
|
- else {
|
|
|
|
- struct seq_file *p = file->private_data;
|
|
|
|
- p->private = mi;
|
|
|
|
- mi->event = atomic_read(&md_event_count);
|
|
|
|
- }
|
|
|
|
|
|
+ return error;
|
|
|
|
+
|
|
|
|
+ seq = file->private_data;
|
|
|
|
+ seq->poll_event = atomic_read(&md_event_count);
|
|
return error;
|
|
return error;
|
|
}
|
|
}
|
|
|
|
|
|
static unsigned int mdstat_poll(struct file *filp, poll_table *wait)
|
|
static unsigned int mdstat_poll(struct file *filp, poll_table *wait)
|
|
{
|
|
{
|
|
- struct seq_file *m = filp->private_data;
|
|
|
|
- struct mdstat_info *mi = m->private;
|
|
|
|
|
|
+ struct seq_file *seq = filp->private_data;
|
|
int mask;
|
|
int mask;
|
|
|
|
|
|
poll_wait(filp, &md_event_waiters, wait);
|
|
poll_wait(filp, &md_event_waiters, wait);
|
|
@@ -6554,7 +6544,7 @@ static unsigned int mdstat_poll(struct file *filp, poll_table *wait)
|
|
/* always allow read */
|
|
/* always allow read */
|
|
mask = POLLIN | POLLRDNORM;
|
|
mask = POLLIN | POLLRDNORM;
|
|
|
|
|
|
- if (mi->event != atomic_read(&md_event_count))
|
|
|
|
|
|
+ if (seq->poll_event != atomic_read(&md_event_count))
|
|
mask |= POLLERR | POLLPRI;
|
|
mask |= POLLERR | POLLPRI;
|
|
return mask;
|
|
return mask;
|
|
}
|
|
}
|