From patchwork Sat Jun 26 21:18:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Kononenko X-Patchwork-Id: 467924 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC792C49EA7 for ; Sat, 26 Jun 2021 21:18:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C63846162C for ; Sat, 26 Jun 2021 21:18:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230363AbhFZVVO (ORCPT ); Sat, 26 Jun 2021 17:21:14 -0400 Received: from mta-02.yadro.com ([89.207.88.252]:47316 "EHLO mta-01.yadro.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230329AbhFZVVM (ORCPT ); Sat, 26 Jun 2021 17:21:12 -0400 Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id B915E41374; Sat, 26 Jun 2021 21:18:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1624742327; x=1626556728; bh=NjUXmDvODIG4mmn9yCdR8yIIkg4JaCGdQlL QdiV7Hss=; b=esswhwC56BD6DQI4RYH3I+lq2CKEXvwCALxr/AjgYRf7faZDUaS wox7jKIvr0Ahw+HoDNMyHO0RZzt5VdHlyOdyTLMsz4hKO95miFIfN/59fQy//+qf 8NwEIip8P4gWIBbSyCqcKx9Dgv7bo5gtTo/v8ur73C1tApj1TCqGo4k4= X-Virus-Scanned: amavisd-new at yadro.com Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0dySZJUevoas; Sun, 27 Jun 2021 00:18:47 +0300 (MSK) Received: from T-EXCH-03.corp.yadro.com (t-exch-03.corp.yadro.com [172.17.100.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id A0452413B4; Sun, 27 Jun 2021 00:18:47 +0300 (MSK) Received: from localhost.localdomain (10.199.0.6) by T-EXCH-03.corp.yadro.com (172.17.100.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Sun, 27 Jun 2021 00:18:47 +0300 From: Igor Kononenko To: Felipe Balbi , Greg Kroah-Hartman CC: , Igor Kononenko , , Subject: [PATCH 4/6] fms: Support the DVD/BD images size over 2.1Gb Date: Sun, 27 Jun 2021 00:18:17 +0300 Message-ID: <20210626211820.107310-5-i.kononenko@yadro.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210626211820.107310-1-i.kononenko@yadro.com> References: <20210626211820.107310-1-i.kononenko@yadro.com> MIME-Version: 1.0 X-Originating-IP: [10.199.0.6] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-03.corp.yadro.com (172.17.100.103) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Adds the ability to use the FMS image size greater than 2.1Gb. This limitation is due to the maximum number of available frames on the CD-ROM media. An incoming implementation of additional media formats (DVD-ROM, BD-ROM) should support both formats' possible capacity. End-user-impact: Now, the FMS able to use a medium-image backend file, which size is more significant than 2.1Gb Signed-off-by: Igor Kononenko --- drivers/usb/gadget/function/storage_common.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/usb/gadget/function/storage_common.c b/drivers/usb/gadget/function/storage_common.c index b883b8b7b05b..468f7622b11d 100644 --- a/drivers/usb/gadget/function/storage_common.c +++ b/drivers/usb/gadget/function/storage_common.c @@ -242,15 +242,8 @@ int fsg_lun_open(struct fsg_lun *curlun, const char *filename) num_sectors = size >> blkbits; /* File size in logic-block-size blocks */ min_sectors = 1; - if (curlun->cdrom) { + if (curlun->cdrom) min_sectors = 300; /* Smallest track is 300 frames */ - if (num_sectors >= 256*60*75) { - num_sectors = 256*60*75 - 1; - LINFO(curlun, "file too big: %s\n", filename); - LINFO(curlun, "using only first %d blocks\n", - (int) num_sectors); - } - } if (num_sectors < min_sectors) { LINFO(curlun, "file too small: %s\n", filename); rc = -ETOOSMALL;