From patchwork Sat Mar 10 18:18:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andiry Xu X-Patchwork-Id: 10273949 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 A38CA602BD for ; Sat, 10 Mar 2018 18:21:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92CA528BAE for ; Sat, 10 Mar 2018 18:21:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8783829735; Sat, 10 Mar 2018 18:21:39 +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=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4288E28BAE for ; Sat, 10 Mar 2018 18:21:39 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 03492226462F1; Sat, 10 Mar 2018 10:15:12 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c00::244; helo=mail-pf0-x244.google.com; envelope-from=jix024@eng.ucsd.edu; receiver=linux-nvdimm@lists.01.org Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2ADE8226462E7 for ; Sat, 10 Mar 2018 10:15:10 -0800 (PST) Received: by mail-pf0-x244.google.com with SMTP id a16so2614831pfn.9 for ; Sat, 10 Mar 2018 10:21:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eng.ucsd.edu; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ReJJplC+bIxy5c9w38iY6n98x8B4VciDmvSBT0sac5o=; b=gEiiBtCtdzf0/K0mF6zv68N7U1YwKKEGV/DAMya9MspVLyczpqwwUkN7ZhoFEPwah8 4ctcSXh5Lh18HF3MXikm8aiYbgU4yk4pcb574L0jbZsMKmg5oWqszadLLsIorrkBw5VD Uq+f342SGhlsEAUEUcv7VB34UQ77SYWorfm9w= 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=ReJJplC+bIxy5c9w38iY6n98x8B4VciDmvSBT0sac5o=; b=Y1thuLBtObo7G3bxfRlIqhYvtkPar/J7pZ/pwUDriSSp9ju27YBTcYMB/GmnRQw4By IqQG+g4A/YTlAo6lurh4wvUY9mNHRh/1cKYxM0q7IMNft9+DCkpCsW06KQRqz80SZcm7 PdisKWOYUm7uZ4pZDLt+HG/cpoQ7eSmkyoE2SMG6P+JTjPs0h6dXpyH1urb24NV2kBrR pwa64GbkHZbJIuFxFcIoclHDF/Av5b7cevoC6bMwnjsZjZ1WKg6Sn9T1L7UVXIbmT8Bl Cl2BESfASWrxRGZrIsK2C7wmBY8qhM6kguFz1K9aXDAoqRGlxeW1tF5/BxMYqr5xCSGp LL1Q== X-Gm-Message-State: AElRT7E6JXZbKVDJaJ5aNdfxbsEVMssx8VPq5IHuzdYk+Bx5v0Udi9ha Ng/QxFzRCpgFfiAcOETc6nMb1w== X-Google-Smtp-Source: AG47ELuo7KnQkmL/S0ddhWBtO+O3JLYbIMXl9OqQEt1Btzva4qU155JgVhOHBq7aqPfNWtrwQrw6xg== X-Received: by 10.101.80.193 with SMTP id s1mr2219464pgp.254.1520706088648; Sat, 10 Mar 2018 10:21:28 -0800 (PST) Received: from brienza-desktop.8.8.4.4 (andxu.ucsd.edu. [132.239.17.134]) by smtp.gmail.com with ESMTPSA id h80sm9210167pfj.181.2018.03.10.10.21.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 10 Mar 2018 10:21:27 -0800 (PST) From: Andiry Xu To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org Subject: [RFC v2 60/83] Add special inode operations. Date: Sat, 10 Mar 2018 10:18:41 -0800 Message-Id: <1520705944-6723-61-git-send-email-jix024@eng.ucsd.edu> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520705944-6723-1-git-send-email-jix024@eng.ucsd.edu> References: <1520705944-6723-1-git-send-email-jix024@eng.ucsd.edu> X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: coughlan@redhat.com, miklos@szeredi.hu, Andiry Xu , david@fromorbit.com, jack@suse.com, swanson@cs.ucsd.edu, swhiteho@redhat.com, andiry.xu@gmail.com MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP From: Andiry Xu Signed-off-by: Andiry Xu --- fs/nova/inode.c | 2 ++ fs/nova/namei.c | 5 +++++ fs/nova/nova.h | 1 + 3 files changed, 8 insertions(+) diff --git a/fs/nova/inode.c b/fs/nova/inode.c index 2092a55..0e9ab4b 100644 --- a/fs/nova/inode.c +++ b/fs/nova/inode.c @@ -239,6 +239,7 @@ static int nova_read_inode(struct super_block *sb, struct inode *inode, case S_IFLNK: break; default: + inode->i_op = &nova_special_inode_operations; init_special_inode(inode, inode->i_mode, le32_to_cpu(pi->dev.rdev)); break; @@ -929,6 +930,7 @@ struct inode *nova_new_vfs_inode(enum nova_new_inode_type type, break; case TYPE_MKNOD: init_special_inode(inode, mode, rdev); + inode->i_op = &nova_special_inode_operations; break; case TYPE_SYMLINK: inode->i_mapping->a_ops = &nova_aops_dax; diff --git a/fs/nova/namei.c b/fs/nova/namei.c index 1966bff..7a81672 100644 --- a/fs/nova/namei.c +++ b/fs/nova/namei.c @@ -771,3 +771,8 @@ const struct inode_operations nova_dir_inode_operations = { .setattr = nova_notify_change, .get_acl = NULL, }; + +const struct inode_operations nova_special_inode_operations = { + .setattr = nova_notify_change, + .get_acl = NULL, +}; diff --git a/fs/nova/nova.h b/fs/nova/nova.h index 03ea0bd..85292d3 100644 --- a/fs/nova/nova.h +++ b/fs/nova/nova.h @@ -486,6 +486,7 @@ int nova_remove_dentry(struct dentry *dentry, int dec_link, /* namei.c */ extern const struct inode_operations nova_dir_inode_operations; +extern const struct inode_operations nova_special_inode_operations; extern struct dentry *nova_get_parent(struct dentry *child); /* rebuild.c */