unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob ee31557308a94365f1bceab93d10e438967e6893 1666 bytes (raw)
name: fs/ext4/xattr_hurd.c 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
 
// 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) &&
        	EXT4_SB(dentry->d_sb)->s_es->s_creator_os ==
		cpu_to_le32(EXT4_OS_HURD);
}

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)
{
	if (!test_opt(inode->i_sb, XATTR_USER) ||
            EXT4_SB(inode->i_sb)->s_es->s_creator_os !=
            cpu_to_le32(EXT4_OS_HURD))
		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) ||
            EXT4_SB(inode->i_sb)->s_es->s_creator_os !=
            cpu_to_le32(EXT4_OS_HURD))
		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,
};

debug log:

solving ee31557308a9 ...
found ee31557308a9 in https://yhetil.org/guix-devel/87sgg5z1gt.fsf@gnu.org/

applying [1/1] https://yhetil.org/guix-devel/87sgg5z1gt.fsf@gnu.org/
diff --git a/fs/ext4/xattr_hurd.c b/fs/ext4/xattr_hurd.c
new file mode 100644
index 000000000000..ee31557308a9

1:25: space before tab in indent.
        	EXT4_SB(dentry->d_sb)->s_es->s_creator_os ==
Checking patch fs/ext4/xattr_hurd.c...
Applied patch fs/ext4/xattr_hurd.c cleanly.
warning: 1 line adds whitespace errors.

index at:
100644 ee31557308a94365f1bceab93d10e438967e6893	fs/ext4/xattr_hurd.c

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).