proc.c (5a84d159061d914c8dd4aa372ac6e9529c2be453) | proc.c (13d31894b3c459805303325aa5b91f9cd4ed70bc) |
---|---|
1/* 2 * Scatterlist Cryptographic API. 3 * 4 * Procfs information. 5 * 6 * Copyright (c) 2002 James Morris <jmorris@intercode.com.au> 7 * Copyright (c) 2005 Herbert Xu <herbert@gondor.apana.org.au> 8 * --- 9 unchanged lines hidden (view full) --- 18#include <linux/crypto.h> 19#include <linux/rwsem.h> 20#include <linux/proc_fs.h> 21#include <linux/seq_file.h> 22#include "internal.h" 23 24static void *c_start(struct seq_file *m, loff_t *pos) 25{ | 1/* 2 * Scatterlist Cryptographic API. 3 * 4 * Procfs information. 5 * 6 * Copyright (c) 2002 James Morris <jmorris@intercode.com.au> 7 * Copyright (c) 2005 Herbert Xu <herbert@gondor.apana.org.au> 8 * --- 9 unchanged lines hidden (view full) --- 18#include <linux/crypto.h> 19#include <linux/rwsem.h> 20#include <linux/proc_fs.h> 21#include <linux/seq_file.h> 22#include "internal.h" 23 24static void *c_start(struct seq_file *m, loff_t *pos) 25{ |
26 struct list_head *v; 27 loff_t n = *pos; 28 | |
29 down_read(&crypto_alg_sem); | 26 down_read(&crypto_alg_sem); |
30 list_for_each(v, &crypto_alg_list) 31 if (!n--) 32 return list_entry(v, struct crypto_alg, cra_list); 33 return NULL; | 27 return seq_list_start(&crypto_alg_list, *pos); |
34} 35 36static void *c_next(struct seq_file *m, void *p, loff_t *pos) 37{ | 28} 29 30static void *c_next(struct seq_file *m, void *p, loff_t *pos) 31{ |
38 struct list_head *v = p; 39 40 (*pos)++; 41 v = v->next; 42 return (v == &crypto_alg_list) ? 43 NULL : list_entry(v, struct crypto_alg, cra_list); | 32 return seq_list_next(p, &crypto_alg_list, pos); |
44} 45 46static void c_stop(struct seq_file *m, void *p) 47{ 48 up_read(&crypto_alg_sem); 49} 50 51static int c_show(struct seq_file *m, void *p) 52{ | 33} 34 35static void c_stop(struct seq_file *m, void *p) 36{ 37 up_read(&crypto_alg_sem); 38} 39 40static int c_show(struct seq_file *m, void *p) 41{ |
53 struct crypto_alg *alg = (struct crypto_alg *)p; | 42 struct crypto_alg *alg = list_entry(p, struct crypto_alg, cra_list); |
54 55 seq_printf(m, "name : %s\n", alg->cra_name); 56 seq_printf(m, "driver : %s\n", alg->cra_driver_name); 57 seq_printf(m, "module : %s\n", module_name(alg->cra_module)); 58 seq_printf(m, "priority : %d\n", alg->cra_priority); 59 seq_printf(m, "refcnt : %d\n", atomic_read(&alg->cra_refcnt)); 60 61 switch (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) { --- 62 unchanged lines hidden --- | 43 44 seq_printf(m, "name : %s\n", alg->cra_name); 45 seq_printf(m, "driver : %s\n", alg->cra_driver_name); 46 seq_printf(m, "module : %s\n", module_name(alg->cra_module)); 47 seq_printf(m, "priority : %d\n", alg->cra_priority); 48 seq_printf(m, "refcnt : %d\n", atomic_read(&alg->cra_refcnt)); 49 50 switch (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) { --- 62 unchanged lines hidden --- |