From 1fb7e48db6810093012873a652062648ace6b5bb Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Mon, 12 Aug 2013 20:49:40 +1000 Subject: xfs: split out the remote symlink handling The remote symlink format definition and manipulation needs to be shared with userspace, but the in-kernel interfaces do not. Split the remote symlink format handling out into xfs_symlink_remote.[ch] fo it can easily be shared with userspace. Signed-off-by: Dave Chinner Reviewed-by: Mark Tinguely Signed-off-by: Ben Myers --- fs/xfs/xfs_symlink.h | 42 +----------------------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) (limited to 'fs/xfs/xfs_symlink.h') diff --git a/fs/xfs/xfs_symlink.h b/fs/xfs/xfs_symlink.h index c8e3a02f0344..99338ba666ac 100644 --- a/fs/xfs/xfs_symlink.h +++ b/fs/xfs/xfs_symlink.h @@ -17,51 +17,11 @@ #ifndef __XFS_SYMLINK_H #define __XFS_SYMLINK_H 1 -struct xfs_mount; -struct xfs_trans; -struct xfs_inode; -struct xfs_buf; -struct xfs_ifork; -struct xfs_name; - -#define XFS_SYMLINK_MAGIC 0x58534c4d /* XSLM */ - -struct xfs_dsymlink_hdr { - __be32 sl_magic; - __be32 sl_offset; - __be32 sl_bytes; - __be32 sl_crc; - uuid_t sl_uuid; - __be64 sl_owner; - __be64 sl_blkno; - __be64 sl_lsn; -}; - -/* - * The maximum pathlen is 1024 bytes. Since the minimum file system - * blocksize is 512 bytes, we can get a max of 3 extents back from - * bmapi when crc headers are taken into account. - */ -#define XFS_SYMLINK_MAPS 3 - -#define XFS_SYMLINK_BUF_SPACE(mp, bufsize) \ - ((bufsize) - (xfs_sb_version_hascrc(&(mp)->m_sb) ? \ - sizeof(struct xfs_dsymlink_hdr) : 0)) - -int xfs_symlink_blocks(struct xfs_mount *mp, int pathlen); -bool xfs_symlink_hdr_ok(struct xfs_mount *mp, 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); - -extern const struct xfs_buf_ops xfs_symlink_buf_ops; - -#ifdef __KERNEL__ +/* Kernel only symlink defintions */ int xfs_symlink(struct xfs_inode *dp, struct xfs_name *link_name, const char *target_path, umode_t mode, struct xfs_inode **ipp); int xfs_readlink(struct xfs_inode *ip, char *link); int xfs_inactive_symlink(struct xfs_inode *ip, struct xfs_trans **tpp); -#endif /* __KERNEL__ */ #endif /* __XFS_SYMLINK_H */ -- cgit v1.2.3