]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - include/xfs_attr_remote.h
xfs: add CRC protection to remote attributes
[thirdparty/xfsprogs-dev.git] / include / xfs_attr_remote.h
CommitLineData
9d6fabc0
DC
1/*
2 * Copyright (c) 2013 Red Hat, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2.1 of the GNU Lesser General Public License
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 *
12 * Further, this software is distributed without any warranty that it is
13 * free of the rightful claim of any third person regarding infringement
14 * or the like. Any license provided herein, whether implied or
15 * otherwise, applies only to this software file. Patent licenses, if
16 * any, provided herein do not apply to combinations of this program with
17 * other software, or any other product whatsoever.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this program; if not, write the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
22 * USA.
23 */
24#ifndef __XFS_ATTR_REMOTE_H__
25#define __XFS_ATTR_REMOTE_H__
26
59915981
DC
27#define XFS_ATTR3_RMT_MAGIC 0x5841524d /* XARM */
28
29struct xfs_attr3_rmt_hdr {
30 __be32 rm_magic;
31 __be32 rm_offset;
32 __be32 rm_bytes;
33 __be32 rm_crc;
34 uuid_t rm_uuid;
35 __be64 rm_owner;
36 __be64 rm_blkno;
37 __be64 rm_lsn;
38};
39
40#define XFS_ATTR3_RMT_CRC_OFF offsetof(struct xfs_attr3_rmt_hdr, rm_crc)
41
42#define XFS_ATTR3_RMT_BUF_SPACE(mp, bufsize) \
43 ((bufsize) - (xfs_sb_version_hascrc(&(mp)->m_sb) ? \
44 sizeof(struct xfs_attr3_rmt_hdr) : 0))
45
9d6fabc0
DC
46int xfs_attr_rmtval_get(struct xfs_da_args *args);
47int xfs_attr_rmtval_set(struct xfs_da_args *args);
48int xfs_attr_rmtval_remove(struct xfs_da_args *args);
49
50#endif /* __XFS_ATTR_REMOTE_H__ */