From: Charles Manning Subject: Dividing a loff_t Date: Wed, 13 Sep 2006 21:53:25 +1200 Message-ID: <200609132153.25199.manningc2@actrix.gen.nz> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from clix-jaquesmartin-nz.cpe.clix.net.nz ([203.97.0.186]:33798 "HELO firstline.co.nz") by vger.kernel.org with SMTP id S1751051AbWIMJse (ORCPT ); Wed, 13 Sep 2006 05:48:34 -0400 To: linux-fsdevel@vger.kernel.org Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Hi I have a scenario where I need to use non-power-of-2 storage page sizes within a file system. If I just try something like my_page_offset = loff_t_offset / my_page_size; I get link errors because of a missing _divsi3. If nobody else is using _divsi3 then it is probably poor form to consider using it. Questions: 1) Is there a safe/better way to divide loff_t by a value. 2) Is there a better way to do this sort of thing? Any examples where this kind of thing happen? BTW: Yes, I know there are going to be performance issues etc due to alignment issues between the Linux page cache and "my pages". I have a plan to deal with that. TIA -- Charles