From patchwork Thu Feb 13 15:13:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mitch Harder X-Patchwork-Id: 3645961 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CE86EBF13A for ; Thu, 13 Feb 2014 15:13:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E75DB20158 for ; Thu, 13 Feb 2014 15:13:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D8C3420154 for ; Thu, 13 Feb 2014 15:13:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751594AbaBMPNp (ORCPT ); Thu, 13 Feb 2014 10:13:45 -0500 Received: from mail-yh0-f46.google.com ([209.85.213.46]:62560 "EHLO mail-yh0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751246AbaBMPNo (ORCPT ); Thu, 13 Feb 2014 10:13:44 -0500 Received: by mail-yh0-f46.google.com with SMTP id v1so10162890yhn.5 for ; Thu, 13 Feb 2014 07:13:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TZTSIbCb7MJk6SHXkyLNaWix7ldxMZVUYnV2s3KC4fs=; b=c9Wt1AMXk6eZi4NsJJFi507lDT1J3H2Licgc/3bUZg182+0YtahBz7SCmDI2bwtaFb lgo1bxXy6yX+5IvrtZIZNDDHYqvfAYfUB18YEXZX7wixWKFaBdIyCUMnEgDsBlbM0Zg7 drtbanaHa+KOBTRAV1jI2JDGqWai3jDsMzZdyLDslCq0RlW9HUl+JiAcndXnUuDwJZlp 0Sdwo/NCsJrdCIR9e7yoZG8pvarixg4SM3hZnYc9trlF9Ydg2DGiwnuCN7+DN0iH89VP NBlkNwkLwaHPzUcDUxukTilZiJ8RqBYinxxBBwk1jcvVTi0GqPsEtbgrxJcbt7oPsgQY BaLQ== X-Gm-Message-State: ALoCoQlO6Mzz+XFJ7VVjIxu0W8o56XnOj9uE8tOqojWqsuXKxdHE+xO8MyHTOV1793SMgxqk6qRq X-Received: by 10.236.41.225 with SMTP id h61mr772966yhb.152.1392304422852; Thu, 13 Feb 2014 07:13:42 -0800 (PST) Received: from dellpdslx.gateway.2wire.net (108-84-253-144.lightspeed.moblal.sbcglobal.net. [108.84.253.144]) by mx.google.com with ESMTPSA id h80sm6731861yha.23.2014.02.13.07.13.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Feb 2014 07:13:42 -0800 (PST) From: Mitch Harder To: linux-btrfs@vger.kernel.org Cc: Mitch Harder Subject: [PATCH] Btrfs: fix max_inline mount option Date: Thu, 13 Feb 2014 09:13:16 -0600 Message-Id: <1392304396-4952-1-git-send-email-mitch.harder@sabayonlinux.org> X-Mailer: git-send-email 1.8.3.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.5 required=5.0 tests=BAYES_00, 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 Currently, the only mount option for max_inline that has any effect is max_inline=0. Any other value that is supplied to max_inline will be adjusted to a minimum of 4k. Since max_inline has an effective maximum of ~3900 bytes due to page size limitations, the current behaviour only has meaning for max_inline=0. This patch will allow the the max_inline mount option to accept non-zero values as indicated in the documentation. Signed-off-by: Mitch Harder --- fs/btrfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 97cc241..e73c80e 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -566,7 +566,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options) kfree(num); if (info->max_inline) { - info->max_inline = max_t(u64, + info->max_inline = min_t(u64, info->max_inline, root->sectorsize); }