From patchwork Thu Nov 21 15:10:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenneth Dsouza X-Patchwork-Id: 11256373 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4BA2D14E5 for ; Thu, 21 Nov 2019 15:11:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C18A20709 for ; Thu, 21 Nov 2019 15:11:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="SKwGuCOG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726623AbfKUPLD (ORCPT ); Thu, 21 Nov 2019 10:11:03 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:51474 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726358AbfKUPLD (ORCPT ); Thu, 21 Nov 2019 10:11:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574349061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NjpIfxHgFRBYgY046me3oAg8/k1k1hVKmtcFylljr00=; b=SKwGuCOG1GkI4VwA2DoSLGSF/jGD4ryEP7JOqxITgl6a7DDn3Pi12kDzgg+DkTyczDvD+L 78eSZsoGVMhN2Rqeme6bWZMccEudCnxZ5WJ2UnBgThoPTjaScfTgOAADq7iszZD/8igYQ/ +HjDIINq8CoMHlNFG7Oim9FVwoBO3Qg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-276-VKzBckN9Pziwhn1bmwuOkw-1; Thu, 21 Nov 2019 10:11:00 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0EA9F8018A3; Thu, 21 Nov 2019 15:10:59 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.76.0.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6146D537B5; Thu, 21 Nov 2019 15:10:57 +0000 (UTC) From: Kenneth D'souza To: linux-cifs@vger.kernel.org Cc: piastryyy@gmail.com, smfrench@gmail.com, lsahlber@redhat.com Subject: [PATCH] smb2-quota: Simplify code logic for quota entries. Date: Thu, 21 Nov 2019 20:40:56 +0530 Message-Id: <20191121151056.19392-1-kdsouza@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: VKzBckN9Pziwhn1bmwuOkw-1 X-Mimecast-Spam-Score: 0 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org This patch changes the program name from smb2quota to smb2-quota and uses a simple code logic for quota entries. Signed-off-by: Kenneth D'souza Signed-off-by: Ronnie Sahlberg --- smb2quota.py => smb2-quota.py | 19 +++++++------------ smb2quota.rst => smb2-quota.rst | 8 ++++---- 2 files changed, 11 insertions(+), 16 deletions(-) rename smb2quota.py => smb2-quota.py (91%) rename smb2quota.rst => smb2-quota.rst (89%) diff --git a/smb2quota.py b/smb2-quota.py similarity index 91% rename from smb2quota.py rename to smb2-quota.py index 21bf4ff..6d0b8a3 100755 --- a/smb2quota.py +++ b/smb2-quota.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # coding: utf-8 # -# smb2quota is a cmdline tool to display quota information for the +# smb2-quota is a cmdline tool to display quota information for the # Linux SMB client file system (CIFS) # # Copyright (C) Ronnie Sahlberg (lsahlberg@redhat.com) 2019 @@ -34,7 +34,7 @@ ENDC = '\033[m' # Rest to defaults def usage(): print("Usage: %s [-h] " % sys.argv[0]) - print("Try 'smb2quota -h' for more information") + print("Try 'smb2-quota -h' for more information") sys.exit() @@ -120,18 +120,13 @@ class QuotaEntry: class Quota: def __init__(self, buf, flag): self.quota = [] - s = struct.unpack_from('