}
/****************************************************************************
- Next - the functions that deal with storing fd's that have outstanding
- POSIX locks when closed.
-****************************************************************************/
-
-/****************************************************************************
- The records in posix_pending_close_db are composed of an array of
- ints keyed by dev/ino pair. Those ints are the fd's that were open on
- this dev/ino pair that should have been closed, but can't as the lock
- ref count is non zero.
+ Next - the functions that deal with reference count of number of locks open
+ on a dev/ino pair.
****************************************************************************/
/****************************************************************************
- Keep a reference count of the number of locks open on this dev/ino
- pair. Creates entry if it doesn't exist.
+ Increase the lock ref count. Creates lock_ref_count entry if it doesn't exist.
****************************************************************************/
static void increment_lock_ref_count(const files_struct *fsp)
fsp_str_dbg(fsp), (int)lock_ref_count));
}
+/****************************************************************************
+ Reduce the lock ref count.
+****************************************************************************/
+
static void decrement_lock_ref_count(const files_struct *fsp)
{
struct lock_ref_count_key tmp;
fsp_str_dbg(fsp)));
}
+/****************************************************************************
+ Next - the functions that deal with storing fd's that have outstanding
+ POSIX locks when closed.
+****************************************************************************/
+
+/****************************************************************************
+ The records in posix_pending_close_db are composed of an array of
+ ints keyed by dev/ino pair. Those ints are the fd's that were open on
+ this dev/ino pair that should have been closed, but can't as the lock
+ ref count is non zero.
+****************************************************************************/
+
/****************************************************************************
Add an fd to the pending close tdb.
****************************************************************************/
/*
* There are outstanding locks on this dev/inode pair on
- * other fds. Add our fd to the pending close tdb and set
- * fsp->fh->fd to -1.
+ * other fds. Add our fd to the pending close db. We also
+ * set fsp->fh->fd to -1 inside fd_close() after returning
+ * from VFS layer.
*/
add_fd_to_close_entry(fsp);