From mboxrd@z Thu Jan 1 00:00:00 1970 From: Randy Dunlap Subject: Re: dummy file read periodically for external USB Hard Disk Date: Fri, 18 Jul 2014 11:13:25 -0700 Message-ID: <53C963C5.5090209@infradead.org> References: <20140708130127.0f29a46f@notabene.brown> <20140710104704.4c3fdb51@notabene.brown> <53C0A51C.5020906@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: NeilBrown , Linux-FSDevel To: loody Return-path: Received: from bombadil.infradead.org ([198.137.202.9]:45190 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030567AbaGRSN1 (ORCPT ); Fri, 18 Jul 2014 14:13:27 -0400 In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 07/18/2014 10:31 AM, loody wrote: > hi Randy and All: > >> >> It means that the still is not aligned to a 512-byte boundary. >> Try >> char buffer[1024] __attribute__ ((aligned(1024))); >> >> Well, that is aligned to 1024 bytes, not 512, but whatever. > the suggestion you gave to me works ^^ > is there any alignment check in kernel FS such that it will directly > output to device instead of getting data from page cache? Not sure that I understand your question, but I think that using O_DIRECT in the open() call attempts to do what you are asking. Please read 'man open' and search for O_DIRECT. -- ~Randy