Skip to contentSkip to conversation

readahead: state based method routines: explicitly embed class_new/class_old inside flags

PATCH Bodo Eggert 2 participants 2 messages Jan 27, 2007 – Jan 28, 2007 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Review

Quoted 12 lines · Fengguang Wu

The new/old ra class were implicitly stored in low bits of file_ra_state.flags. Now make the data structure obvious, and remove the coding tricks.

+++ linux-2.6.20-rc4-mm1/include/linux/fs.h

(quoted diff) +5 -1
-     unsigned long flags;    /* RA_FLAG_xxx | ra_class_old | ra_class_new */
+     union {
+             unsigned long   flags;  /* RA_FLAG_xxx | class_old | class_new */
+             struct {
+                     u8      class_new;
+                     u8      class_old;

This doesn't work on big endiam machines, does it?

IMO you should use a bitfield instead.

Signature · 4 lines
Your e-mail has been returned due to insufficient voltage. 

Friß, Spammer: [email protected]
 [email protected] [email protected]
#3 lore raw
Quoted 15 lines · On Sat, 27 Jan 2007 13:01:08 +0100 Bodo Eggert wrote:

Review

Quoted 12 lines · Fengguang Wu

The new/old ra class were implicitly stored in low bits of file_ra_state.flags. Now make the data structure obvious, and remove the coding tricks.

+++ linux-2.6.20-rc4-mm1/include/linux/fs.h

(quoted diff) +5 -1
-     unsigned long flags;    /* RA_FLAG_xxx | ra_class_old | ra_class_new */
+     union {
+             unsigned long   flags;  /* RA_FLAG_xxx | class_old | class_new */
+             struct {
+                     u8      class_new;
+                     u8      class_old;
Quoted 3 lines

This doesn't work on big endiam machines, does it?

IMO you should use a bitfield instead.

Or "use bit masks instead" since

"The order of allocation of bit-fields within a unit (high-order to low-order or low-order to high-order) is implementation-defined."

---
~Randy