2 * Copyright (c) 2012 Red Hat, Inc. All rights reserved.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it would be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write the Free Software Foundation,
15 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 #ifndef __XFS_SYMLINK_H
18 #define __XFS_SYMLINK_H 1
27 #define XFS_SYMLINK_MAGIC 0x58534c4d /* XSLM */
29 struct xfs_dsymlink_hdr
{
41 * The maximum pathlen is 1024 bytes. Since the minimum file system
42 * blocksize is 512 bytes, we can get a max of 3 extents back from
43 * bmapi when crc headers are taken into account.
45 #define XFS_SYMLINK_MAPS 3
47 #define XFS_SYMLINK_BUF_SPACE(mp, bufsize) \
48 ((bufsize) - (xfs_sb_version_hascrc(&(mp)->m_sb) ? \
49 sizeof(struct xfs_dsymlink_hdr) : 0))
51 int xfs_symlink_blocks(struct xfs_mount
*mp
, int pathlen
);
53 void xfs_symlink_local_to_remote(struct xfs_trans
*tp
, struct xfs_buf
*bp
,
54 struct xfs_inode
*ip
, struct xfs_ifork
*ifp
);
56 extern const struct xfs_buf_ops xfs_symlink_buf_ops
;
60 int xfs_symlink(struct xfs_inode
*dp
, struct xfs_name
*link_name
,
61 const char *target_path
, umode_t mode
, struct xfs_inode
**ipp
);
62 int xfs_readlink(struct xfs_inode
*ip
, char *link
);
63 int xfs_inactive_symlink_rmt(struct xfs_inode
*ip
, struct xfs_trans
**tpp
);
65 #endif /* __KERNEL__ */
66 #endif /* __XFS_SYMLINK_H */