From patchwork Wed Apr 19 16:29:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9688003 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8F1FB6037F for ; Wed, 19 Apr 2017 16:29:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81690283E2 for ; Wed, 19 Apr 2017 16:29:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 74A2728418; Wed, 19 Apr 2017 16:29:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED5BC283E8 for ; Wed, 19 Apr 2017 16:29:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937979AbdDSQ3N (ORCPT ); Wed, 19 Apr 2017 12:29:13 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:32842 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937939AbdDSQ3M (ORCPT ); Wed, 19 Apr 2017 12:29:12 -0400 Received: by mail-wm0-f66.google.com with SMTP id o81so5884126wmb.0; Wed, 19 Apr 2017 09:29:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vqPFiB4hRa9p/BWSXv55nANbcDo8CcGw2Vn+lwv1qVA=; b=HypebCtkfnFelPsyiTgkVtJHxl4cIPZmER1N0QNkBopgieK+MzMyC/xsefGFdttZ/3 q4sjRMUDZbiXb6+QA7M/QEz+gOjT3a5KOPbOk27eMiz3Gn4dPxzpvQgm3nrV5LlR1v5y +XRJnSsadPb+aZ1rzrvMAdvcYWm99npezzucaAIi245Opjs+tCsOB0zL1vz9GphOlzTJ XqDdIT8bzdtUqQ9lvOEfQnNw49bXUkdufIXERe5lqCi5h4BukttknxjdsXHUzo/Qk1u8 2YHpKhT0aTHbpWDgo9kQkmn7KfBj+o01psVwLaJuo0kBTHeXHKHgmPXhxN+4dymL1jkk ssZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vqPFiB4hRa9p/BWSXv55nANbcDo8CcGw2Vn+lwv1qVA=; b=oe9GJyIOD+vv0SR8QuzwWIvJhr7kk6F9frZN/FlHnC27+1RbMArg5Oi384QmZLg0d7 aXPzJRAnnEkP1TEaPx7Ym6RzWfLKXP+pG8mq5Sc1eI4CFaZlHFgC/nueAV4GY3DKmJuJ Gyf94Vp1Vh3M8GFcWaXGkrrEMb5c70lTulRge7RTNDV52WTDP7fkiMjo4fMgMxEtztIm woa7JOTRkgvYX3d+H61OFHSMGZ4zm3DJQpQ8ruKqAQyH+M+44pqW4f7+I/3731t492oC MIU5ty9s79qRt+uXpYZboDmUCzNiSHjPRW1Bq5K/KbJDFL3sDEjXKU2fOontbtVQtf1V svzQ== X-Gm-Message-State: AN3rC/7n/QUydYm/ntQ+DHi/wqwOOV4Eji4CcFDbmvixdYSsNLchZsmE m2ADJl4wUXmQXvm2 X-Received: by 10.28.174.195 with SMTP id x186mr18154022wme.129.1492619350661; Wed, 19 Apr 2017 09:29:10 -0700 (PDT) Received: from amir-VirtualBox.ctera.local (bzq-166-168-31-246.red.bezeqint.net. [31.168.166.246]) by smtp.gmail.com with ESMTPSA id l19sm3983981wre.2.2017.04.19.09.29.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Apr 2017 09:29:10 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Trond Myklebust , Jeff Layton , "J . Bruce Fields" , David Howells , Miklos Szeredi , fstests@vger.kernel.org, linux-unionfs@vger.kernel.org Subject: [PATCH v2 1/4] fstests: remove IRIX test program open_unlink Date: Wed, 19 Apr 2017 19:29:16 +0300 Message-Id: <1492619359-24763-2-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1492619359-24763-1-git-send-email-amir73il@gmail.com> References: <1492619359-24763-1-git-send-email-amir73il@gmail.com> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It does not seem to be used by any test. Signed-off-by: Amir Goldstein --- src/Makefile | 3 -- src/open_unlink.c | 147 ------------------------------------------------------ 2 files changed, 150 deletions(-) delete mode 100644 src/open_unlink.c diff --git a/src/Makefile b/src/Makefile index e62d7a9..247383c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -40,14 +40,11 @@ ifeq ($(HAVE_FALLOCATE), true) LCFLAGS += -DHAVE_FALLOCATE endif -IRIX_TARGETS = open_unlink - ifeq ($(PKG_PLATFORM),linux) TARGETS += $(LINUX_TARGETS) endif ifeq ($(PKG_PLATFORM),irix) -TARGETS += $(IRIX_TARGETS) LLDLIBS += -lgen endif diff --git a/src/open_unlink.c b/src/open_unlink.c deleted file mode 100644 index 9f83929..0000000 --- a/src/open_unlink.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 2005 Silicon Graphics, Inc. - * All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef ATTR_PARENT -#define ATTR_PARENT 0x0040 -#endif - -#define EA_LISTBUF_SZ 16384 - -int -main(int argc, char *argv[]) -{ - char *path; - int fd; - char *prog = argv[0]; - void *handle; - size_t hlen; - attrlist_cursor_t cursor; - attrlist_t *ea_listbuf = (attrlist_t *)malloc(EA_LISTBUF_SZ); - uint64_t parent_ino; - uint64_t link_cnt; - int sts; - int nameix; - attrlist_ent_t *entp; - - if (argc < 2) { - fprintf(stderr, "%s: missing pathname argument\n", prog); - return 1; - } - path = argv[1]; - - if (argc > 2) { - fprintf(stderr, "%s: too many arguments\n", prog); - return 1; - } - - /* if file already exists then error out */ - if (access(path, F_OK) == 0) { - fprintf(stderr, "%s: file \"%s\" already exists\n", prog, path); - return 1; - } - - fd = open(path, O_RDWR|O_CREAT|O_EXCL); - if (fd == -1) { - fprintf(stderr, "%s: failed to create \"%s\": %s\n", prog, path, strerror(errno)); - return 1; - } - - - /* for linux libhandle version - to set libhandle fsfd cache */ - { - void *fshandle; - size_t fshlen; - - if (path_to_fshandle(path, &fshandle, &fshlen) != 0) { - fprintf(stderr, "%s: failed path_to_fshandle \"%s\": %s\n", - prog, path, strerror(errno)); - return 1; - } - } - - - /* - * look at parentptr EAs and see if the path exists now that - * it has been unlinked. - */ - if (fd_to_handle(fd, &handle, &hlen) != 0) { - fprintf(stderr, "%s: failed to fd_to_handle \"%s\": %s\n", - prog, path, strerror(errno)); - return 1; - } - - if (unlink(path) == -1) { - fprintf(stderr, "%s: failed to unlink \"%s\": %s\n", prog, path, strerror(errno)); - return 1; - } - - memset(&cursor, 0, sizeof(cursor)); - - /* just do one call - don't bother with continue logic */ - sts = attr_list_by_handle(handle, - hlen, - (char*)ea_listbuf, - EA_LISTBUF_SZ, - ATTR_PARENT, - &cursor); - if (sts != 0) { - fprintf(stderr, "%s: failed to list attr for \"%s\": %s\n", prog, path, strerror(errno)); - return 1; - } - - printf("ea count = %d\n", ea_listbuf->al_count); - - /* - * process EA list - */ - for (nameix = 0; nameix < ea_listbuf->al_count; nameix++) { - entp = ATTR_ENTRY(ea_listbuf, nameix); - - sts = sscanf(entp->a_name, "%llx %llx", &parent_ino, &link_cnt); - if (sts != 2) { - fprintf(stderr, - "inode-path for \"%s\" is corrupted\n", - path); - - /* go onto next EA name */ - continue; - } - /* just print the info out */ - printf("[%d] parent_ino = %llu, link_cnt = %llu\n", nameix, parent_ino, link_cnt); - } - - - free_handle(handle, hlen); - - if (close(fd) == -1) { - fprintf(stderr, "%s: failed to close \"%s\": %s\n", prog, path, strerror(errno)); - return 1; - } - - return 0; -}