From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754157AbaCKAj6 (ORCPT ); Mon, 10 Mar 2014 20:39:58 -0400 Received: from g2t1383g.austin.hp.com ([15.217.136.92]:16080 "EHLO g2t1383g.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754083AbaCKAj4 (ORCPT ); Mon, 10 Mar 2014 20:39:56 -0400 Message-ID: <1394497958.6784.204.camel@misato.fc.hp.com> Subject: Re: [PATCH v6 06/22] Replace XIP read and write with DAX I/O From: Toshi Kani To: Matthew Wilcox Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, willy@linux.intel.com Date: Mon, 10 Mar 2014 18:32:38 -0600 In-Reply-To: <1393337918-28265-7-git-send-email-matthew.r.wilcox@intel.com> References: <1393337918-28265-1-git-send-email-matthew.r.wilcox@intel.com> <1393337918-28265-7-git-send-email-matthew.r.wilcox@intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.8.5 (3.8.5-2.fc19) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2014-02-25 at 09:18 -0500, Matthew Wilcox wrote: > Use the generic AIO infrastructure instead of custom read and write > methods. In addition to giving us support for AIO, this adds the missing > locking between read() and truncate(). > : > +static void dax_new_buf(void *addr, unsigned size, unsigned first, > + loff_t offset, loff_t end, int rw) > +{ > + loff_t final = end - offset; /* The final byte in this buffer */ I may be missing something, but shouldn't it take first into account? loff_t final = end - offset + first; Thanks, -Toshi > + if (rw != WRITE) { > + memset(addr, 0, size); > + return; > + } > + > + if (first > 0) > + memset(addr, 0, first); > + if (final < size) > + memset(addr + final, 0, size - final); > +} From mboxrd@z Thu Jan 1 00:00:00 1970 From: Toshi Kani Subject: Re: [PATCH v6 06/22] Replace XIP read and write with DAX I/O Date: Mon, 10 Mar 2014 18:32:38 -0600 Message-ID: <1394497958.6784.204.camel@misato.fc.hp.com> References: <1393337918-28265-1-git-send-email-matthew.r.wilcox@intel.com> <1393337918-28265-7-git-send-email-matthew.r.wilcox@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, willy@linux.intel.com To: Matthew Wilcox Return-path: In-Reply-To: <1393337918-28265-7-git-send-email-matthew.r.wilcox@intel.com> Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Tue, 2014-02-25 at 09:18 -0500, Matthew Wilcox wrote: > Use the generic AIO infrastructure instead of custom read and write > methods. In addition to giving us support for AIO, this adds the missing > locking between read() and truncate(). > : > +static void dax_new_buf(void *addr, unsigned size, unsigned first, > + loff_t offset, loff_t end, int rw) > +{ > + loff_t final = end - offset; /* The final byte in this buffer */ I may be missing something, but shouldn't it take first into account? loff_t final = end - offset + first; Thanks, -Toshi > + if (rw != WRITE) { > + memset(addr, 0, size); > + return; > + } > + > + if (first > 0) > + memset(addr, 0, first); > + if (final < size) > + memset(addr + final, 0, size - final); > +} -- 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