Received: by 10.223.185.111 with SMTP id b44csp1652434wrg; Sat, 10 Mar 2018 10:39:26 -0800 (PST) X-Google-Smtp-Source: AG47ELus37UWWqfcgvfc0X1b7izph09e+eroWTStwWR436ni+KUCdZoQDiykySJvsRziJESonpAu X-Received: by 2002:a17:902:d909:: with SMTP id c9-v6mr2782941plz.34.1520707166343; Sat, 10 Mar 2018 10:39:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520707166; cv=none; d=google.com; s=arc-20160816; b=ppzf2UYLpsOKtB8M5xo0dET/tiZtG7SqKESpqms5MaXfTqjPcQiCb/vSdkJnOMFGt1 orYIZFzxZXe3bMtU8N68p8a6GXOgh1ON3Rd1bU/yI+N3IP3akBW0bDxub5q+tQl/hn6g V0bMbbhGFJG/3qJMZE6Ig5XUyMjGyC6F0TwZpxtiVlOgBvskVzXaHLx0EIxlnb0+1hb/ jAx+1xqEIvwjp4j3bBdDGaz6Pi8Fuz97JOmunljjOnh5cikfmOIBKY9zVufRNW6ssllg eaGRQ3umn4kXBx2MSIUsFVmxJKR/vj6aoqPYpEKXHidikqCmkBOfDB+SDlhsxH5xK/M9 aONQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=onvPGvPFTagofoGFZaXXqPotBNWCKBniFnEDO59jYDE=; b=fPmweVqxbHUySJurp0E0fuDMo5etZD7iAK4B2ayQmYrxsZEkZInPysDRZyODfOeZIe V/QJvf9K+km9nWBYZnKq8MINHYJAmFp45J7PkV9E8CG1bUyeK6vUfhv50+mCtcIYeLL8 8dCi9VL3MN0bI8d8w2ov/i/Wt1sdKY1WMMHJVKPglrJolnO1ahPMhhzEmnp9A6t38uf3 wT9KRkJ+p52I8sX8BS5e8YkGjsy1NV7QhrHtbOsGS57YAnL0Jx0wuAJxKjoVqItsGJ/y RXW+Bl84QKFXPgkaez4KBzzBxybyE00N5VJ55nHxm6K+tQgO9sIT+TzxXt6SOSyWZRGz s/bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@eng.ucsd.edu header.s=google header.b=hrZiwP2k; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3-v6si3099568plb.137.2018.03.10.10.39.00; Sat, 10 Mar 2018 10:39:26 -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=@eng.ucsd.edu header.s=google header.b=hrZiwP2k; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752130AbeCJSiK (ORCPT + 99 others); Sat, 10 Mar 2018 13:38:10 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:45285 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932275AbeCJSUu (ORCPT ); Sat, 10 Mar 2018 13:20:50 -0500 Received: by mail-pf0-f195.google.com with SMTP id h19so2612418pfd.12 for ; Sat, 10 Mar 2018 10:20:50 -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=onvPGvPFTagofoGFZaXXqPotBNWCKBniFnEDO59jYDE=; b=hrZiwP2kpTYHhYGWAImBgZXAGSuNfDbzE4xt1h7hMp3WrBbOO+ly+khXgIHTCGECbV F12nxHdD535JdSbXYVmJoD40uDz0tUtAe8TfgR0N2FUtxjaQBWIp2EO8NL6SlVRdw3Mx wWqPv/yVkqxSIHB5cfobiqRspHqV4icKbbpuQ= 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=onvPGvPFTagofoGFZaXXqPotBNWCKBniFnEDO59jYDE=; b=Ck69aeOBV+ZnpGEjqj5EhiE/ZojAaFjdpJe+m+OSXGBVpah1s2acHUGNv5CIprTPEV YxXsuP1jO1f1KEYCrzburo9QWwUB8WS6e3aT34L5N6ADc7UE1C7EvnEO1YRyakSK/sW+ RYTFe6WpUf9pIlaF1RXQNfq+yGGhDYlNA4ThVqEHHqm5ZI/6rhNjSSVJlWo6bDaDrd1K STfiGLRQ2Qk4LG3hkPju79m/v8Dbtfevd/ydAagjaGyx0PL67vj5P2HHy0g4mwd2Djoo voeg4C95/EjLLsH7MiD+TkJ2EmzOpdjVkP/nTcqpgt56ol4xNnWrQ33IC7d1Bebfew+S NUQA== X-Gm-Message-State: AElRT7FxDaTeNjQvqLo/OLh/RmDtppKmo5w8Er6b2DXVRDig8My6F6j/ y/cxYYbvjHyDQGRqjqyP1EKJGQ0zeEs= X-Received: by 10.98.156.16 with SMTP id f16mr2673798pfe.180.1520706050263; Sat, 10 Mar 2018 10:20:50 -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.20.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 10 Mar 2018 10:20:49 -0800 (PST) From: Andiry Xu To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org Cc: dan.j.williams@intel.com, andy.rudoff@intel.com, coughlan@redhat.com, swanson@cs.ucsd.edu, david@fromorbit.com, jack@suse.com, swhiteho@redhat.com, miklos@szeredi.hu, andiry.xu@gmail.com, Andiry Xu Subject: [RFC v2 28/83] Add NOVA address space operations Date: Sat, 10 Mar 2018 10:18:09 -0800 Message-Id: <1520705944-6723-29-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andiry Xu direct_IO and writepages support. Signed-off-by: Andiry Xu --- fs/nova/inode.c | 24 ++++++++++++++++++++++++ fs/nova/inode.h | 1 + 2 files changed, 25 insertions(+) diff --git a/fs/nova/inode.c b/fs/nova/inode.c index 7c10d0e..a30b6aa 100644 --- a/fs/nova/inode.c +++ b/fs/nova/inode.c @@ -175,6 +175,7 @@ static int nova_read_inode(struct super_block *sb, struct inode *inode, } inode->i_blocks = sih->i_blocks; + inode->i_mapping->a_ops = &nova_aops_dax; switch (inode->i_mode & S_IFMT) { case S_IFREG: @@ -488,3 +489,26 @@ int nova_free_inuse_inode(struct super_block *sb, unsigned long ino) return ret; } +static ssize_t nova_direct_IO(struct kiocb *iocb, struct iov_iter *iter) +{ + /* DAX does not support direct IO */ + return -EIO; +} + +static int nova_writepages(struct address_space *mapping, + struct writeback_control *wbc) +{ + int ret; + timing_t wp_time; + + NOVA_START_TIMING(write_pages_t, wp_time); + ret = dax_writeback_mapping_range(mapping, + mapping->host->i_sb->s_bdev, wbc); + NOVA_END_TIMING(write_pages_t, wp_time); + return ret; +} + +const struct address_space_operations nova_aops_dax = { + .writepages = nova_writepages, + .direct_IO = nova_direct_IO, +}; diff --git a/fs/nova/inode.h b/fs/nova/inode.h index 497343d..e00b3b9 100644 --- a/fs/nova/inode.h +++ b/fs/nova/inode.h @@ -221,6 +221,7 @@ static inline int nova_persist_inode(struct nova_inode *pi) } +extern const struct address_space_operations nova_aops_dax; int nova_init_inode_inuse_list(struct super_block *sb); int nova_init_inode_table(struct super_block *sb); int nova_get_inode_address(struct super_block *sb, u64 ino, -- 2.7.4