From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Subject: [patch 8/8] reiser4: fix for new aops patches Date: Thu, 14 Jun 2007 04:42:32 +0200 Message-ID: <20070614024232.GH30943@wotan.suse.de> References: <20070614023444.GA30943@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, mark.fasheh@oracle.com To: Andrew Morton Return-path: Received: from cantor.suse.de ([195.135.220.2]:34871 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751917AbXFNCmd (ORCPT ); Wed, 13 Jun 2007 22:42:33 -0400 Content-Disposition: inline In-Reply-To: <20070614023444.GA30943@wotan.suse.de> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Index: linux-2.6/fs/reiser4/plugin/item/extent_file_ops.c =================================================================== --- linux-2.6.orig/fs/reiser4/plugin/item/extent_file_ops.c +++ linux-2.6/fs/reiser4/plugin/item/extent_file_ops.c @@ -7,7 +7,6 @@ #include #include -#include "../../../../mm/filemap.h" static inline reiser4_extent *ext_by_offset(const znode *node, int offset) { @@ -937,6 +936,31 @@ static int write_extent_reserve_space(st return reiser4_grab_space(count, 0 /* flags */); } +/* + * filemap_copy_from_user no longer exists in generic code, because it + * is deadlocky (copying from user while holding the page lock is bad). + * As a temporary fix for reiser4, just define it here. + */ +static inline size_t +filemap_copy_from_user(struct page *page, unsigned long offset, + const char __user *buf, unsigned bytes) +{ + char *kaddr; + int left; + + kaddr = kmap_atomic(page, KM_USER0); + left = __copy_from_user_inatomic_nocache(kaddr + offset, buf, bytes); + kunmap_atomic(kaddr, KM_USER0); + + if (left != 0) { + /* Do it the slow way */ + kaddr = kmap(page); + left = __copy_from_user_nocache(kaddr + offset, buf, bytes); + kunmap(page); + } + return bytes - left; +} + /** * reiser4_write_extent - write method of extent item plugin * @file: file to write to