Changeset View
Changeset View
Standalone View
Standalone View
head/sys/fs/ext2fs/ext2_extattr.c
Show All 33 Lines | |||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/vnode.h> | #include <sys/vnode.h> | ||||
#include <sys/bio.h> | #include <sys/bio.h> | ||||
#include <sys/buf.h> | #include <sys/buf.h> | ||||
#include <sys/endian.h> | #include <sys/endian.h> | ||||
#include <sys/conf.h> | #include <sys/conf.h> | ||||
#include <sys/extattr.h> | #include <sys/extattr.h> | ||||
#include <sys/sdt.h> | |||||
#include <fs/ext2fs/fs.h> | #include <fs/ext2fs/fs.h> | ||||
#include <fs/ext2fs/ext2fs.h> | #include <fs/ext2fs/ext2fs.h> | ||||
#include <fs/ext2fs/inode.h> | #include <fs/ext2fs/inode.h> | ||||
#include <fs/ext2fs/ext2_dinode.h> | #include <fs/ext2fs/ext2_dinode.h> | ||||
#include <fs/ext2fs/ext2_mount.h> | #include <fs/ext2fs/ext2_mount.h> | ||||
#include <fs/ext2fs/ext2_extattr.h> | #include <fs/ext2fs/ext2_extattr.h> | ||||
#include <fs/ext2fs/ext2_extern.h> | #include <fs/ext2fs/ext2_extern.h> | ||||
SDT_PROVIDER_DECLARE(ext2fs); | |||||
/* | |||||
* ext2fs trace probe: | |||||
* arg0: verbosity. Higher numbers give more verbose messages | |||||
* arg1: Textual message | |||||
*/ | |||||
SDT_PROBE_DEFINE2(ext2fs, , trace, extattr, "int", "char*"); | |||||
static int | static int | ||||
ext2_extattr_attrnamespace_to_bsd(int attrnamespace) | ext2_extattr_attrnamespace_to_bsd(int attrnamespace) | ||||
{ | { | ||||
switch (attrnamespace) { | switch (attrnamespace) { | ||||
case EXT4_XATTR_INDEX_SYSTEM: | case EXT4_XATTR_INDEX_SYSTEM: | ||||
return (EXTATTR_NAMESPACE_SYSTEM); | return (EXTATTR_NAMESPACE_SYSTEM); | ||||
Show All 25 Lines | else if (attrnamespace == EXT4_XATTR_INDEX_POSIX_ACL_DEFAULT) { | ||||
*name_len = strlen(POSIX1E_ACL_ACCESS_EXTATTR_NAME); | *name_len = strlen(POSIX1E_ACL_ACCESS_EXTATTR_NAME); | ||||
return (POSIX1E_ACL_ACCESS_EXTATTR_NAME); | return (POSIX1E_ACL_ACCESS_EXTATTR_NAME); | ||||
} | } | ||||
/* | /* | ||||
* XXX: Not all linux namespaces are mapped to bsd for now, | * XXX: Not all linux namespaces are mapped to bsd for now, | ||||
* return NULL, which will be converted to ENOTSUP on upper layer. | * return NULL, which will be converted to ENOTSUP on upper layer. | ||||
*/ | */ | ||||
#ifdef EXT2FS_DEBUG | SDT_PROBE2(ext2fs, , trace, extattr, 1, | ||||
printf("can not convert ext2fs name to bsd: namespace=%d\n", attrnamespace); | "can not convert ext2fs name to bsd namespace"); | ||||
#endif | |||||
return (NULL); | return (NULL); | ||||
} | } | ||||
static int | static int | ||||
ext2_extattr_attrnamespace_to_linux(int attrnamespace, const char *name) | ext2_extattr_attrnamespace_to_linux(int attrnamespace, const char *name) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 1,145 Lines • Show Last 20 Lines |