From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from newverein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CF33622492727 for ; Fri, 2 Mar 2018 14:47:07 -0800 (PST) Date: Fri, 2 Mar 2018 23:53:16 +0100 From: Christoph Hellwig Subject: Re: [PATCH v5 02/12] dax: introduce IS_DEVDAX() and IS_FSDAX() Message-ID: <20180302225316.GC31240@lst.de> References: <151996281307.28483.12343847096989509127.stgit@dwillia2-desk3.amr.corp.intel.com> <151996282448.28483.10415125852182473579.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <151996282448.28483.10415125852182473579.stgit@dwillia2-desk3.amr.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Dan Williams Cc: Theodore Ts'o , Matthew Wilcox , "Darrick J. Wong" , linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux-xfs@vger.kernel.org, linux-mm@kvack.org, Andreas Dilger , Alexander Viro , linux-fsdevel@vger.kernel.org, Jan Kara , hch@lst.de List-ID: > +static inline bool IS_DEVDAX(struct inode *inode) > +{ > + if (!IS_ENABLED(CONFIG_DEV_DAX)) > + return false; > + if ((inode->i_flags & S_DAX) == 0) > + return false; > + if (!S_ISCHR(inode->i_mode)) > + return false; > + return true; > +} > + > +static inline bool IS_FSDAX(struct inode *inode) > +{ > + if (!IS_ENABLED(CONFIG_FS_DAX)) > + return false; > + if ((inode->i_flags & S_DAX) == 0) > + return false; > + if (S_ISCHR(inode->i_mode)) > + return false; > + return true; Encoding the is char device or not thing here is just nasty. I think this is going entirely in the wrong direction. _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from verein.lst.de ([213.95.11.211]:38343 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933561AbeCBWxS (ORCPT ); Fri, 2 Mar 2018 17:53:18 -0500 Date: Fri, 2 Mar 2018 23:53:16 +0100 From: Christoph Hellwig Subject: Re: [PATCH v5 02/12] dax: introduce IS_DEVDAX() and IS_FSDAX() Message-ID: <20180302225316.GC31240@lst.de> References: <151996281307.28483.12343847096989509127.stgit@dwillia2-desk3.amr.corp.intel.com> <151996282448.28483.10415125852182473579.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <151996282448.28483.10415125852182473579.stgit@dwillia2-desk3.amr.corp.intel.com> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Dan Williams Cc: linux-nvdimm@lists.01.org, Theodore Ts'o , Andreas Dilger , Alexander Viro , "Darrick J. Wong" , linux-xfs@vger.kernel.org, Matthew Wilcox , Ross Zwisler , stable@vger.kernel.org, Jan Kara , hch@lst.de, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org > +static inline bool IS_DEVDAX(struct inode *inode) > +{ > + if (!IS_ENABLED(CONFIG_DEV_DAX)) > + return false; > + if ((inode->i_flags & S_DAX) == 0) > + return false; > + if (!S_ISCHR(inode->i_mode)) > + return false; > + return true; > +} > + > +static inline bool IS_FSDAX(struct inode *inode) > +{ > + if (!IS_ENABLED(CONFIG_FS_DAX)) > + return false; > + if ((inode->i_flags & S_DAX) == 0) > + return false; > + if (S_ISCHR(inode->i_mode)) > + return false; > + return true; Encoding the is char device or not thing here is just nasty. I think this is going entirely in the wrong direction. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 2 Mar 2018 23:53:16 +0100 From: Christoph Hellwig To: Dan Williams Cc: linux-nvdimm@lists.01.org, Theodore Ts'o , Andreas Dilger , Alexander Viro , "Darrick J. Wong" , linux-xfs@vger.kernel.org, Matthew Wilcox , Ross Zwisler , stable@vger.kernel.org, Jan Kara , hch@lst.de, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 02/12] dax: introduce IS_DEVDAX() and IS_FSDAX() Message-ID: <20180302225316.GC31240@lst.de> References: <151996281307.28483.12343847096989509127.stgit@dwillia2-desk3.amr.corp.intel.com> <151996282448.28483.10415125852182473579.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <151996282448.28483.10415125852182473579.stgit@dwillia2-desk3.amr.corp.intel.com> Sender: owner-linux-mm@kvack.org List-ID: > +static inline bool IS_DEVDAX(struct inode *inode) > +{ > + if (!IS_ENABLED(CONFIG_DEV_DAX)) > + return false; > + if ((inode->i_flags & S_DAX) == 0) > + return false; > + if (!S_ISCHR(inode->i_mode)) > + return false; > + return true; > +} > + > +static inline bool IS_FSDAX(struct inode *inode) > +{ > + if (!IS_ENABLED(CONFIG_FS_DAX)) > + return false; > + if ((inode->i_flags & S_DAX) == 0) > + return false; > + if (S_ISCHR(inode->i_mode)) > + return false; > + return true; Encoding the is char device or not thing here is just nasty. I think this is going entirely in the wrong direction. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org