Changeset 240
- Timestamp:
- 10/01/13 02:26:09 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ksyslog/trunk/ksyslog.c
r239 r240 25 25 static struct proc_dir_entry *ksyslog_procdir = NULL; 26 26 static struct proc_dir_entry *ksyslog_proc_queue = NULL; 27 static struct proc_dir_entry *ksyslog_proc_nr_queued = NULL; 27 28 #endif 28 29 … … 372 373 #ifdef CONFIG_PROC_FS 373 374 static void * 374 ksyslog_ queue_seq_start(struct seq_file *seq, loff_t *pos)375 ksyslog_rculist_seq_start(struct seq_file *seq, loff_t *pos) 375 376 { 376 377 struct list_head *lh, *head = seq->private; … … 387 388 388 389 static void * 389 ksyslog_ queue_seq_next(struct seq_file *seq, void *v, loff_t *pos)390 ksyslog_rculist_seq_next(struct seq_file *seq, void *v, loff_t *pos) 390 391 { 391 392 struct list_head *lh = rcu_dereference(((struct list_head *)v)->next); … … 395 396 396 397 static void 397 ksyslog_ queue_seq_stop(struct seq_file *seq, void *v)398 ksyslog_rculist_seq_stop(struct seq_file *seq, void *v) 398 399 { 399 400 rcu_read_unlock(); … … 417 418 418 419 static struct seq_operations ksyslog_queue_seq_ops = { 419 .start = ksyslog_ queue_seq_start,420 .next = ksyslog_ queue_seq_next,421 .stop = ksyslog_ queue_seq_stop,420 .start = ksyslog_rculist_seq_start, 421 .next = ksyslog_rculist_seq_next, 422 .stop = ksyslog_rculist_seq_stop, 422 423 .show = ksyslog_queue_seq_show, 423 424 }; … … 443 444 444 445 static int 446 ksyslog_nr_queued_seq_show(struct seq_file *seq, void *v) 447 { 448 seq_printf(seq, "%u\n", ksyslog_queue.length); 449 return 0; 450 } 451 452 static int 453 ksyslog_nr_queued_seq_open(struct inode *inode, struct file *file) 454 { 455 return single_open(file, ksyslog_nr_queued_seq_show, PDE(inode)->data); 456 } 457 458 static struct file_operations ksyslog_nr_queued_fops = { 459 .owner = THIS_MODULE, 460 .open = ksyslog_nr_queued_seq_open, 461 .read = seq_read, 462 .llseek = seq_lseek, 463 .release = single_release, 464 }; 465 466 static int 445 467 ksyslog_proc_init(void) 446 468 { … … 459 481 } 460 482 483 ksyslog_proc_nr_queued = proc_create("nr_queued", S_IRUGO, ksyslog_procdir, 484 &ksyslog_nr_queued_fops); 485 if (ksyslog_proc_nr_queued == NULL) { 486 remove_proc_entry(ksyslog_proc_queue->name, ksyslog_proc_queue->parent); 487 remove_proc_entry(ksyslog_procdir->name, ksyslog_procdir->parent); 488 pr_err("proc_create failed\n"); 489 return -ENOMEM; 490 } 491 461 492 return 0; 462 493 } … … 465 496 ksyslog_proc_destroy(void) 466 497 { 498 if (ksyslog_proc_nr_queued) 499 remove_proc_entry(ksyslog_proc_nr_queued->name, ksyslog_proc_nr_queued->parent); 500 ksyslog_proc_nr_queued = NULL; 501 467 502 if (ksyslog_proc_queue) 468 503 remove_proc_entry(ksyslog_proc_queue->name, ksyslog_proc_queue->parent);
Note: See TracChangeset
for help on using the changeset viewer.