All of lore.kernel.org
 help / color / mirror / Atom feed
* XFS accessing arch-specific structures
@ 2005-12-12 14:39 David Howells
  2005-12-12 21:56 ` Nathan Scott
  0 siblings, 1 reply; 2+ messages in thread
From: David Howells @ 2005-12-12 14:39 UTC (permalink / raw)
  To: nathans, hch; +Cc: linux-xfs, linux-kernel


Hi Nathan,

I've got a problem in which XFS is accessing arch-specific structures, and
thus requiring those structures to conform to its ideals. Specifically, it's
trying to read the counter using atomic_read(), whether or not this is
possible:

    fs/xfs/linux-2.6/sema.h:
    #define valusema(sp)			(atomic_read(&(sp)->count))

    compile log:

      CC      fs/xfs/xfs_inode.o
      CC      fs/xfs/xfs_inode_item.o
    fs/xfs/xfs_inode_item.c: In function `xfs_inode_item_pushbuf':
    fs/xfs/xfs_inode_item.c:803: error: structure has no member named `count'
    fs/xfs/xfs_inode_item.c:825: error: structure has no member named `count'

Can you fix this please? This will not compile with all archs.

I'm told that Christoph Hellwig may have an idea or a patch that might provide
a fix. If it's necessary to get the count on the semaphore (which it might
be), then you should add a function to each asm/semaphore.h to retrieve it and
use that.

David

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: XFS accessing arch-specific structures
  2005-12-12 14:39 XFS accessing arch-specific structures David Howells
@ 2005-12-12 21:56 ` Nathan Scott
  0 siblings, 0 replies; 2+ messages in thread
From: Nathan Scott @ 2005-12-12 21:56 UTC (permalink / raw)
  To: David Howells; +Cc: hch, linux-xfs, linux-kernel

Hi there David,

On Mon, Dec 12, 2005 at 02:39:12PM +0000, David Howells wrote:
> I've got a problem in which XFS is accessing arch-specific structures, and
> thus requiring those structures to conform to its ideals. Specifically, it's
> trying to read the counter using atomic_read(), whether or not this is
> possible:
> 
>     fs/xfs/linux-2.6/sema.h:
>     #define valusema(sp)			(atomic_read(&(sp)->count))
> 
>     compile log:
> 
>       CC      fs/xfs/xfs_inode.o
>       CC      fs/xfs/xfs_inode_item.o
>     fs/xfs/xfs_inode_item.c: In function `xfs_inode_item_pushbuf':
>     fs/xfs/xfs_inode_item.c:803: error: structure has no member named `count'
>     fs/xfs/xfs_inode_item.c:825: error: structure has no member named `count'
> 
> Can you fix this please? This will not compile with all archs.
> 
> I'm told that Christoph Hellwig may have an idea or a patch that might provide
> a fix. If it's necessary to get the count on the semaphore (which it might
> be), then you should add a function to each asm/semaphore.h to retrieve it and
> use that.

I just chatted with Christoph about this.  For some reason we thought
all instances of direct count use were in debug code (or were put into
debug-only code), but we missed the one in xfs_inode_item_pushbuf.  It
only needs to know if count > 0, so we could implement that using the
down_trylock primitive, but it'd be pretty ugly.

It looks like a couple of the arch's have now got a sem_getcount, and
Christoph is planning on reviving an earlier patch to provide that API
across all architectures, and then we can change XFS to use that.

cheers.

-- 
Nathan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-12-12 21:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-12 14:39 XFS accessing arch-specific structures David Howells
2005-12-12 21:56 ` Nathan Scott

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.