All of lore.kernel.org
 help / color / mirror / Atom feed
* i_op->listxattr semantics
@ 2003-06-08  1:34 Will Dyson
  2003-06-08  2:07 ` Nathan Scott
  0 siblings, 1 reply; 2+ messages in thread
From: Will Dyson @ 2003-06-08  1:34 UTC (permalink / raw)
  To: linux-fsdevel

Hello all,

I am attempting to implement support for extended attributes in the Be
Filesystem (befs) driver. But I am stuck trying to figure out why the
getfattr program does not list my attributes.

Below is a test version of befs_listxattr that gives all files one
attribute named "MyAttr". When I mount my filesystem on /befs (in
2.5.69-uml) and issue the command "getfattr -d /befs", no attributes are
printed. The debugging statements appear in my syslog, so I know the
function is being called.

Can anyone help me figure out what I am doing wrong? Thanks!

static ssize_t
befs_listxattr(struct dentry *dentry, char *buffer, size_t size)
{
	struct super_block *sb = dentry->d_inode->i_sb;
	ssize_t attr_len = 0;
	char *attr = "MyAttr";

	befs_debug(sb, "---> befs_listxattr for inode %lu "
			"with %d buffer_size",
			dentry->d_inode->i_ino, size);

	attr_len = strlen(attr);
	
	if (buffer) {
		memcpy(buffer, attr, attr_len);
		buffer[attr_len] = '\0';
	}
	
	befs_debug(sb, "<--- befs_listxattr");
	return attr_len + 1;
}



-- 
Will Dyson
"Back off man, I'm a scientist!" -Dr. Peter Venkman


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

* Re: i_op->listxattr semantics
  2003-06-08  1:34 i_op->listxattr semantics Will Dyson
@ 2003-06-08  2:07 ` Nathan Scott
  0 siblings, 0 replies; 2+ messages in thread
From: Nathan Scott @ 2003-06-08  2:07 UTC (permalink / raw)
  To: Will Dyson; +Cc: linux-fsdevel

On Sat, Jun 07, 2003 at 09:34:34PM -0400, Will Dyson wrote:
> Hello all,
> 
> I am attempting to implement support for extended attributes in the Be
> Filesystem (befs) driver. But I am stuck trying to figure out why the
> getfattr program does not list my attributes.
> 
> Below is a test version of befs_listxattr that gives all files one
> attribute named "MyAttr". When I mount my filesystem on /befs (in
> 2.5.69-uml) and issue the command "getfattr -d /befs", no attributes are
> printed. The debugging statements appear in my syslog, so I know the
> function is being called.
> 
> Can anyone help me figure out what I am doing wrong? Thanks!

At first guess, probably the lack of a namespace prefix is causing
your problem - see attr(5) and listxattr(2).

> static ssize_t
> befs_listxattr(struct dentry *dentry, char *buffer, size_t size)
> {
> 	struct super_block *sb = dentry->d_inode->i_sb;
> 	ssize_t attr_len = 0;
> 	char *attr = "MyAttr";

Try 's/MyAttr/user.MyAttr/g' or whichever namespace is appropriate.

cheers.

-- 
Nathan

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

end of thread, other threads:[~2003-06-08  1:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-08  1:34 i_op->listxattr semantics Will Dyson
2003-06-08  2:07 ` 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.