Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3e3b7ea authored by David Howells's avatar David Howells Committed by Linus Torvalds
Browse files

afs: Add metadata xattrs



Add xattrs to allow the user to get/set metadata in lieu of having pioctl()
available.  The following xattrs are now available:

 - "afs.cell"

   The name of the cell in which the vnode's volume resides.

 - "afs.fid"

   The volume ID, vnode ID and vnode uniquifier of the file as three hex
   numbers separated by colons.

 - "afs.volume"

   The name of the volume in which the vnode resides.

For example:

	# getfattr -d -m ".*" /mnt/scratch
	getfattr: Removing leading '/' from absolute path names
	# file: mnt/scratch
	afs.cell="mycell.myorg.org"
	afs.fid="10000b:1:1"
	afs.volume="scratch"

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent fd249821
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ kafs-objs := \
	vlocation.o \
	vnode.o \
	volume.o \
	write.o
	write.o \
	xattr.o

obj-$(CONFIG_AFS_FS)  := kafs.o
+1 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ const struct inode_operations afs_dir_inode_operations = {
	.permission	= afs_permission,
	.getattr	= afs_getattr,
	.setattr	= afs_setattr,
	.listxattr	= afs_listxattr,
};

const struct dentry_operations afs_fs_dentry_operations = {
+1 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ const struct inode_operations afs_file_inode_operations = {
	.getattr	= afs_getattr,
	.setattr	= afs_setattr,
	.permission	= afs_permission,
	.listxattr	= afs_listxattr,
};

const struct address_space_operations afs_fs_aops = {
+6 −1
Original line number Diff line number Diff line
@@ -28,6 +28,11 @@ struct afs_iget_data {
	struct afs_volume	*volume;	/* volume on which resides */
};

static const struct inode_operations afs_symlink_inode_operations = {
	.get_link	= page_get_link,
	.listxattr	= afs_listxattr,
};

/*
 * map the AFS file status to the inode member variables
 */
@@ -67,7 +72,7 @@ static int afs_inode_map_status(struct afs_vnode *vnode, struct key *key)
			inode->i_fop	= &afs_mntpt_file_operations;
		} else {
			inode->i_mode	= S_IFLNK | vnode->status.mode;
			inode->i_op	= &page_symlink_inode_operations;
			inode->i_op	= &afs_symlink_inode_operations;
		}
		inode_nohighmem(inode);
		break;
+5 −0
Original line number Diff line number Diff line
@@ -731,6 +731,11 @@ extern int afs_writeback_all(struct afs_vnode *);
extern int afs_flush(struct file *, fl_owner_t);
extern int afs_fsync(struct file *, loff_t, loff_t, int);

/*
 * xattr.c
 */
extern const struct xattr_handler *afs_xattr_handlers[];
extern ssize_t afs_listxattr(struct dentry *, char *, size_t);

/*****************************************************************************/
/*
Loading