From patchwork Fri May 29 17:05:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Marshall X-Patchwork-Id: 6509791 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B29EB9F38D for ; Fri, 29 May 2015 17:05:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E082820823 for ; Fri, 29 May 2015 17:05:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E714A20812 for ; Fri, 29 May 2015 17:05:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755391AbbE2RFh (ORCPT ); Fri, 29 May 2015 13:05:37 -0400 Received: from mail-pd0-f178.google.com ([209.85.192.178]:35550 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751995AbbE2RFg (ORCPT ); Fri, 29 May 2015 13:05:36 -0400 Received: by pdea3 with SMTP id a3so57720901pde.2 for ; Fri, 29 May 2015 10:05:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=af+3gtWDQ2j6EWqeTYrhIWxrzn+1Ouc6hHgia4Ui8oI=; b=lgCvSdLSwy3brVyyewwtNQHZib7lfrr0sFJkxHAemCXohTbFwny0Iuk3HSKqWorrBE +4QmKHH8FhUK8Z3gP0Qz9KeicrEV7LZ6EmTqBUPVMpUZtRkg24y8Z0EHyLlCfR6Dnzjr gipFyG+sPKUrj+K1Bv5S6YWnbvt3uYU23ci+y6aAqsAIk8WoEXleuffUfOEiipfuJaVK d6FVhW0ETFNLkAkjD9Yc79Gftjd20yL22dBlKd8AC15V5ByMGqnOvCUWRcWhlNOIdDvl ZZRpJCp3ILY9Z/MDmy5V3wVa8rp0GAI6pW33V1nWkBolasU1KiBbYPAmZi8sc1U9aKeh vr0Q== X-Gm-Message-State: ALoCoQl87GaSrkhW9yVW3L1KkpGw/K2AJ4BBqpjjuZdJB0+tYCc6IKIPA1ErISSbSr5oMDrdnDnr X-Received: by 10.70.0.143 with SMTP id 15mr16769526pde.13.1432919136196; Fri, 29 May 2015 10:05:36 -0700 (PDT) Received: from localhost (70-90-190-81-WA.hfc.comcastbusiness.net. [70.90.190.81]) by mx.google.com with ESMTPSA id qz3sm6163099pab.19.2015.05.29.10.05.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 May 2015 10:05:35 -0700 (PDT) Date: Fri, 29 May 2015 10:05:33 -0700 From: Tom Marshall To: Theodore Ts'o Cc: Jaegeuk Kim , linux-fsdevel@vger.kernel.org Subject: Re: fs compression Message-ID: <20150529170533.GA1555@eden.sea.cyngn.com> References: <20150516132403.GA2998@thunk.org> <20150516171326.GA24795@eden.sea.cyngn.com> <20150520174635.GA17651@eden.sea.cyngn.com> <20150520213641.GM2871@thunk.org> <20150520224630.GA10927@eden.sea.cyngn.com> <20150521042819.GA14709@eden.sea.cyngn.com> <5566129D.9040509@cyngn.com> <20150527233800.GB18540@thunk.org> <20150528205515.GA7450@eden.sea.cyngn.com> <20150529001831.GA29447@eden.sea.cyngn.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20150529001831.GA29447@eden.sea.cyngn.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, May 28, 2015 at 05:18:31PM -0700, Tom Marshall wrote: > So I've just gotten this all working. The last notable change I made was to > inode size: I added an i_compressed_size member and then did some macro > hackage to ensure that the fs implementation (eg. fs/ext4) sees the > compressed size while everything else sees the uncompressed size. > > I'll be testing further tomorrow. I seem to have a race condition that leads to deadlock. Though I was able to boot to home screen on a device after a couple tries. Investigating. Here's my diff to include/linux/fs.h for the inode stuff based on 3.10. It requires/assumes that filesystems implementing transparent compression will define FS_IMPL in their Makefile. It's not final, just the first thing that worked. Any suggestions on how the final version should look .. or alternate ideas for how to do this? --- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/fs.h b/include/linux/fs.h index 7a3b879..9e943ae 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -554,6 +554,9 @@ struct inode { }; dev_t i_rdev; loff_t i_size; +#ifdef CONFIG_FS_TRANSPARENT_COMPRESSION + loff_t i_compressed_size; +#endif struct timespec i_atime; struct timespec i_mtime; struct timespec i_ctime; @@ -635,6 +638,12 @@ enum inode_i_mutex_lock_class I_MUTEX_QUOTA }; +#if defined(CONFIG_FS_TRANSPARENT_COMPRESSION) && defined(FS_IMPL) +#define I_SIZE_MEMBER i_compressed_size +#else +#define I_SIZE_MEMBER i_size +#endif + /* * NOTE: in a 32bit arch with a preemptable kernel and * an UP compile the i_size_read/write must be atomic @@ -653,14 +662,14 @@ static inline loff_t i_size_read(const struct inode *inode) do { seq = read_seqcount_begin(&inode->i_size_seqcount); - i_size = inode->i_size; + i_size = inode->I_SIZE_MEMBER; } while (read_seqcount_retry(&inode->i_size_seqcount, seq)); return i_size; #elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPT) loff_t i_size; preempt_disable(); - i_size = inode->i_size; + i_size = inode->I_SIZE_MEMBER; preempt_enable(); return i_size; #else