Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754033AbdLNRil (ORCPT ); Thu, 14 Dec 2017 12:38:41 -0500 Received: from mail-wm0-f48.google.com ([74.125.82.48]:44326 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753600AbdLNRii (ORCPT ); Thu, 14 Dec 2017 12:38:38 -0500 X-Google-Smtp-Source: ACJfBostHxoQsjzEdTLx9APPXZL/Rfjaf46AKdJS4l95LcrYW9jIfPMrkAr+YL/BNhjaUtCCE2E/bw== To: Goldwyn Rodrigues , linux-kernel , linux-xfs@vger.kernel.org From: Avi Kivity Subject: Detecting RWF_NOWAIT support Organization: ScyllaDB Message-ID: Date: Thu, 14 Dec 2017 19:38:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 699 Lines: 18 I'm looking to add support for RWF_NOWAIT within a linux-aio iocb. Naturally, I need to detect at runtime whether the kernel support RWF_NOWAIT or not. The only method I could find was to issue an I/O with RWF_NOWAIT set, and look for errors. This is somewhat less than perfect:  - from the error, I can't tell whether RWF_NOWAIT was the problem, or something else. If I enable a number of new features, I have to run through all combinations to figure out which ones are supported and which are not.  - RWF_NOWAIT support is per-filesystem, so I can't just remember not to enable RWF_NOWAIT globally, I have to track it per file. Did I miss another method of detecting RWF_NOWAIT?