android_kernel_xiaomi_sm8450/fs/ext4/xattr_hurd.c
Greg Kroah-Hartman 1d722fa8e9 Linux 5.8-rc2
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAl7v4wkeHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGCzQIAIgjUxLRqUMbPJuS
 wApfR5LbR3wfQNd2YypOAFgQ0tasSZiTn2qhesCtmcr0RFb6m8X5/9O2lIlyf2Ts
 YKuzvtuiH6+Y2n+n/hjOKAHI8eRRfY9UUR+56+dF+v7RXLba9THaob2efBNJgrK2
 ddi1sHMBXF1ViYk2wMuOEyOgM5XoKTPSECqwvYY3qHEr6xa5OlC234Y5EZEM/TO1
 gpuuC2fCm++XZo0V7d1zUk6IoW2bv+8NdBOyzGbRkjPM/lQSLklswPOfKDOrm9AX
 Rk4anLK0xbZ00MWQe5AJ3uk9rRzPNDJF1EaDD4N4iAWcztXTB8eM17OdnudLY7fP
 xMBcJ5w=
 =CyHF
 -----END PGP SIGNATURE-----

Merge 5.8-rc2 into android-mainline

Linux 5.8-rc2

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I0e2f0302387539982d5577ad72079621c35c5f61
2020-06-27 09:48:57 +02:00

53 lines
1.3 KiB
C

// SPDX-License-Identifier: GPL-2.0
/*
* linux/fs/ext4/xattr_hurd.c
* Handler for extended gnu attributes for the Hurd.
*
* Copyright (C) 2001 by Andreas Gruenbacher, <a.gruenbacher@computer.org>
* Copyright (C) 2020 by Jan (janneke) Nieuwenhuizen, <janneke@gnu.org>
*/
#include <linux/init.h>
#include <linux/string.h>
#include "ext4.h"
#include "xattr.h"
static bool
ext4_xattr_hurd_list(struct dentry *dentry)
{
return test_opt(dentry->d_sb, XATTR_USER);
}
static int
ext4_xattr_hurd_get(const struct xattr_handler *handler,
struct dentry *unused, struct inode *inode,
const char *name, void *buffer, size_t size,
int flags)
{
if (!test_opt(inode->i_sb, XATTR_USER))
return -EOPNOTSUPP;
return ext4_xattr_get(inode, EXT4_XATTR_INDEX_HURD,
name, buffer, size);
}
static int
ext4_xattr_hurd_set(const struct xattr_handler *handler,
struct dentry *unused, struct inode *inode,
const char *name, const void *value,
size_t size, int flags)
{
if (!test_opt(inode->i_sb, XATTR_USER))
return -EOPNOTSUPP;
return ext4_xattr_set(inode, EXT4_XATTR_INDEX_HURD,
name, value, size, flags);
}
const struct xattr_handler ext4_xattr_hurd_handler = {
.prefix = XATTR_HURD_PREFIX,
.list = ext4_xattr_hurd_list,
.get = ext4_xattr_hurd_get,
.set = ext4_xattr_hurd_set,
};