From mboxrd@z Thu Jan 1 00:00:00 1970 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 0DBE8C433EF for ; Fri, 7 Jan 2022 18:46:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229622AbiAGSqQ (ORCPT ); Fri, 7 Jan 2022 13:46:16 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:37590 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229834AbiAGSqQ (ORCPT ); Fri, 7 Jan 2022 13:46:16 -0500 Received: from pps.filterd (m0109333.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 207HG2bI026222 for ; Fri, 7 Jan 2022 10:46:15 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=facebook; bh=zXwDVjF+Caxwi6lk1xcTGHCmca2pE0ClsucMAp8/Vy4=; b=YpZ9Bgsl7/r3TjMVMmn0JGhjcRE5M7Ep6FgMVYlSLITzTq+BnOtEfRZx+8yA4D09OqdL 24P0QMKEAQwH+dKTp/xQY8Psxh6Ltp14lb/MA4GLdUJ44T9fEkS7as//0SHudWknZNG0 pzwFkFlI6flbEfD3pdHBH2/qh9tNAisXVCo= Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3de4wg7p0c-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 07 Jan 2022 10:46:15 -0800 Received: from twshared5363.25.prn2.facebook.com (2620:10d:c085:208::f) by mail.thefacebook.com (2620:10d:c085:11d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Fri, 7 Jan 2022 10:46:14 -0800 Received: by devbig921.prn2.facebook.com (Postfix, from userid 132113) id C659F1662906; Fri, 7 Jan 2022 10:46:05 -0800 (PST) From: Christy Lee To: , CC: , , , Subject: [PATCH bpf-next v3 1/2] libbpf: rename bpf_prog_attach_xattr() to bpf_prog_attach_opts() Date: Fri, 7 Jan 2022 10:46:03 -0800 Message-ID: <20220107184604.3668544-2-christylee@fb.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220107184604.3668544-1-christylee@fb.com> References: <20220107184604.3668544-1-christylee@fb.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-GUID: EQt_CTumNE1xWiPUTGiwoGhgHDMNjljD X-Proofpoint-ORIG-GUID: EQt_CTumNE1xWiPUTGiwoGhgHDMNjljD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-07_08,2022-01-07_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=fb_outbound_notspam policy=fb_outbound score=0 mlxscore=0 phishscore=0 spamscore=0 adultscore=0 suspectscore=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 priorityscore=1501 mlxlogscore=999 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201070118 X-FB-Internal: deliver Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org All xattr APIs are being dropped, let's converge to the convention used i= n high-level APIs and rename bpf_prog_attach_xattr to bpf_prog_attach_opts. Signed-off-by: Christy Lee --- tools/lib/bpf/bpf.c | 9 +++++++-- tools/lib/bpf/bpf.h | 4 ++++ tools/lib/bpf/libbpf.map | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c index 9b64eed2b003..7e564c4438c9 100644 --- a/tools/lib/bpf/bpf.c +++ b/tools/lib/bpf/bpf.c @@ -754,10 +754,10 @@ int bpf_prog_attach(int prog_fd, int target_fd, enu= m bpf_attach_type type, .flags =3D flags, ); =20 - return bpf_prog_attach_xattr(prog_fd, target_fd, type, &opts); + return bpf_prog_attach_opts(prog_fd, target_fd, type, &opts); } =20 -int bpf_prog_attach_xattr(int prog_fd, int target_fd, +int bpf_prog_attach_opts(int prog_fd, int target_fd, enum bpf_attach_type type, const struct bpf_prog_attach_opts *opts) { @@ -778,6 +778,11 @@ int bpf_prog_attach_xattr(int prog_fd, int target_fd= , return libbpf_err_errno(ret); } =20 +__attribute__((alias("bpf_prog_attach_opts"))) +int bpf_prog_attach_xattr(int prog_fd, int target_fd, + enum bpf_attach_type type, + const struct bpf_prog_attach_opts *opts); + int bpf_prog_detach(int target_fd, enum bpf_attach_type type) { union bpf_attr attr; diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h index 00619f64a040..5dc9fefe73f3 100644 --- a/tools/lib/bpf/bpf.h +++ b/tools/lib/bpf/bpf.h @@ -280,6 +280,10 @@ struct bpf_prog_attach_opts { =20 LIBBPF_API int bpf_prog_attach(int prog_fd, int attachable_fd, enum bpf_attach_type type, unsigned int flags); +LIBBPF_API int bpf_prog_attach_opts(int prog_fd, int attachable_fd, + enum bpf_attach_type type, + const struct bpf_prog_attach_opts *opts); +LIBBPF_DEPRECATED_SINCE(0, 8, "use bpf_prog_attach_opts() instead") LIBBPF_API int bpf_prog_attach_xattr(int prog_fd, int attachable_fd, enum bpf_attach_type type, const struct bpf_prog_attach_opts *opts); diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map index 529783967793..8262cfca2240 100644 --- a/tools/lib/bpf/libbpf.map +++ b/tools/lib/bpf/libbpf.map @@ -247,6 +247,7 @@ LIBBPF_0.0.8 { bpf_link_create; bpf_link_update; bpf_map__set_initial_value; + bpf_prog_attach_opts; bpf_program__attach_cgroup; bpf_program__attach_lsm; bpf_program__is_lsm; --=20 2.30.2