mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 03:48:13 +00:00
Kernel: Pack Flock struct tighter
Flagged by pvs-studio, ordering the members from largest to smallest allows us to save a few bytes in the size of the struct.
This commit is contained in:
parent
07b314e843
commit
85d36e56d2
2 changed files with 2 additions and 2 deletions
|
@ -336,7 +336,7 @@ KResult Inode::apply_flock(Process const& process, OpenFileDescription const& de
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_flocks.append(Flock { new_lock.l_type, new_lock.l_start, new_lock.l_len, &description, process.pid().value() });
|
m_flocks.append(Flock { new_lock.l_start, new_lock.l_len, &description, process.pid().value(), new_lock.l_type });
|
||||||
return KSuccess;
|
return KSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,11 +126,11 @@ private:
|
||||||
IntrusiveListNode<Inode> m_inode_list_node;
|
IntrusiveListNode<Inode> m_inode_list_node;
|
||||||
|
|
||||||
struct Flock {
|
struct Flock {
|
||||||
short type;
|
|
||||||
off_t start;
|
off_t start;
|
||||||
off_t len;
|
off_t len;
|
||||||
OpenFileDescription const* owner;
|
OpenFileDescription const* owner;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
short type;
|
||||||
};
|
};
|
||||||
|
|
||||||
Vector<Flock> m_flocks;
|
Vector<Flock> m_flocks;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue