2008-06-24 09:19:20

by Richard Kennedy

[permalink] [raw]
Subject: [PATCH] file lock: reorder struct file_lock to save space on 64 bit builds

reduce sizeof struct file_lock by 8 on 64 bit builds allowing +1 objects
per slab in the file_lock_cache

Signed-off-by: Richard Kennedy <[email protected]>

---

patch against 2.6.26-rc7
successfully running on AMD64 desktop.

Richard



diff --git a/include/linux/fs.h b/include/linux/fs.h
index d490779..a0735d7 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -919,12 +919,12 @@ struct file_lock {
struct list_head fl_link; /* doubly linked list of all locks */
struct list_head fl_block; /* circular list of blocked processes */
fl_owner_t fl_owner;
+ unsigned char fl_flags;
+ unsigned char fl_type;
unsigned int fl_pid;
struct pid *fl_nspid;
wait_queue_head_t fl_wait;
struct file *fl_file;
- unsigned char fl_flags;
- unsigned char fl_type;
loff_t fl_start;
loff_t fl_end;