From patchwork Wed Jan 1 14:10:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pascal VITOUX X-Patchwork-Id: 3423221 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C98029F374 for ; Wed, 1 Jan 2014 14:12:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 067612011B for ; Wed, 1 Jan 2014 14:12:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E01FF200E0 for ; Wed, 1 Jan 2014 14:12:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754198AbaAAOLx (ORCPT ); Wed, 1 Jan 2014 09:11:53 -0500 Received: from smtp2-g21.free.fr ([212.27.42.2]:58186 "EHLO smtp2-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754107AbaAAOLx (ORCPT ); Wed, 1 Jan 2014 09:11:53 -0500 Received: from ThePakaG73S.thepakadom.local (unknown [88.180.115.229]) by smtp2-g21.free.fr (Postfix) with ESMTP id 0E1B24B00B7; Wed, 1 Jan 2014 15:11:44 +0100 (CET) From: Pascal VITOUX To: linux-btrfs@vger.kernel.org Cc: Pascal VITOUX Subject: [PATCH] Skip non-regular files in recursive defrag Date: Wed, 1 Jan 2014 15:10:25 +0100 Message-Id: <1388585425-7051-1-git-send-email-vitoux.pascal@gmail.com> X-Mailer: git-send-email 1.8.5.2 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP --- cmds-filesystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 1c1926b..979dbd9 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -646,7 +646,7 @@ static int defrag_callback(const char *fpath, const struct stat *sb, int e = 0; int fd = 0; - if (typeflag == FTW_F) { + if ((typeflag == FTW_F) && S_ISREG(sb->st_mode)) { if (defrag_global_verbose) printf("%s\n", fpath); fd = open(fpath, O_RDWR);