Changeset 242 for ksyslog/trunk
- Timestamp:
- 10/01/13 20:59:01 (11 years ago)
- Location:
- ksyslog/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ksyslog/trunk/ksyslog.c
r241 r242 12 12 #include "ksyslog.h" 13 13 14 static DEFINE_SPINLOCK(ksyslog_queue_lock);15 14 static DEFINE_SPINLOCK(ksyslog_vfs_lock); 16 15 16 static struct ksyslog_queue ksyslog_queue; 17 17 static struct socket *ksyslog_rcv_sk = NULL; 18 18 19 19 static struct delayed_work ksyslog_work; 20 20 static struct workqueue_struct *ksyslog_wq = NULL; 21 22 static struct ksyslog_queue ksyslog_queue;23 21 24 22 #ifdef CONFIG_PROC_FS … … 33 31 static ushort ksyslog_port = 514; 34 32 static char *ksyslog_path = "/var/log/ksyslog.log"; 35 static ulong ksyslog_queue_length = 2048;33 static ulong ksyslog_queue_length = 4096; 36 34 static ulong ksyslog_flush_interval = 45; /* milliseconds */ 37 35 … … 47 45 memset(queue, 0, sizeof(*queue)); 48 46 INIT_LIST_HEAD(&queue->head); 47 spin_lock_init(&queue->lock); 49 48 atomic64_set(&queue->nr_queued, 0); 50 49 atomic64_set(&queue->nr_written, 0); … … 288 287 ksyslog_queue_init(&write_queue); 289 288 290 spin_lock_bh(&ksyslog_queue _lock);289 spin_lock_bh(&ksyslog_queue.lock); 291 290 ksyslog_entry_migrate(&ksyslog_queue, &write_queue); 292 spin_unlock_bh(&ksyslog_queue _lock);291 spin_unlock_bh(&ksyslog_queue.lock); 293 292 294 293 if (atomic64_read(&write_queue.nr_queued) <= 0) … … 301 300 spin_unlock(&ksyslog_vfs_lock); 302 301 303 spin_lock_bh(&ksyslog_queue _lock);302 spin_lock_bh(&ksyslog_queue.lock); 304 303 ksyslog_entry_migrate(&write_queue, &ksyslog_queue); 305 spin_unlock_bh(&ksyslog_queue _lock);304 spin_unlock_bh(&ksyslog_queue.lock); 306 305 307 306 goto out; … … 329 328 330 329 restore: 331 spin_lock_bh(&ksyslog_queue _lock);330 spin_lock_bh(&ksyslog_queue.lock); 332 331 if (unlikely(ksyslog_entry_add(&ksyslog_queue, entry))) { 333 332 atomic64_inc(&ksyslog_queue.nr_dropped); … … 335 334 call_rcu(&entry->rcu, ksyslog_entry_free); 336 335 } 337 spin_unlock_bh(&ksyslog_queue _lock);336 spin_unlock_bh(&ksyslog_queue.lock); 338 337 } 339 338 … … 366 365 goto err; 367 366 368 spin_lock_bh(&ksyslog_queue _lock);367 spin_lock_bh(&ksyslog_queue.lock); 369 368 err = ksyslog_entry_add(&ksyslog_queue, entry); 370 spin_unlock_bh(&ksyslog_queue _lock);369 spin_unlock_bh(&ksyslog_queue.lock); 371 370 372 371 if (unlikely(err)) { -
ksyslog/trunk/ksyslog.h
r241 r242 74 74 struct ksyslog_queue { 75 75 struct list_head head; 76 spinlock_t lock; 76 77 atomic64_t nr_queued; 77 78 atomic64_t nr_written;
Note: See TracChangeset
for help on using the changeset viewer.