From patchwork Tue Jan 20 20:08:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonthan Brassow X-Patchwork-Id: 3332 X-Patchwork-Delegate: agk@redhat.com Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n0KK4PT8018156 for ; Tue, 20 Jan 2009 12:04:25 -0800 Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 1677661846F; Tue, 20 Jan 2009 15:08:59 -0500 (EST) Received: from int-mx2.corp.redhat.com (nat-pool.util.phx.redhat.com [10.8.5.200]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n0KK8vxR029917 for ; Tue, 20 Jan 2009 15:08:57 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n0KK8vLh029100 for ; Tue, 20 Jan 2009 15:08:58 -0500 Received: from [10.15.80.1] (hydrogen.msp.redhat.com [10.15.80.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n0KK8vUI005811 for ; Tue, 20 Jan 2009 15:08:57 -0500 From: Jonathan Brassow To: dm-devel@redhat.com Date: Tue, 20 Jan 2009 14:08:56 -0600 Message-Id: <1232482136.19993.43.camel@hydrogen.msp.redhat.com> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH 10 of 12]: dm-snapshot-move-status-to-exception-store.patch X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com brassow Let the exception store types print out their status through the new API, rather than having the snapshot code do it. Signed-off-by: Jonathan Brassow --- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel Index: linux-2.6/drivers/md/dm-snap-persistent.c =================================================================== --- linux-2.6.orig/drivers/md/dm-snap-persistent.c +++ linux-2.6/drivers/md/dm-snap-persistent.c @@ -694,6 +694,14 @@ static int persistent_status(struct dm_e { int sz = 0; + switch (status) { + case STATUSTYPE_INFO: + break; + case STATUSTYPE_TABLE: + DMEMIT("%s P %llu", store->cow->name, + (unsigned long long)store->chunk_size); + } + return sz; } Index: linux-2.6/drivers/md/dm-snap-transient.c =================================================================== --- linux-2.6.orig/drivers/md/dm-snap-transient.c +++ linux-2.6/drivers/md/dm-snap-transient.c @@ -87,6 +87,14 @@ static int transient_status(struct dm_ex { int sz = 0; + switch (status) { + case STATUSTYPE_INFO: + break; + case STATUSTYPE_TABLE: + DMEMIT("%s N %llu", store->cow->name, + (unsigned long long)store->chunk_size); + } + return sz; } Index: linux-2.6/drivers/md/dm-snap.c =================================================================== --- linux-2.6.orig/drivers/md/dm-snap.c +++ linux-2.6/drivers/md/dm-snap.c @@ -70,9 +70,6 @@ struct dm_snapshot { /* Origin writes don't trigger exceptions until this is set */ int active; - /* Used for display of table */ - char type; - mempool_t *pending_pool; atomic_t pending_exceptions_count; @@ -1158,9 +1155,7 @@ static int snapshot_status(struct dm_tar * make sense. */ DMEMIT("%s", snap->origin->name); - DMEMIT(" %s %s %llu", snap->store->cow->name, - snap->store->type->name, - (unsigned long long)snap->store->chunk_size); + snap->store->type->status(snap->store, type, result, maxlen); break; }