ia64/linux-2.6.18-xen.hg

annotate fs/jffs2/xattr_trusted.c @ 524:7f8b544237bf

netfront: Allow netfront in domain 0.

This is useful if your physical network device is in a utility domain.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Apr 15 15:18:58 2008 +0100 (2008-04-15)
parents 831230e53067
children
rev   line source
ian@0 1 /*
ian@0 2 * JFFS2 -- Journalling Flash File System, Version 2.
ian@0 3 *
ian@0 4 * Copyright (C) 2006 NEC Corporation
ian@0 5 *
ian@0 6 * Created by KaiGai Kohei <kaigai@ak.jp.nec.com>
ian@0 7 *
ian@0 8 * For licensing information, see the file 'LICENCE' in this directory.
ian@0 9 *
ian@0 10 */
ian@0 11 #include <linux/kernel.h>
ian@0 12 #include <linux/fs.h>
ian@0 13 #include <linux/jffs2.h>
ian@0 14 #include <linux/xattr.h>
ian@0 15 #include <linux/mtd/mtd.h>
ian@0 16 #include "nodelist.h"
ian@0 17
ian@0 18 static int jffs2_trusted_getxattr(struct inode *inode, const char *name,
ian@0 19 void *buffer, size_t size)
ian@0 20 {
ian@0 21 if (!strcmp(name, ""))
ian@0 22 return -EINVAL;
ian@0 23 return do_jffs2_getxattr(inode, JFFS2_XPREFIX_TRUSTED, name, buffer, size);
ian@0 24 }
ian@0 25
ian@0 26 static int jffs2_trusted_setxattr(struct inode *inode, const char *name, const void *buffer,
ian@0 27 size_t size, int flags)
ian@0 28 {
ian@0 29 if (!strcmp(name, ""))
ian@0 30 return -EINVAL;
ian@0 31 return do_jffs2_setxattr(inode, JFFS2_XPREFIX_TRUSTED, name, buffer, size, flags);
ian@0 32 }
ian@0 33
ian@0 34 static size_t jffs2_trusted_listxattr(struct inode *inode, char *list, size_t list_size,
ian@0 35 const char *name, size_t name_len)
ian@0 36 {
ian@0 37 size_t retlen = XATTR_TRUSTED_PREFIX_LEN + name_len + 1;
ian@0 38
ian@0 39 if (list && retlen<=list_size) {
ian@0 40 strcpy(list, XATTR_TRUSTED_PREFIX);
ian@0 41 strcpy(list + XATTR_TRUSTED_PREFIX_LEN, name);
ian@0 42 }
ian@0 43
ian@0 44 return retlen;
ian@0 45 }
ian@0 46
ian@0 47 struct xattr_handler jffs2_trusted_xattr_handler = {
ian@0 48 .prefix = XATTR_TRUSTED_PREFIX,
ian@0 49 .list = jffs2_trusted_listxattr,
ian@0 50 .set = jffs2_trusted_setxattr,
ian@0 51 .get = jffs2_trusted_getxattr
ian@0 52 };