mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: mingo@elte.hu
Cc: Linus Torvalds <torvalds@transmeta.com>,
	dent@cosy.sbg.ac.at, adilger@clusterfs.com, da-x@gmx.net,
	patch@luckynet.dynu.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 2.5.21 - list.h cleanup
Date: Thu, 13 Jun 2002 15:51:47 +1000	[thread overview]
Message-ID: <E17INWO-0005RJ-00@wagner.rustcorp.com.au> (raw)
In-Reply-To: Your message of "Wed, 12 Jun 2002 21:45:22 +0200." <Pine.LNX.4.44.0206122125210.17567-100000@elte.hu>

In message <Pine.LNX.4.44.0206122125210.17567-100000@elte.hu> you write:
> On Tue, 11 Jun 2002, Rusty Russell wrote:
> > PS.  I blame Ingo: list_t indeed!
> 
> the reason why i added list_t to the scheduler code was mainly for
> aesthetic reasons. I'm still using 80x25 text consoles mainly, which are
> more sensitive to code length. Also, 'struct list_head' did not reflect
> the kind of lightweight list type we have, 'list_t' does that better. Eg.:

I agree calling it "struct list" or "struct dlist" would have been
nicer, but we're stuck with it now.

> but if typedefs create other problems then these arguments are secondary i
> guess. I'm completely against redefining base types for no particular
> reason, like counter_t.

Patch below.  There aren't many uses of list_t at all, but thousands
of "struct list_head" users.

> But i think it would be useful to introduce some sort of '_t convention',
> where _t always means a complex (or potentially complex - opaque) type. It
> makes code so much more compact and readable, and it does not hide
> anything - _t *always* means a complex type in the way i use it.

OTOH, I've thought of adding a kerrno_t which is an int, and only
useful for documentation purposes (meaning: I return 0 or -errno).
This conflicts with your _t definition 8(

Cheers,
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.21/include/linux/device.h tmp/include/linux/device.h
--- linux-2.5.21/include/linux/device.h	Mon Jun 10 16:03:55 2002
+++ tmp/include/linux/device.h	Thu Jun 13 15:44:58 2002
@@ -56,9 +56,9 @@
 	rwlock_t		lock;
 	atomic_t		refcount;
 
-	list_t			node;
-	list_t			devices;
-	list_t			drivers;
+	struct list_head	node;
+	struct list_head	devices;
+	struct list_head	drivers;
 
 	struct driver_dir_entry	dir;
 	struct driver_dir_entry	device_dir;
@@ -92,8 +92,8 @@
 	rwlock_t		lock;
 	atomic_t		refcount;
 
-	list_t			bus_list;
-	list_t			devices;
+	struct list_head	bus_list;
+	struct list_head	devices;
 
 	struct driver_dir_entry	dir;
 
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.21/include/linux/fs.h tmp/include/linux/fs.h
--- linux-2.5.21/include/linux/fs.h	Mon Jun 10 16:03:55 2002
+++ tmp/include/linux/fs.h	Thu Jun 13 15:44:01 2002
@@ -323,8 +323,8 @@
 	struct list_head	io_pages;	/* being prepared for I/O */
 	unsigned long		nrpages;	/* number of total pages */
 	struct address_space_operations *a_ops;	/* methods */
-	list_t			i_mmap;		/* list of private mappings */
-	list_t			i_mmap_shared;	/* list of private mappings */
+	struct list_head	i_mmap;		/* list of private mappings */
+	struct list_head	i_mmap_shared;	/* list of private mappings */
 	spinlock_t		i_shared_lock;  /* and spinlock protecting it */
 	unsigned long		dirtied_when;	/* jiffies of first page dirtying */
 	int			gfp_mask;	/* how to allocate the pages */
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.21/include/linux/list.h tmp/include/linux/list.h
--- linux-2.5.21/include/linux/list.h	Mon Jun  3 12:21:28 2002
+++ tmp/include/linux/list.h	Thu Jun 13 15:44:13 2002
@@ -19,8 +19,6 @@
 	struct list_head *next, *prev;
 };
 
-typedef struct list_head list_t;
-
 #define LIST_HEAD_INIT(name) { &(name), &(name) }
 
 #define LIST_HEAD(name) \
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.21/include/linux/mm.h tmp/include/linux/mm.h
--- linux-2.5.21/include/linux/mm.h	Fri Jun  7 13:59:08 2002
+++ tmp/include/linux/mm.h	Thu Jun 13 15:44:09 2002
@@ -61,7 +61,7 @@
 	 * one of the address_space->i_mmap{,shared} lists,
 	 * for shm areas, the list of attaches, otherwise unused.
 	 */
-	list_t shared;
+	struct list_head shared;
 
 	/* Function pointers to deal with this struct. */
 	struct vm_operations_struct * vm_ops;
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.21/include/linux/sched.h tmp/include/linux/sched.h
--- linux-2.5.21/include/linux/sched.h	Mon Jun 10 16:03:55 2002
+++ tmp/include/linux/sched.h	Thu Jun 13 15:43:48 2002
@@ -259,7 +259,7 @@
 	int lock_depth;		/* Lock depth */
 
 	int prio, static_prio;
-	list_t run_list;
+	struct list_head run_list;
 	prio_array_t *array;
 
 	unsigned long sleep_avg;
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.21/kernel/sched.c tmp/kernel/sched.c
--- linux-2.5.21/kernel/sched.c	Mon Jun 10 16:03:56 2002
+++ tmp/kernel/sched.c	Thu Jun 13 15:45:44 2002
@@ -123,7 +123,7 @@
 struct prio_array {
 	int nr_active;
 	unsigned long bitmap[BITMAP_SIZE];
-	list_t queue[MAX_PRIO];
+	struct list_head queue[MAX_PRIO];
 };
 
 /*
@@ -142,7 +142,7 @@
 	prio_array_t *active, *expired, arrays[2];
 	int prev_nr_running[NR_CPUS];
 	task_t *migration_thread;
-	list_t migration_queue;
+	struct list_head migration_queue;
 } ____cacheline_aligned;
 
 static struct runqueue runqueues[NR_CPUS] __cacheline_aligned;
@@ -499,7 +499,7 @@
 	task_t *next = this_rq->idle, *tmp;
 	runqueue_t *busiest, *rq_src;
 	prio_array_t *array;
-	list_t *head, *curr;
+	struct list_head *head, *curr;
 
 	/*
 	 * We search all runqueues to find the most busy one.
@@ -759,7 +759,7 @@
 	task_t *prev, *next;
 	runqueue_t *rq;
 	prio_array_t *array;
-	list_t *queue;
+	struct list_head *queue;
 	int idx;
 
 	if (unlikely(in_interrupt()))
@@ -1652,7 +1652,7 @@
  */
 
 typedef struct {
-	list_t list;
+	struct list_head list;
 	task_t *task;
 	struct semaphore sem;
 } migration_req_t;
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.21/mm/memory.c tmp/mm/memory.c
--- linux-2.5.21/mm/memory.c	Mon Jun  3 12:21:28 2002
+++ tmp/mm/memory.c	Thu Jun 13 15:43:23 2002
@@ -1028,11 +1028,11 @@
 	return -1;
 }
 
-static void vmtruncate_list(list_t *head, unsigned long pgoff)
+static void vmtruncate_list(struct list_head *head, unsigned long pgoff)
 {
 	unsigned long start, end, len, diff;
 	struct vm_area_struct *vma;
-	list_t *curr;
+	struct list_head *curr;
 
 	list_for_each(curr, head) {
 		vma = list_entry(curr, struct vm_area_struct, shared);
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.21/mm/page_alloc.c tmp/mm/page_alloc.c
--- linux-2.5.21/mm/page_alloc.c	Mon Jun 10 16:03:56 2002
+++ tmp/mm/page_alloc.c	Thu Jun 13 15:43:29 2002
@@ -235,7 +235,7 @@
         zone_t *zone = page_zone(page);
         unsigned long flags;
 	int order;
-	list_t *curr;
+	struct list_head *curr;
 
 	/*
 	 * Should not matter as we need quiescent system for

  reply	other threads:[~2002-06-13  5:52 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-09 11:09 [PATCH][2.5] introduce list_move macros Lightweight patch manager
2002-06-09 11:23 ` Mark Zealey
2002-06-10 14:17   ` Thunder from the hill
2002-06-09 11:48 ` OGAWA Hirofumi
2002-06-09 12:02   ` Thomas 'Dent' Mirlacher
2002-06-09 12:01 ` Russell King
2002-06-09 12:42 ` [PATCH][2.5] introduce list_move macros (revisited) Lightweight patch manager
2002-06-10 15:14   ` Dan Aloni
2002-06-10 15:28   ` [PATCH] 2.5.21 - list.h cleanup Dan Aloni
2002-06-10 15:45     ` Thunder from the hill
2002-06-10 16:37     ` Andreas Dilger
2002-06-10 16:50       ` Thomas 'Dent' Mirlacher
2002-06-10 17:02         ` Linus Torvalds
2002-06-10 17:07           ` Thomas 'Dent' Mirlacher
2002-06-10 17:21             ` Linus Torvalds
2002-06-11  8:00               ` Rusty Russell
2002-06-11  8:33                 ` Linus Torvalds
2002-06-11  8:48                   ` Martin Dalecki
2002-06-11  9:04                   ` Martin Dalecki
2002-06-11  9:14                   ` Rusty Russell
2002-06-12 19:45                     ` Ingo Molnar
2002-06-13  5:51                       ` Rusty Russell [this message]
2002-06-13 14:18                         ` Ingo Molnar
2002-06-11 14:52                   ` george anzinger
2002-06-11 16:03                     ` Daniel Phillips
2002-06-12  1:10                     ` Rusty Russell
2002-06-12  1:29                       ` Linus Torvalds
2002-06-12  6:02                         ` Rusty Russell
2002-06-12  7:11                         ` Martin Dalecki
2002-06-12  7:27                           ` Andrew Morton
2002-06-11 17:54                   ` Gerrit Huizenga
2002-06-12  3:49                     ` Rusty Russell
2002-06-12 17:30                       ` Gerrit Huizenga
2002-06-10 17:26           ` Manik Raina
2002-06-10 17:51           ` Dan Aloni
2002-06-10 21:28     ` Thunder from the hill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E17INWO-0005RJ-00@wagner.rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=adilger@clusterfs.com \
    --cc=da-x@gmx.net \
    --cc=dent@cosy.sbg.ac.at \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=patch@luckynet.dynu.com \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®