API changes in the 2.6 kernel series [LWN.net] (original) (raw)

The 2.6 kernel development series differs from its predecessors in that much larger and potentially destabilizing changes are being incorporated into each release. Among these changes are modifications to the internal programming interfaces for the kernel, with the result that kernel developers must work harder to stay on top of a continually-shifting API. There has never been a guarantee of internal API stability within the kernel - even in a stable development series - but the rate of change is higher now.

This article will be updated to keep track of the internal changes for each 2.6 kernel release. Its permanent location is:

http://lwn.net/Articles/2.6-kernel-api/

If you are looking for changes prior to 2.6.26, you'll find them on the older version of this page.

Last update: September 9, 2009.

2.6.31 (September 9, 2009)

2.6.30 (June 9, 2009)

The difference here is that vbin_printf() places the binary value of its arguments into bin_buf. The process can be reversed with bstr_printf(), which formats a string from the given binary buffer. The main use for these functions would appear to be with Ftrace; they allow the encoding of values to be deferred until a given trace string is read by user space.

2.6.29 (March 23, 2009)

2.6.28 (December 24, 2008)

2.6.27 (October 9, 2008)

Those who see a resemblance to device_create_drvdata() are right; all in-tree users were converted over to that interface, the old device_create() was removed, anddevice_create_drvdata() was renamed. For now, a macro makes calls to device_create_drvdata() do the right thing, but that macro will probably go away before the 2.6.27 final release.

Details of this interface can be found in this article, with the one note that early versions were called fast_gup() instead. (See also the related lockless page cache work, which was also merged).

They are useful for looking up multiple items in a single call.

2.6.26 (July 13, 2008)

This version adds the data pointer, ensuring that it will be set in the resulting proc_dir_entry structure before user space can try to access it. * The object debugging infrastructure has been merged. * The klist type now has the usual-form macros for declaration and initialization: DEFINE_KLIST() and KLIST_INIT(). Two new functions (klist_add_after() andklist_add_before()) can be used to add entries to a klist in a specific position. * kmap_atomic_to_page() is no longer exported to modules. * There are some new generic functions for performing 64-bit integer division in the kernel:
u64 div_u64(u64 dividend, u32 divisor);
u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder);
s64 div_s64(s64 dividend, s32 divisor)
s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder);
Unlike do_div(), these functions are explicit about whether signed or unsigned math is being done. The x86-specificdiv_long_long_rem() has been removed in favor of these new functions. * There is a new string function:
bool sysfs_streq(const char *s1, const char *s2);
It compares the two strings while ignoring an optional trailing newline. * The prototype for i2c probe() methods has changed:
int (*probe)(struct i2c_client *client,
const struct i2c_device_id *id);
The new id argument supports i2c device name aliasing. * There is a new configuration (MODULE_FORCE_LOAD) which controls whether the loading of modules can be forced if the kernel thinks something is not right; it defaults to "no."