From patchwork Wed Jun 14 04:01:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 9785279 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4FDEC60325 for ; Wed, 14 Jun 2017 04:02:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58EC5283BD for ; Wed, 14 Jun 2017 04:02:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DF722858D; Wed, 14 Jun 2017 04:02:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1F10283BD for ; Wed, 14 Jun 2017 04:02:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750746AbdFNECL (ORCPT ); Wed, 14 Jun 2017 00:02:11 -0400 Received: from mail-pf0-f173.google.com ([209.85.192.173]:33871 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750728AbdFNECJ (ORCPT ); Wed, 14 Jun 2017 00:02:09 -0400 Received: by mail-pf0-f173.google.com with SMTP id s66so9414007pfs.1 for ; Tue, 13 Jun 2017 21:02:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=m/xzn4xnBQY40sqZ3aE+wGy8TaxawesS9N9rSeVXXaQ=; b=yKgbFwlHh+oWcLz/DcWNHvnLNr25XaA7ckvuyFV3YslO0E7Ro416ygD/+ExqNS4P5s sOoM/ov/p1p5zn1F0UrBOJemLPL/5Mgptv6aTBAZodiEBhR+uGHCTSEk/3FJctZxP9cA nL9XDJlVL3aNeKddEOB0C10+/GRO1xTjFa7sVMdK5JrOLWH5eXBAu8ilwTDzOCCBFo7h Q2DHqdgzbIsnLObaRjHNQpOVesCbItz2w44sTR/QlsyNw4pfnOl0OHZ91jzTh9cr/9v9 Yybfb2sSwl9Pug35+alTNuDL3KXS4tdmIdrQF3oEUIEWkEXgKporqcD1kCR0XhBPGqCj jK0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=m/xzn4xnBQY40sqZ3aE+wGy8TaxawesS9N9rSeVXXaQ=; b=f2K1vRTwfeQDc+ToziKdaEfNRZWF09nFdd9zq4LiLJWLnDeiwwJeVBzaF7CC/PfSte o2BUNKYfjjpZSBcSxSgmkZ7D2WOvT6bttB/Uc7US4mD/8k6cK+5oKENzvQb1Vp0Um6At Q4f4MPy/GlcxgTk1LX6L+OECq8lNAek4+gu8nMrtIqthMl+NvW513wNY0IiWGHmUK4yy QvTZhATi1dPGA35BLuHqgf2afAwCJrSiyVKWgqx8V8sDG0gP2YnwmUvllmQibMFcHqnU 8PL/K3u8wiKlmcW+mF91fQ4Ui0v17NrqVHkv4Cl0lSYait52PLyWWZl+6/wMqusPbV3L yQPw== X-Gm-Message-State: AKS2vOwLaIBogxtIC3dI8nV2l/+exHTAEJQI8fX5p1lK/W+6cDxm+CJG uFRllAlMiZ7Ky7p9ZsAHFQ== X-Received: by 10.99.112.86 with SMTP id a22mr2536164pgn.158.1497412928263; Tue, 13 Jun 2017 21:02:08 -0700 (PDT) Received: from localhost.localdomain (66.29.164.166.static.utbb.net. [66.29.164.166]) by smtp.gmail.com with ESMTPSA id f8sm30914083pfc.14.2017.06.13.21.02.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Jun 2017 21:02:07 -0700 (PDT) From: Jens Axboe To: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org Cc: adilger@dilger.ca, Jens Axboe Subject: [PATCH 03/10] fs: add support for an inode to carry stream related data Date: Tue, 13 Jun 2017 22:01:52 -0600 Message-Id: <1497412919-19400-4-git-send-email-axboe@kernel.dk> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497412919-19400-1-git-send-email-axboe@kernel.dk> References: <1497412919-19400-1-git-send-email-axboe@kernel.dk> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP No functional changes in this patch, just in preparation for allowing applications to pass in hints about data life times for writes. Pack the i_stream field into a 2-byte hole, so we don't grow the size of the inode. Reviewed-by: Andreas Dilger Signed-off-by: Jens Axboe --- fs/inode.c | 1 + include/linux/fs.h | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/fs/inode.c b/fs/inode.c index db5914783a71..5717cb378fda 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -149,6 +149,7 @@ int inode_init_always(struct super_block *sb, struct inode *inode) inode->i_blocks = 0; inode->i_bytes = 0; inode->i_generation = 0; + inode->i_stream = 0; inode->i_pipe = NULL; inode->i_bdev = NULL; inode->i_cdev = NULL; diff --git a/include/linux/fs.h b/include/linux/fs.h index 803e5a9b2654..771e172d23d7 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -591,6 +591,7 @@ struct inode { struct timespec i_ctime; spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ unsigned short i_bytes; + unsigned short i_stream; unsigned int i_blkbits; blkcnt_t i_blocks; @@ -655,6 +656,14 @@ struct inode { void *i_private; /* fs or device private pointer */ }; +static inline unsigned int inode_streamid(struct inode *inode) +{ + if (inode) + return inode->i_stream; + + return 0; +} + static inline unsigned int i_blocksize(const struct inode *node) { return (1 << node->i_blkbits);