Skip to content

Commit

Permalink
fs: remove 8 bytes of padding from struct writeback_control on 64 bit…
Browse files Browse the repository at this point in the history
… builds

Reorder structure writeback_control to remove 8 bytes of padding on 64
bit builds, this shrinks its size from 48 to 40 bytes.

This structure is always on the stack and uses C99 named initialisation,
so should be safe and have a small impact on stack usage.

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
  • Loading branch information
Richard Kennedy authored and Fengguang Wu committed Apr 25, 2012
1 parent 18cf8cf commit 4cd9069
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/linux/writeback.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ extern const char *wb_reason_name[];
* in a manner such that unspecified fields are set to zero.
*/
struct writeback_control {
enum writeback_sync_modes sync_mode;
long nr_to_write; /* Write this many pages, and decrement
this for each page written */
long pages_skipped; /* Pages which were not written */
Expand All @@ -71,6 +70,8 @@ struct writeback_control {
loff_t range_start;
loff_t range_end;

enum writeback_sync_modes sync_mode;

unsigned for_kupdate:1; /* A kupdate writeback */
unsigned for_background:1; /* A background writeback */
unsigned tagged_writepages:1; /* tag-and-write to avoid livelock */
Expand Down

0 comments on commit 4cd9069

Please sign in to comment.