Project

General

Profile

Bug #4539

_t_checkfd() should not call find_tilink() if force_sync is set

Added by Marcel Telka almost 7 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
lib - userland libraries
Start date:
2014-01-27
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

As a minor optimization, we shouldn't call find_tilink() here in _t_checkfd() in a case the force_sync is set:

85    tiptr = NULL;
86    sig_mutex_lock(&_ti_userlock);
87    if ((tiptr = find_tilink(fd)) != NULL) {
88        if (!force_sync) {
89            sig_mutex_unlock(&_ti_userlock);
90            return (tiptr);
91        }
92    }
93    sig_mutex_unlock(&_ti_userlock);

The above code could be changed to something like this:

if (!force_sync) {
    sig_mutex_lock(&_ti_userlock);
    tiptr = find_tilink(fd);
    sig_mutex_unlock(&_ti_userlock);
    if (tiptr != NULL)
        return (tiptr);
}
#1

Updated by Marcel Telka over 6 years ago

  • Assignee set to Marcel Telka
#2

Updated by Marcel Telka over 6 years ago

  • Status changed from New to In Progress
  • Tags deleted (needs-triage)
#3

Updated by Marcel Telka almost 6 years ago

  • Status changed from In Progress to Pending RTI
#4

Updated by Electric Monk almost 6 years ago

  • Status changed from Pending RTI to Closed
  • % Done changed from 0 to 100

git commit c62da27859e36f9fdd8cee3c6df3ad567543dcf9

commit  c62da27859e36f9fdd8cee3c6df3ad567543dcf9
Author: Marcel Telka <marcel.telka@nexenta.com>
Date:   2015-02-11T16:29:32.000Z

    4539 _t_checkfd() should not call find_tilink() if force_sync is set
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Reviewed by: Dan McDonald <danmcd@omniti.com>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Also available in: Atom PDF