From patchwork Thu Aug 16 19:24:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hefty, Sean" X-Patchwork-Id: 1334861 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 9497E40211 for ; Thu, 16 Aug 2012 19:24:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753188Ab2HPTY1 (ORCPT ); Thu, 16 Aug 2012 15:24:27 -0400 Received: from mga09.intel.com ([134.134.136.24]:28674 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753308Ab2HPTYY convert rfc822-to-8bit (ORCPT ); Thu, 16 Aug 2012 15:24:24 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 16 Aug 2012 12:24:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.77,780,1336374000"; d="scan'208";a="187368119" Received: from orsmsx603.amr.corp.intel.com ([10.22.226.49]) by orsmga002.jf.intel.com with ESMTP; 16 Aug 2012 12:24:23 -0700 Received: from orsmsx153.amr.corp.intel.com (10.22.226.247) by orsmsx603.amr.corp.intel.com (10.22.226.49) with Microsoft SMTP Server (TLS) id 8.2.255.0; Thu, 16 Aug 2012 12:24:23 -0700 Received: from orsmsx101.amr.corp.intel.com ([169.254.8.152]) by ORSMSX153.amr.corp.intel.com ([169.254.13.86]) with mapi id 14.01.0355.002; Thu, 16 Aug 2012 12:24:23 -0700 From: "Hefty, Sean" To: "linux-rdma (linux-rdma@vger.kernel.org)" Subject: [PATCH 1/7] librdmacm/rspreload: Call real.close in fd_close Thread-Topic: [PATCH 1/7] librdmacm/rspreload: Call real.close in fd_close Thread-Index: Ac174aEfJ9K/S9/mSeWN2p8mXqqD+g== Date: Thu, 16 Aug 2012 19:24:22 +0000 Message-ID: <1828884A29C6694DAF28B7E6B8A8237346A8995C@ORSMSX101.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org The index into the preload lookup table is obtained by opening /dev/null and use the returned value. When closing the file, use the real close call and not the preload close call. This is a minor optimization, but clarifies the expected operation. Signed-off-by: Sean Hefty --- src/preload.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/src/preload.c b/src/preload.c index 52eaf1a..a680143 100644 --- a/src/preload.c +++ b/src/preload.c @@ -131,7 +131,7 @@ static int fd_open(void) return index; err2: - close(index); + real.close(index); err1: free(fdi); return ret; @@ -187,7 +187,7 @@ static enum fd_type fd_close(int index, int *fd) idm_clear(&idm, index); *fd = fdi->fd; type = fdi->type; - close(index); + real.close(index); free(fdi); } else { *fd = index;