Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp858452img; Tue, 26 Feb 2019 09:45:51 -0800 (PST) X-Google-Smtp-Source: AHgI3IbtTowi7MvYqN85nVbjmFkMzPiGIAyq1EatOfR9DERTwaRX48XaOjcBhLTqq5CjMivlUYnq X-Received: by 2002:a65:624c:: with SMTP id q12mr25565503pgv.379.1551203151475; Tue, 26 Feb 2019 09:45:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551203151; cv=none; d=google.com; s=arc-20160816; b=Klc2ocfjbBVkhYXeiczJgTktBf5D4PhrgXq65ZGAJYs1xPeM2PyWAWJ5NNnM+QI8Hb gHz0mkUCqsCNQGqyJcNEb7N2aLU9ubHu13BF47jl5p0/dt5T7hN+6ZMGPTF+K/jUPtAm 8dKCzeVh4xSMJgnwI7QsvC6L0JMhkq8gNUHZD9CgR/+wHRqmeP/UhKhierYI+Maf2mXk WlIyt3hzn//HqBvpy5Flcp6a9kwqcu5+6savAprOo3H8uCxywEqwpIw09resVM5NijC6 qNKnzj61TBArhKWZQugfv5phjZ829apbXP2qEE2iCEjpIiibPwNB/gHnrn6wPZbXCKKr d/eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=KcGJRQygyK23Z8Kx+SiIlvPHzbddo5Cn2Sgs48pD2j4=; b=o/Qin4Lo1uc5paQyMjYSmRHzI2/InpoiY9UyVE8gA66NPe6eOlWtIR+Pu4V91fXAK7 zifLMerzF//SVvS2K3W1zCkgq2Nuua9ftBYC6Mueu1AbSbC6O7HhXE3NM+2Xq1qeOoJg XXYKzLPWMeMODUJTMmMPSqPMty7qkJ0mP8kS2u3g+y4wFQV28aaYUWqokiX9lEzOMMpL 5to03U/G3oX+G0E/YsmQPEvBAn+VziL/lft2w6fGYpSapB6LcplV1eiMTjnMzX5R/7ho RF1FO34z5tF94t/KhTh5d7tXazufRwymjG7HDN5i8mjecwTOJ6OcRx57SpfCmaxs+laI yd2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1GArn06c; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8si12319002plr.54.2019.02.26.09.45.35; Tue, 26 Feb 2019 09:45:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1GArn06c; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728768AbfBZRpL (ORCPT + 99 others); Tue, 26 Feb 2019 12:45:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:46926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727108AbfBZRpK (ORCPT ); Tue, 26 Feb 2019 12:45:10 -0500 Received: from localhost (unknown [104.132.1.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 69D052173C; Tue, 26 Feb 2019 17:45:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551203109; bh=RLv6CFxi1O6x2llBM7FCu3PlHR+p6Joxu18t2U5hK/o=; h=From:To:Cc:Subject:Date:From; b=1GArn06cTd2b33bjiLCOMA/XIgKKUljw66jfdEpQ0f9+X50+3PuqrIgqAFHP64TQu 3SMHxT3NTAi7/LopR4DcyZBEAbjHoGhs4w/UBe6tSqhomy8qrvkKfPyn5g5rT+N2HA ZxhPyOx/NoyO3qL95kE1UkTdhv0WEnGjsZx+FBzo= From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH] f2fs: give random value to i_generation Date: Tue, 26 Feb 2019 09:45:07 -0800 Message-Id: <20190226174507.76205-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This follows to give random number to i_generation along with commit 232530680290b ("ext4: improve smp scalability for inode generation") This can be used for DUN for UFS HW encryption. Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 2 -- fs/f2fs/namei.c | 3 ++- fs/f2fs/super.c | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 19cbf17550c7..3007759dd2dd 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1242,8 +1242,6 @@ struct f2fs_sb_info { unsigned int nquota_files; /* # of quota sysfile */ - u32 s_next_generation; /* for NFS support */ - /* # of pages, see count_type */ atomic_t nr_pages[NR_COUNT_TYPE]; /* # of allocated blocks */ diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 62d9829f3a6a..f218d9424d8b 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -50,7 +51,7 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode) inode->i_blocks = 0; inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); F2FS_I(inode)->i_crtime = inode->i_mtime; - inode->i_generation = sbi->s_next_generation++; + inode->i_generation = prandom_u32(); if (S_ISDIR(inode->i_mode)) F2FS_I(inode)->i_current_depth = 1; diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 45121190a2ba..42eb5c86330a 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -3129,7 +3129,6 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) sb->s_maxbytes = sbi->max_file_blocks << le32_to_cpu(raw_super->log_blocksize); sb->s_max_links = F2FS_LINK_MAX; - get_random_bytes(&sbi->s_next_generation, sizeof(u32)); #ifdef CONFIG_QUOTA sb->dq_op = &f2fs_quota_operations; -- 2.19.0.605.g01d371f741-goog