summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_symlink_remote.h
blob: 45855b78178fcf636070ce1fdb2e42972b316f31 (plain)
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
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
 * Copyright (c) 2013 Red Hat, Inc.
 * All Rights Reserved.
 */
#ifndef __XFS_SYMLINK_REMOTE_H
#define __XFS_SYMLINK_REMOTE_H

/*
 * Symlink decoding/encoding functions
 */
int xfs_symlink_blocks(struct xfs_mount *mp, int pathlen);
int xfs_symlink_hdr_set(struct xfs_mount *mp, xfs_ino_t ino, uint32_t offset,
			uint32_t size, struct xfs_buf *bp);
bool xfs_symlink_hdr_ok(xfs_ino_t ino, uint32_t offset,
			uint32_t size, struct xfs_buf *bp);
void xfs_symlink_local_to_remote(struct xfs_trans *tp, struct xfs_buf *bp,
				 struct xfs_inode *ip, struct xfs_ifork *ifp,
				 void *priv);
xfs_failaddr_t xfs_symlink_sf_verify_struct(void *sfp, int64_t size);
xfs_failaddr_t xfs_symlink_shortform_verify(struct xfs_inode *ip);
int xfs_symlink_remote_read(struct xfs_inode *ip, char *link);
int __xfs_symlink_write_target(struct xfs_trans *tp, struct xfs_inode *ip,
		xfs_ino_t owner, const char *target_path, int pathlen,
		xfs_fsblock_t fs_blocks, uint resblks);

static inline int
xfs_symlink_write_target(
	struct xfs_trans	*tp,
	struct xfs_inode	*ip,
	const char		*target_path,
	int			pathlen,
	xfs_fsblock_t		fs_blocks,
	uint			resblks)
{
	return __xfs_symlink_write_target(tp, ip, ip->i_ino, target_path,
			pathlen, fs_blocks, resblks);
}
int xfs_symlink_remote_truncate(struct xfs_trans *tp, struct xfs_inode *ip);

#endif /* __XFS_SYMLINK_REMOTE_H */