Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759885Ab3IDSN3 (ORCPT ); Wed, 4 Sep 2013 14:13:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26093 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758792Ab3IDSN1 (ORCPT ); Wed, 4 Sep 2013 14:13:27 -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 From: David Howells In-Reply-To: References: <306cbe63f85921ad40b00e3c7071be19cb6adf04.1375999914.git.milosz@adfin.com> <18832.1378311843@warthog.procyon.org.uk> <18284.1378315570@warthog.procyon.org.uk> To: Milosz Tanski Cc: dhowells@redhat.com, Hongyi Jia , ceph-devel , Sage Weil , "Yan, Zheng" , "linux-cachefs@redhat.com" , "linux-fsdevel@vger.kernel.org" , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/5] new fscache interface to check cache consistency Date: Wed, 04 Sep 2013 19:13:20 +0100 Message-ID: <16226.1378318400@warthog.procyon.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 773 Lines: 17 Milosz Tanski wrote: > Is it as simple as stick a mutex at the top of the > __fscache_check_consistency function before we try to find the object? You can lock a mutex in a function, but where are you actually going to place the mutex struct? And what other code is going to take it? To do this, you'd have to place the mutex struct in fscache_cookie. The problem is that you have to protect the pointer from fscache_cookie to fscache_object - so placing the mutex in fscache_object doesn't help. David -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/