From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11946 invoked by alias); 27 Nov 2003 17:02:41 -0000 Mailing-List: contact ecos-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@sources.redhat.com Received: (qmail 11938 invoked from network); 27 Nov 2003 17:02:40 -0000 Received: from unknown (HELO melelios.dmz.elios-informatique.fr) (194.250.150.132) by sources.redhat.com with SMTP; 27 Nov 2003 17:02:40 -0000 Received: from figuier ([192.168.7.116]) by melelios.dmz.elios-informatique.fr with Microsoft SMTPSVC(5.0.2195.5329); Thu, 27 Nov 2003 18:09:58 +0100 From: "Vincent Catros" To: "'David Woodhouse'" Cc: Date: Thu, 27 Nov 2003 17:02:00 -0000 Message-ID: <000e01c3b508$b6f34d30$7407a8c0@figuier> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Importance: Normal In-Reply-To: <1069892845.14994.47.camel@imladris.demon.co.uk> X-OriginalArrivalTime: 27 Nov 2003 17:09:58.0875 (UTC) FILETIME=[497CBAB0:01C3B509] Subject: [ECOS] RE : [ECOS] Is JFFS2 thread-safe? X-SW-Source: 2003-11/txt/msg00421.txt.bz2 Davis, > -----Message d'origine----- > De=A0: David Woodhouse [mailto:dwmw2@infradead.org] > Envoy=E9=A0: jeudi 27 novembre 2003 01:27 > =C0=A0: Vincent Catros > Cc=A0: ecos-discuss@sources.redhat.com > Objet=A0: Re: [ECOS] Is JFFS2 thread-safe? >=20 [...] > In fact, I suspect that is actually OK because we set the > CYG_SYNCMODE_FILE_FILESYSTEM flag and hence the fileio layer ensures > that only one file system method is invoked at a time. It would be > better to do our own locking and drop that flag though, since it makes > coordinating the locking with gcthread.c a little nicer. >=20 > Your underlying flash drivers may also need to be thread-safe, if you're > allowing concurrent calls into JFFS2 -- which I think we are; open and > close are serialised but read() and write() on two separate files can > happen simultaneously AFAICT. [...] Effectively, before any call to a file system function, the macro LOCK_FS is called. This macro is an alias to cyg_fs_lock. Accordig to the flag passed to that function (ie : CYG_SYNCMODE_FILE_FILESYSTEM) file system functions are serialized that way. But it seems that read() and write() lead to a cyg_file_lock which call cyg_fs_lock (see fd.cxx). So, read() and write() are probably serialized to. Am I wrong? Regards. Vincent -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss