From patchwork Fri Apr 1 15:32:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiago Becker X-Patchwork-Id: 12798470 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8031EC433EF for ; Fri, 1 Apr 2022 16:09:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345613AbiDAQLa (ORCPT ); Fri, 1 Apr 2022 12:11:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349490AbiDAQI4 (ORCPT ); Fri, 1 Apr 2022 12:08:56 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ABDE61A2A30 for ; Fri, 1 Apr 2022 08:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648827156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oxpdjddWsu965voiUt3RDLYE0ZMWuHvFAPmZcNyp+BY=; b=LwMTD6tf+Olbxp+GZRS/yrgHB7fEuWZ2nFIEzlNPyAp0VkrDWr5eYfu+nt+pqmGafywtrc +wDWu+5/twcxoO+30s9g64bpp8q/+uzMdf0lImFS5n8C3mSHTUQJzxi9vqwAhkS9pcVLg0 hSYCnLJWEpWYC/ph3UBBTtZKKdRe8Ao= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-26-07JyOUMpM-eQM4ODuZ56Pw-1; Fri, 01 Apr 2022 11:32:33 -0400 X-MC-Unique: 07JyOUMpM-eQM4ODuZ56Pw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9E34A10AF627; Fri, 1 Apr 2022 15:32:32 +0000 (UTC) Received: from nyarly.redhat.com (ovpn-116-139.gru2.redhat.com [10.97.116.139]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5EA277ADD; Fri, 1 Apr 2022 15:32:29 +0000 (UTC) From: Thiago Becker To: linux-nfs@vger.kernel.org Cc: steved@redhat.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, kolga@netapp.com, Thiago Becker Subject: [PATCH v4 2/7] nfsrahead: configure udev Date: Fri, 1 Apr 2022 12:32:03 -0300 Message-Id: <20220401153208.3120851-3-tbecker@redhat.com> In-Reply-To: <20220401153208.3120851-1-tbecker@redhat.com> References: <20220401153208.3120851-1-tbecker@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Set the udev rule to call the readahead utility. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1946283 Signed-off-by: Thiago Becker --- .gitignore | 1 + tools/nfsrahead/99-nfs.rules.in | 1 + tools/nfsrahead/Makefile.am | 8 ++++++++ 3 files changed, 10 insertions(+) create mode 100644 tools/nfsrahead/99-nfs.rules.in diff --git a/.gitignore b/.gitignore index 38ab1d39..df791a83 100644 --- a/.gitignore +++ b/.gitignore @@ -62,6 +62,7 @@ tools/locktest/testlk tools/getiversion/getiversion tools/nfsconf/nfsconf tools/nfsrahead/nfsrahead +tools/nfsrahead/99-nfs_bdi.rules support/export/mount.h support/export/mount_clnt.c support/export/mount_xdr.c diff --git a/tools/nfsrahead/99-nfs.rules.in b/tools/nfsrahead/99-nfs.rules.in new file mode 100644 index 00000000..7d55b407 --- /dev/null +++ b/tools/nfsrahead/99-nfs.rules.in @@ -0,0 +1 @@ +SUBSYSTEM=="bdi", ACTION=="add", PROGRAM="_libexecdir_/nfsrahead", ATTR{read_ahead_kb}="%c" diff --git a/tools/nfsrahead/Makefile.am b/tools/nfsrahead/Makefile.am index edff7921..58a2ea29 100644 --- a/tools/nfsrahead/Makefile.am +++ b/tools/nfsrahead/Makefile.am @@ -1,3 +1,11 @@ libexec_PROGRAMS = nfsrahead nfsrahead_SOURCES = main.c +udev_rulesdir = /usr/lib/udev/rules.d/ +udev_rules_DATA = 99-nfs.rules + +99-nfs.rules: 99-nfs.rules.in $(builddefs) + $(SED) "s|_libexecdir_|@libexecdir@|g" 99-nfs.rules.in > $@ + +clean-local: + $(RM) 99-nfs.rules