|
29 | 29 |
|
30 | 30 | #define PSTORE_NAMELEN 64
|
31 | 31 |
|
32 |
| -static DEFINE_SPINLOCK(allpstore_lock); |
33 |
| -static LIST_HEAD(allpstore); |
| 32 | +static DEFINE_SPINLOCK(records_list_lock); |
| 33 | +static LIST_HEAD(records_list); |
34 | 34 |
|
35 | 35 | struct pstore_private {
|
36 | 36 | struct list_head list;
|
@@ -196,9 +196,9 @@ static void pstore_evict_inode(struct inode *inode)
|
196 | 196 |
|
197 | 197 | clear_inode(inode);
|
198 | 198 | if (p) {
|
199 |
| - spin_lock_irqsave(&allpstore_lock, flags); |
| 199 | + spin_lock_irqsave(&records_list_lock, flags); |
200 | 200 | list_del(&p->list);
|
201 |
| - spin_unlock_irqrestore(&allpstore_lock, flags); |
| 201 | + spin_unlock_irqrestore(&records_list_lock, flags); |
202 | 202 | free_pstore_private(p);
|
203 | 203 | }
|
204 | 204 | }
|
@@ -302,16 +302,16 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record)
|
302 | 302 |
|
303 | 303 | WARN_ON(!inode_is_locked(d_inode(root)));
|
304 | 304 |
|
305 |
| - spin_lock_irqsave(&allpstore_lock, flags); |
306 |
| - list_for_each_entry(pos, &allpstore, list) { |
| 305 | + spin_lock_irqsave(&records_list_lock, flags); |
| 306 | + list_for_each_entry(pos, &records_list, list) { |
307 | 307 | if (pos->record->type == record->type &&
|
308 | 308 | pos->record->id == record->id &&
|
309 | 309 | pos->record->psi == record->psi) {
|
310 | 310 | rc = -EEXIST;
|
311 | 311 | break;
|
312 | 312 | }
|
313 | 313 | }
|
314 |
| - spin_unlock_irqrestore(&allpstore_lock, flags); |
| 314 | + spin_unlock_irqrestore(&records_list_lock, flags); |
315 | 315 | if (rc)
|
316 | 316 | return rc;
|
317 | 317 |
|
@@ -343,9 +343,9 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record)
|
343 | 343 |
|
344 | 344 | d_add(dentry, inode);
|
345 | 345 |
|
346 |
| - spin_lock_irqsave(&allpstore_lock, flags); |
347 |
| - list_add(&private->list, &allpstore); |
348 |
| - spin_unlock_irqrestore(&allpstore_lock, flags); |
| 346 | + spin_lock_irqsave(&records_list_lock, flags); |
| 347 | + list_add(&private->list, &records_list); |
| 348 | + spin_unlock_irqrestore(&records_list_lock, flags); |
349 | 349 |
|
350 | 350 | return 0;
|
351 | 351 |
|
|
0 commit comments