925
926#ifdef CONFIG_PROC_FS
927static char *time_delta(char buffer[], long time)
928{
929 time -= jiffies;
930 if (time > LongTime / 2)
931 return ("Not scheduled");
932 if (time < 0)
933 time = 0;
934 sprintf(buffer, "%ld seconds", time / HZ);
935 return (buffer);
936}
937
938
939static struct strip *strip_get_idx(loff_t pos)
940{
941 struct strip *str;
942 int i = 0;
943
944 list_for_each_entry_rcu(str, &strip_list, list) {
945 if (pos == i)
946 return str;
947 ++i;
948 }
949 return NULL;
950}
951
952static void *strip_seq_start(struct seq_file *seq, loff_t *pos)
953{
954 rcu_read_lock();
955 return *pos ? strip_get_idx(*pos - 1) : SEQ_START_TOKEN;
956}
957
958static void *strip_seq_next(struct seq_file *seq, void *v, loff_t *pos)
959{
960 struct list_head *l;
961 struct strip *s;
962
963 ++*pos;
964 if (v == SEQ_START_TOKEN)
965 return strip_get_idx(1);