From patchwork Tue Jul 31 11:48:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zheng Liu X-Patchwork-Id: 174238 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B9AB12C0083 for ; Tue, 31 Jul 2012 21:40:34 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756027Ab2GaLkb (ORCPT ); Tue, 31 Jul 2012 07:40:31 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:53943 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756028Ab2GaLk1 (ORCPT ); Tue, 31 Jul 2012 07:40:27 -0400 Received: by mail-pb0-f46.google.com with SMTP id rp8so11540999pbb.19 for ; Tue, 31 Jul 2012 04:40:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=GMuyQGLhF9w/GPPZzu7iSYiQqdCMb+EO/P3KP+B7eKM=; b=irf7bmvUwL5EddEmVzHjUkzP1TpwTdkmPICG+N/eIHOWKK87YuoFTyQkVJ3ABWXBOl DOax2RN+X23JwLQuuXSWCMZ6tdhQ+IjeOvwNUpzHHJqaphmHr5sDzDu1TWoEwIb6zvqh leusWuioY87A16BY2JHnLu4LwL8G+OODXNOFBXIJmpqw8DJPyAxH1pw44aj0XvuGuCnl SEcEsw6qRgDQ7Oha4ONUZRySDyxGLsK7Umu+TBKvw5WhxoTPUmBRBlrItqidsmkzf2qc /CmKgin3gvPF/ToEEVCwwSN4tSC8KlTf577Ge8s6lPT5uspodGxTpuXqd9DeiRkw5m6o oKOA== Received: by 10.68.225.42 with SMTP id rh10mr43503743pbc.116.1343734827351; Tue, 31 Jul 2012 04:40:27 -0700 (PDT) Received: from localhost.localdomain ([182.92.247.2]) by mx.google.com with ESMTPS id oo6sm135950pbc.22.2012.07.31.04.40.25 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 31 Jul 2012 04:40:26 -0700 (PDT) From: Zheng Liu To: linux-ext4@vger.kernel.org Cc: Zheng Liu Subject: [PATCH 22/36 v4] debugfs: make lsdel cmd support inline data Date: Tue, 31 Jul 2012 19:48:15 +0800 Message-Id: <1343735309-30579-23-git-send-email-wenqing.lz@taobao.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1343735309-30579-1-git-send-email-wenqing.lz@taobao.com> References: <1343735309-30579-1-git-send-email-wenqing.lz@taobao.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Zheng Liu Signed-off-by: Zheng Liu --- debugfs/lsdel.c | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-) diff --git a/debugfs/lsdel.c b/debugfs/lsdel.c index bed0ce6..ff283cd 100644 --- a/debugfs/lsdel.c +++ b/debugfs/lsdel.c @@ -141,15 +141,18 @@ void do_lsdel(int argc, char **argv) lsd.free_blocks = 0; lsd.bad_blocks = 0; - retval = ext2fs_block_iterate3(current_fs, ino, - BLOCK_FLAG_READ_ONLY, block_buf, - lsdel_proc, &lsd); - if (retval) { - com_err("ls_deleted_inodes", retval, - "while calling ext2fs_block_iterate2"); - goto next; + if (!ext2fs_has_inline_data(current_fs, ino)) { + retval = ext2fs_block_iterate3(current_fs, ino, + BLOCK_FLAG_READ_ONLY, block_buf, + lsdel_proc, &lsd); + if (retval) { + com_err("ls_deleted_inodes", retval, + "while calling ext2fs_block_iterate2"); + goto next; + } } - if (lsd.free_blocks && !lsd.bad_blocks) { + if (lsd.free_blocks && !lsd.bad_blocks || + ext2fs_has_inline_data(current_fs, ino)) { if (num_delarray >= max_delarray) { max_delarray += 50; delarray = realloc(delarray,