2001-12-18 03:15:40

by Andreas Bombe

[permalink] [raw]
Subject: 2.5.1 API change summary

One problem with following kernel development is that new APIs are
nowhere really summarized outside of the list thread where they are
developed (if there is a thread at all). So maybe there's this great
new function that simplifies something in your driver, but you don't
know about it and only stumble across it much later (like 50 dev kernel
revisions) and wish you'd known earlier.

So someone should just collect the changes and post a summary to
linux-kernel, now wouldn't that be useful ...

[Silence, far away keyboards can be heard having "So I take it you
volun..." typed on them.]

... and I will try to do that for the kernel 2.5 revisions.

I have collected the API changes in 2.5.1 and summarized below. I just
read the patch for all the *.h files, so I may have confused something
(like not realizing something just moved instead of being new). I also
don't know much about most of the areas I'm summarizing, any corrections
are welcome.

These summaries won't serve as documentation except when it's short and
simple. If there are big changes, I won't list every detail (I just
remind you that there is something, you can read the source yourself).
I will list changes which are global or at least apply to a whole
subsystem.

You'll also find stuff that's pretty much the talk of the week on
linux-kernel and therefore well known, but these summaries should also
serve as a overview ("when was what introduced") in combination with the
kernel changelogs for those who get into 2.5 later (yes, I will archive
these summaries on the web when I get a few together).

So, here it goes:

=======================================================================

include/linux/types.h:

Typedef sector_t for block device sector numbers introduced to allow
making its size an option.


include/linux/cache.h:

New macro __cacheline_aligned_in_smp that expands to __cacheline_aligned
on SMP and to nothing on UP.


include/linux/kernel.h:

New macro BUG_ON(condition) which is equivalent to
if (condition) BUG();

The condition is also hinted "unlikely" to the compiler, which gives
better optimization on recent gcc versions even while decreasing typing
work. (And if you update your code today, we'll throw in this set of
kitchen knives which will stay sharp as a razor forever...)


include/linux/genhd.h:

get_start_sect() and get_nr_sects() on kdev_t introduced.


include/linux/mempool.h (new):

Memory buffer pools introduced. "Such pools are mostly used for
guaranteed, deadlock-free memory allocations during extreme VM load."


include/linux/bio.h (new):
include/linux/blkdev.h:
include/linux/fs.h:
include/linux/highmem.h:

New block IO layer introduced.


include/linux/device.h (new):
include/linux/driverfs_fs.h (new):

Centralized driver model introduced.


drivers/scsi/hosts.h:

Scsi_Host_Template and Scsi_Host include new flag highmem_io, the flag
use_new_eh_code is removed along with the old error handling interface.


drivers/scsi/scsi.h:

New sg list allocation functions scsi_alloc_sgtable() and
scsi_free_sgtable(). Function initialize_merge_fn() renamed to
scsi_initialize_merge_fn(). Function recount_segments() removed,
scsi_init_io() added.


drivers/usb/hid.h:

HID class defines and functions added.


include/linux/usb.h:

Yes, there are lots of changes. I haven't sorted them out yet.

=======================================================================

--
Andreas Bombe <[email protected]> DSA key 0x04880A44


2001-12-18 18:09:43

by Greg KH

[permalink] [raw]
Subject: Re: 2.5.1 API change summary

On Tue, Dec 18, 2001 at 04:14:27AM +0100, Andreas Bombe wrote:
>
>
> drivers/usb/hid.h:
>
> HID class defines and functions added.

These were taken from include/linux/usb.h
No new functions or defines were created.

> include/linux/usb.h:
>
> Yes, there are lots of changes. I haven't sorted them out yet.

- Moved the HID specific defines and functions into include/linux/usb.h
- Added _lots_ of documentation (which involved moving things around to
be in a more logical order).
- removed the FILL_BULK_URB_TO and FILL_INT_URB_TO macros as they were
not being used
- added the usb_fill_control_urb(), usb_fill_bulk_urb() and
usb_fill_int_urb() inline functions to be used instead of the
FILL_*_URB macros.

Hope this helps,

greg k-h

2001-12-18 19:00:43

by Greg KH

[permalink] [raw]
Subject: Re: 2.5.1 API change summary

On Tue, Dec 18, 2001 at 10:06:09AM -0800, Greg KH wrote:
> > include/linux/usb.h:
> >
> > Yes, there are lots of changes. I haven't sorted them out yet.
>
> - Moved the HID specific defines and functions into include/linux/usb.h
^^^^^^^^^^
Should have been
drivers/usb/hid.h,
sorry.

greg k-h

2001-12-18 19:35:53

by Randy.Dunlap

[permalink] [raw]
Subject: Re: 2.5.1 API change summary

On Tue, 18 Dec 2001, Andreas Bombe wrote:

| One problem with following kernel development is that new APIs are
| nowhere really summarized outside of the list thread where they are
| developed (if there is a thread at all). So maybe there's this great
| new function that simplifies something in your driver, but you don't
| know about it and only stumble across it much later (like 50 dev kernel
| revisions) and wish you'd known earlier.
|
| So someone should just collect the changes and post a summary to
| linux-kernel, now wouldn't that be useful ...
|
| [Silence, far away keyboards can be heard having "So I take it you
| volun..." typed on them.]
|
| ... and I will try to do that for the kernel 2.5 revisions.
|
| I have collected the API changes in 2.5.1 and summarized below. I just
| read the patch for all the *.h files, so I may have confused something
| (like not realizing something just moved instead of being new). I also
| don't know much about most of the areas I'm summarizing, any corrections
| are welcome.
|
| These summaries won't serve as documentation except when it's short and
| simple. If there are big changes, I won't list every detail (I just
| remind you that there is something, you can read the source yourself).
| I will list changes which are global or at least apply to a whole
| subsystem.
|
| You'll also find stuff that's pretty much the talk of the week on
| linux-kernel and therefore well known, but these summaries should also
| serve as a overview ("when was what introduced") in combination with the
| kernel changelogs for those who get into 2.5 later (yes, I will archive
| these summaries on the web when I get a few together).
|
| So, here it goes:
|
| =======================================================================

[snip]

I guess you won't see summaries of proposals or actual changes
in IRC discussions (: , but linux-kernel (mailing list) does have
_some_ of them. For links to the ones that I'm aware of (for
2.5.x), see

http://www.osdl.org/archive/rddunlap/linux-port-25x.html .

~Randy

2001-12-18 21:39:05

by Andreas Bombe

[permalink] [raw]
Subject: 2.5.1 API change summary rev. 2

Thanks to Greg KH and David Brownell for helping me with the USB
changes. Here is an updated version:

=======================================================================

GENERAL CHANGES:

include/linux/cache.h:

New macro __cacheline_aligned_in_smp that expands to __cacheline_aligned
on SMP and to nothing on UP.


include/linux/kernel.h:

New macro BUG_ON(condition) which is equivalent to
if (condition) BUG();

The condition is also hinted "unlikely" to the compiler, which gives
better optimization on recent gcc versions even while decreasing typing
work. (And if you update your code today, we'll throw in this set of
kitchen knives which will stay sharp as a razor forever...)


include/linux/mempool.h (new):

Memory buffer pools introduced. "Such pools are mostly used for
guaranteed, deadlock-free memory allocations during extreme VM load."


include/linux/device.h (new):
include/linux/driverfs_fs.h (new):

Centralized driver model introduced. This allows all devices
independent of bus to be registered in a common tree and to improve
power management. See Documentation/driver-model.txt.


BLOCK DEVICES:

include/linux/types.h:

Typedef sector_t for block device sector numbers introduced to allow
making its size an option.


include/linux/genhd.h:

get_start_sect() and get_nr_sects() on kdev_t introduced.


include/linux/bio.h (new):
include/linux/blkdev.h:
include/linux/fs.h:
include/linux/highmem.h:

New block IO layer introduced.


SCSI:

drivers/scsi/hosts.h:

Scsi_Host_Template and Scsi_Host include new flag highmem_io, the flag
use_new_eh_code is removed along with the old error handling interface.


drivers/scsi/scsi.h:

- New sg list allocation functions scsi_alloc_sgtable() and
scsi_free_sgtable().

- Function initialize_merge_fn() renamed to scsi_initialize_merge_fn().
Function recount_segments() removed, scsi_init_io() added.


USB:

include/linux/usb.h:

- Lots of documentation added. Not really an API change but you might
want to know.

- HID specific defines and functions moved into include/linux/usb.h.

- FILL_BULK_URB_TO and FILL_INT_URB_TO macros removed as they were
not being used.

- New inline functions usb_fill_control_urb(), usb_fill_bulk_urb() and
usb_fill_int_urb() replace the FILL_*_URB macros.


drivers/usb/hid.h:

HID class defines and functions moved here.

=======================================================================

--
Andreas Bombe <[email protected]> DSA key 0x04880A44

2001-12-21 16:50:45

by Randy.Dunlap

[permalink] [raw]
Subject: Re: 2.5.1 API change summary

On Fri, 21 Dec 2001, Andreas Bombe wrote:

| On Tue, Dec 18, 2001 at 11:28:02AM -0800, Randy.Dunlap wrote:
| > On Tue, 18 Dec 2001, Andreas Bombe wrote:
| >
| > http://www.osdl.org/archive/rddunlap/linux-port-25x.html .
|
| Nice. I wasn't aware of that page. So basically you attack the same
| problem I do (that it's not obvious that a thread on linux-kernel or
| other lists have interesting information deeply embedded). You point to

Right. and most people don't want to dig for the info. :)

| the archived discussions and documentation whereas I just want to list
| the changes that did actually make it into a certain revision, without
| documenting much.

Your method catches more of the detailed changes -- I had missed
a few.
Mine captures discussion and decision-making.
Both have merits and are useful.

| We could probably combine our efforts, but I can't think of a way how
| (apart from just pointing to each other).

I've updated mine to do that. It will appear soon.

Thanks,
--
~Randy