]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: cleanup locking in table update code
authorKarel Zak <kzak@redhat.com>
Fri, 19 Jan 2024 11:58:50 +0000 (12:58 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 19 Jan 2024 17:09:38 +0000 (18:09 +0100)
commitb94b5929a63df9786020e0329e94d2f35f3993ae
treefd5c0672c543928118ecd0f7d1992efb17ad6e4c
parent87938635348a788ffd10cdbfb9055eddc2ed7a9f
libmount: cleanup locking in table update code

* use reference counting for libmnt_lock

* remove lock use from mnt_update_already_done(), it's read-only
  operation and utab update is atomic (based on rename(2))

* keep the lock instance mandatory for all low-level update_*
  functions. The lock is always initialized, so all the 'if(lc)'
  are unnecessary.

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context.c
libmount/src/mountP.h
libmount/src/tab_update.c