From patchwork Fri May 3 00:33:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 2514671 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 8E40D3FD85 for ; Fri, 3 May 2013 00:35:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762429Ab3ECAdi (ORCPT ); Thu, 2 May 2013 20:33:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9150 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762403Ab3ECAdh (ORCPT ); Thu, 2 May 2013 20:33:37 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r430XbKM008820 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 2 May 2013 20:33:37 -0400 Received: from warthog.procyon.org.uk (ovpn-113-68.phx2.redhat.com [10.3.113.68]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r430XZK2028711; Thu, 2 May 2013 20:33:35 -0400 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 4/8] FS-Cache: Uninline fscache_object_init() To: linux-cachefs@redhat.com From: David Howells Cc: linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, hjayasur@redhat.com, jlayton@redhat.com, linux-kernel@vger.kernel.org Date: Fri, 03 May 2013 01:33:35 +0100 Message-ID: <20130503003335.14952.45228.stgit@warthog.procyon.org.uk> In-Reply-To: <20130503003316.14952.51791.stgit@warthog.procyon.org.uk> References: <20130503003316.14952.51791.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.16 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Uninline fscache_object_init() so as not to expose some of the FS-Cache internals to the cache backend. Signed-off-by: David Howells --- fs/fscache/object.c | 40 ++++++++++++++++++++++++++++++++++++++-- include/linux/fscache-cache.h | 38 ++------------------------------------ 2 files changed, 40 insertions(+), 38 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" 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/fs/fscache/object.c b/fs/fscache/object.c index 50d41c1..0133699 100644 --- a/fs/fscache/object.c +++ b/fs/fscache/object.c @@ -363,7 +363,7 @@ unsupported_event: /* * execute an object */ -void fscache_object_work_func(struct work_struct *work) +static void fscache_object_work_func(struct work_struct *work) { struct fscache_object *object = container_of(work, struct fscache_object, work); @@ -379,7 +379,43 @@ void fscache_object_work_func(struct work_struct *work) clear_bit(FSCACHE_OBJECT_EV_REQUEUE, &object->events); fscache_put_object(object); } -EXPORT_SYMBOL(fscache_object_work_func); + +/** + * fscache_object_init - Initialise a cache object description + * @object: Object description + * @cookie: Cookie object will be attached to + * @cache: Cache in which backing object will be found + * + * Initialise a cache object description to its basic values. + * + * See Documentation/filesystems/caching/backend-api.txt for a complete + * description. + */ +void fscache_object_init(struct fscache_object *object, + struct fscache_cookie *cookie, + struct fscache_cache *cache) +{ + atomic_inc(&cache->object_count); + + object->state = FSCACHE_OBJECT_INIT; + spin_lock_init(&object->lock); + INIT_LIST_HEAD(&object->cache_link); + INIT_HLIST_NODE(&object->cookie_link); + INIT_WORK(&object->work, fscache_object_work_func); + INIT_LIST_HEAD(&object->dependents); + INIT_LIST_HEAD(&object->dep_link); + INIT_LIST_HEAD(&object->pending_ops); + object->n_children = 0; + object->n_ops = object->n_in_progress = object->n_exclusive = 0; + object->events = object->event_mask = 0; + object->flags = 0; + object->store_limit = 0; + object->store_limit_l = 0; + object->cache = cache; + object->cookie = cookie; + object->parent = NULL; +} +EXPORT_SYMBOL(fscache_object_init); /* * initialise an object diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h index 5dfa0aa..9b9c1de 100644 --- a/include/linux/fscache-cache.h +++ b/include/linux/fscache-cache.h @@ -426,42 +426,8 @@ extern const char *fscache_object_states[]; (test_bit(FSCACHE_IOERROR, &(obj)->cache->flags) && \ (obj)->state >= FSCACHE_OBJECT_DYING) -extern void fscache_object_work_func(struct work_struct *work); - -/** - * fscache_object_init - Initialise a cache object description - * @object: Object description - * - * Initialise a cache object description to its basic values. - * - * See Documentation/filesystems/caching/backend-api.txt for a complete - * description. - */ -static inline -void fscache_object_init(struct fscache_object *object, - struct fscache_cookie *cookie, - struct fscache_cache *cache) -{ - atomic_inc(&cache->object_count); - - object->state = FSCACHE_OBJECT_INIT; - spin_lock_init(&object->lock); - INIT_LIST_HEAD(&object->cache_link); - INIT_HLIST_NODE(&object->cookie_link); - INIT_WORK(&object->work, fscache_object_work_func); - INIT_LIST_HEAD(&object->dependents); - INIT_LIST_HEAD(&object->dep_link); - INIT_LIST_HEAD(&object->pending_ops); - object->n_children = 0; - object->n_ops = object->n_in_progress = object->n_exclusive = 0; - object->events = object->event_mask = 0; - object->flags = 0; - object->store_limit = 0; - object->store_limit_l = 0; - object->cache = cache; - object->cookie = cookie; - object->parent = NULL; -} +extern void fscache_object_init(struct fscache_object *, struct fscache_cookie *, + struct fscache_cache *); extern void fscache_object_lookup_negative(struct fscache_object *object); extern void fscache_obtained_object(struct fscache_object *object);