linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Charles Manning <manningc2@actrix.gen.nz>
To: Arnd Bergmann <arnd@arndb.de>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/8] Add yaffs2 file system: guts code
Date: Mon, 6 Dec 2010 14:50:41 +1300	[thread overview]
Message-ID: <201012061450.41675.manningc2@actrix.gen.nz> (raw)
In-Reply-To: <201011302323.53313.arnd@arndb.de>

On Wednesday 01 December 2010 11:23:53 you wrote:
> On Tuesday 30 November 2010 22:57:29 Charles Manning wrote:
>
> I think I made these comments before, not sure what happened to them...
>
> > +
> > +/* Robustification (if it ever comes about...) */
> > +static void yaffs_retire_block(struct yaffs_dev *dev, int flash_block);
> > +static void yaffs_handle_chunk_wr_error(struct yaffs_dev *dev, int
> > nand_chunk, +					int erased_ok);
> > +static void yaffs_handle_chunk_wr_ok(struct yaffs_dev *dev, int
> > nand_chunk, +				     const u8 * data,
> > +				     const struct yaffs_ext_tags *tags);
> > +static void yaffs_handle_chunk_update(struct yaffs_dev *dev, int
> > nand_chunk, +				      const struct yaffs_ext_tags *tags);
>
> It would be better to reorder the functions in each file so that
> you don't need forward declarations. This generally makes reading
> the code easier because it is what people expect to see. It
> also makes it clearer where you have possible recursions in the code.

Hmmm.. 
I too prefer minimal use of forward declaration.
Some of them are because I copied the layout of existing kernel code which 
uses fwd declarations a lot. eg. fs/jffs2/dir.c  and many of the examples in 
Rubini & Corbet.

>
> > +
> > +	T(YAFFS_TRACE_BUFFERS,
> > +	  (TSTR("Out of temp buffers at line %d, other held by lines:"),
> > +	   line_no));
> > +	for (i = 0; i < YAFFS_N_TEMP_BUFFERS; i++)
> > +		T(YAFFS_TRACE_BUFFERS,
> > +		  (TSTR(" %d "), dev->temp_buffer[i].line));
> > +
> > +	T(YAFFS_TRACE_BUFFERS, (TSTR(" " TENDSTR)));

> The tracing functions are rather obscure. I would recommend dropping
> them all for now, in order to get the code included.

Yup that was a very ugly bunch of hackery to make WinCE unicode work.

I think I can pull the var-arg-foo to replace these with

yaffs_trace(YAFFS_TRACE_BUFFERS,
	"Out of temp buffers at line %d, other held by lines:",line_no);
for (i = 0; i < YAFFS_N_TEMP_BUFFERS; i++)
	yaffs_trace(YAFFS_TRACE_BUFFERS," %d ", dev->temp_buffer[i].line);
yaffs_trace(YAFFS_TRACE_BUFFERS, "\n");

Would that be OK?

I am loath to have to pull out useful code then plug it back in again.

> At a later 
> stage, you can add standard trace points.
>
> > +	return YMALLOC(dev->data_bytes_per_chunk);

I'm getting rid of those..

The reason for thew wrapping was to make portable code.

I'm replacing these with kmalloc() and then providing kmalloc() which is just 
a wrapped malloc() for non-Linux use.

I am hoping to reduce this to YCHAR, _Y() and maybe one or two others.

 -- Charles

  reply	other threads:[~2010-12-06  1:50 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-30 21:57 [PATCH 0/8] Add yaffs2 file system: Third patchset Charles Manning
2010-11-30 21:57 ` [PATCH 1/8] Add yaffs2 file system: allocator, attribs, bitmap code Charles Manning
2010-12-02 18:14   ` Marcin Slusarz
2010-12-02 19:20     ` Charles Manning
2010-12-02 19:49   ` Ryan Mallon
2010-12-02 20:48     ` kevin granade
2010-11-30 21:57 ` [PATCH 2/8] Add yaffs2 file system: checkpoint and ecc code Charles Manning
2010-12-05 21:55   ` Jesper Juhl
2010-11-30 21:57 ` [PATCH 3/8] Add yaffs2 file system: guts code Charles Manning
2010-11-30 22:23   ` Arnd Bergmann
2010-12-06  1:50     ` Charles Manning [this message]
2010-12-06 12:55       ` Arnd Bergmann
2010-12-06 22:13         ` Charles Manning
2010-12-06 22:16           ` Jesper Juhl
2010-12-06 23:03           ` Arnd Bergmann
2010-12-07  0:47             ` Steven Rostedt
2010-12-07  4:12               ` Charles Manning
2010-12-07 14:49                 ` Steven Rostedt
2010-12-07 20:43                   ` Charles Manning
2010-12-07 22:49                     ` Steven Rostedt
2010-11-30 21:57 ` [PATCH 4/8] Add yaffs2 file system: tags handling code Charles Manning
2010-12-05 22:12   ` Jesper Juhl
2010-11-30 21:57 ` [PATCH 5/8] Add yaffs2 file system: mtd and flash " Charles Manning
2010-12-05 22:42   ` Jesper Juhl
2010-11-30 21:57 ` [PATCH 6/8] Add yaffs2 file system: xattrib code Charles Manning
2010-12-05 22:20   ` Jesper Juhl
2010-11-30 21:57 ` [PATCH 7/8] Add yaffs2 file system: verification code and other headers Charles Manning
2010-12-02 20:00   ` Ryan Mallon
2010-12-05 21:20     ` Charles Manning
2010-12-05 21:45       ` Ryan Mallon
2010-12-05 22:50         ` Charles Manning
2010-12-07 15:06   ` Pekka Enberg
2010-11-30 21:57 ` [PATCH 8/8] Add yaffs2 file system: VFS glue code, hook into kernel tree building Charles Manning
2010-12-01  5:30   ` Nick Piggin
2010-12-02 20:35   ` Ryan Mallon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201012061450.41675.manningc2@actrix.gen.nz \
    --to=manningc2@actrix.gen.nz \
    --cc=arnd@arndb.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).