From: Christoph Hellwig Subject: [PATCH 10/14] vgem: separate errno from VM_FAULT_* values Date: Wed, 16 May 2018 07:43:44 +0200 Message-ID: <20180516054348.15950-11-hch@lst.de> References: <20180516054348.15950-1-hch@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Cc: linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mm@kvack.org, ocfs2-devel@oss.oracle.com, devel@lists.orangefs.org, linux-fsdevel@vger.kernel.org, linux-mtd@lists.infradead.org, ceph-devel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, lustre-devel@lists.lustre.org To: Souptick Joarder , Matthew Wilcox Return-path: In-Reply-To: <20180516054348.15950-1-hch@lst.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" List-Id: linux-ext4.vger.kernel.org QW5kIHN0cmVhbWxpbmUgdGhlIGNvZGUgaW4gdmdlbV9mYXVsdCB3aXRoIGVhcmx5IHJldHVybnMg c28gdGhhdCBpdCBpcwphIGxpdHRsZSBiaXQgbW9yZSByZWFkYWJsZS4KClNpZ25lZC1vZmYtYnk6 IENocmlzdG9waCBIZWxsd2lnIDxoY2hAbHN0LmRlPgotLS0KIGRyaXZlcnMvZ3B1L2RybS92Z2Vt L3ZnZW1fZHJ2LmMgfCA1MSArKysrKysrKysrKysrKystLS0tLS0tLS0tLS0tLS0tLS0KIDEgZmls ZSBjaGFuZ2VkLCAyMyBpbnNlcnRpb25zKCspLCAyOCBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQg YS9kcml2ZXJzL2dwdS9kcm0vdmdlbS92Z2VtX2Rydi5jIGIvZHJpdmVycy9ncHUvZHJtL3ZnZW0v dmdlbV9kcnYuYwppbmRleCAyNTI0ZmYxMTZmMDAuLmEyNjFlMGFhYjgzYSAxMDA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