*/
/*
* This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
*
* lustre/obdclass/lu_ref.c
*
LASSERT(seq->private == p);
LASSERT(!list_empty(&ref->lf_linkage));
+ (*pos)++;
spin_lock(&lu_ref_refs_guard);
next = list_entry(ref->lf_linkage.next, struct lu_ref, lf_linkage);
- if (&next->lf_linkage == &lu_ref_refs) {
+ if (&next->lf_linkage == &lu_ref_refs)
p = NULL;
- } else {
- (*pos)++;
+ else
list_move(&ref->lf_linkage, &next->lf_linkage);
- }
spin_unlock(&lu_ref_refs_guard);
+
return p;
}
return 0;
}
-static struct seq_operations lu_ref_seq_ops = {
+static const struct seq_operations lu_ref_seq_ops = {
.start = lu_ref_seq_start,
.stop = lu_ref_seq_stop,
.next = lu_ref_seq_next,
static int lu_ref_seq_release(struct inode *inode, struct file *file)
{
- struct lu_ref *ref = ((struct seq_file *)file->private_data)->private;
+ struct seq_file *m = file->private_data;
+ struct lu_ref *ref = m->private;
spin_lock(&lu_ref_refs_guard);
list_del_init(&ref->lf_linkage);
return seq_release(inode, file);
}
-static struct file_operations lu_ref_dump_fops = {
- .owner = THIS_MODULE,
- .open = lu_ref_seq_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = lu_ref_seq_release
+static const struct file_operations lu_ref_dump_fops = {
+ .owner = THIS_MODULE,
+ .open = lu_ref_seq_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = lu_ref_seq_release
};
#endif /* CONFIG_PROC_FS */