]> git.baikalelectronics.ru Git - kernel.git/commit
apparmor: speed up transactional queries
authorJohn Johansen <john.johansen@canonical.com>
Sat, 27 May 2017 00:23:23 +0000 (17:23 -0700)
committerJohn Johansen <john.johansen@canonical.com>
Sun, 11 Jun 2017 00:11:29 +0000 (17:11 -0700)
commit88b0b85c6569ee156a1fe756510775cdedb12e19
treeea55c5132e374a11ad1f88c871bfb5a3878d6885
parenta7cf240324dfc042e7c116e3fbe224779be26718
apparmor: speed up transactional queries

The simple_transaction interface is slow. It requires 4 syscalls
(open, write, read, close) per query and shares a single lock for each
queries.

So replace its use with a compatible in multi_transaction interface.
It allows for a faster 2 syscall pattern per query. After an initial
open, an arbitrary number of writes and reads can be issued. Each
write will reset the query with new data that can be read. Reads do
not clear the data, and can be issued multiple times, and used with
seek, until a new write is performed which will reset the data
available and the seek position.

Note: this keeps the single lock design, if needed moving to a per
file lock will have to come later.

Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/apparmorfs.c