cregit-Linux how code gets into the kernel

Release 4.11 fs/ufs/swab.h

Directory: fs/ufs
/*
 *  linux/fs/ufs/swab.h
 *
 * Copyright (C) 1997, 1998 Francois-Rene Rideau <fare@tunes.org>
 * Copyright (C) 1998 Jakub Jelinek <jj@ultra.linux.cz>
 * Copyright (C) 2001 Christoph Hellwig <hch@infradead.org>
 */

#ifndef _UFS_SWAB_H

#define _UFS_SWAB_H

/*
 * Notes:
 *    HERE WE ASSUME EITHER BIG OR LITTLE ENDIAN UFSes
 *    in case there are ufs implementations that have strange bytesexes,
 *    you'll need to modify code here as well as in ufs_super.c and ufs_fs.h
 *    to support them.
 */

enum {
	
BYTESEX_LE,
	
BYTESEX_BE
};


static inline u64 fs64_to_cpu(struct super_block *sbp, __fs64 n) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) return le64_to_cpu((__force __le64)n); else return be64_to_cpu((__force __be64)n); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds2757.45%120.00%
Al Viro1021.28%120.00%
Linus Torvalds (pre-git)714.89%240.00%
Dave Jones36.38%120.00%
Total47100.00%5100.00%


static inline __fs64 cpu_to_fs64(struct super_block *sbp, u64 n) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) return (__force __fs64)cpu_to_le64(n); else return (__force __fs64)cpu_to_be64(n); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds1940.43%125.00%
Linus Torvalds (pre-git)1531.91%125.00%
Al Viro1021.28%125.00%
Dave Jones36.38%125.00%
Total47100.00%4100.00%


static inline u32 fs32_to_cpu(struct super_block *sbp, __fs32 n) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) return le32_to_cpu((__force __le32)n); else return be32_to_cpu((__force __be32)n); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds1940.43%120.00%
Linus Torvalds (pre-git)1531.91%120.00%
Al Viro919.15%120.00%
Dave Jones36.38%120.00%
Harvey Harrison12.13%120.00%
Total47100.00%5100.00%


static inline __fs32 cpu_to_fs32(struct super_block *sbp, u32 n) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) return (__force __fs32)cpu_to_le32(n); else return (__force __fs32)cpu_to_be32(n); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds1940.43%125.00%
Linus Torvalds (pre-git)1531.91%125.00%
Al Viro1021.28%125.00%
Dave Jones36.38%125.00%
Total47100.00%4100.00%


static inline void fs32_add(struct super_block *sbp, __fs32 *n, int d) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) le32_add_cpu((__le32 *)n, d); else be32_add_cpu((__be32 *)n, d); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds2139.62%120.00%
Al Viro1324.53%120.00%
Linus Torvalds (pre-git)1222.64%120.00%
Marcin Ślusarz47.55%120.00%
Dave Jones35.66%120.00%
Total53100.00%5100.00%


static inline void fs32_sub(struct super_block *sbp, __fs32 *n, int d) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) le32_add_cpu((__le32 *)n, -d); else be32_add_cpu((__be32 *)n, -d); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds2240.00%116.67%
Linus Torvalds (pre-git)1323.64%233.33%
Al Viro1323.64%116.67%
Marcin Ślusarz47.27%116.67%
Dave Jones35.45%116.67%
Total55100.00%6100.00%


static inline u16 fs16_to_cpu(struct super_block *sbp, __fs16 n) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) return le16_to_cpu((__force __le16)n); else return be16_to_cpu((__force __be16)n); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)1838.30%240.00%
Linus Torvalds1634.04%120.00%
Al Viro1021.28%120.00%
Dave Jones36.38%120.00%
Total47100.00%5100.00%


static inline __fs16 cpu_to_fs16(struct super_block *sbp, u16 n) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) return (__force __fs16)cpu_to_le16(n); else return (__force __fs16)cpu_to_be16(n); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)1838.30%240.00%
Linus Torvalds1634.04%120.00%
Al Viro1021.28%120.00%
Dave Jones36.38%120.00%
Total47100.00%5100.00%


static inline void fs16_add(struct super_block *sbp, __fs16 *n, int d) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) le16_add_cpu((__le16 *)n, d); else be16_add_cpu((__be16 *)n, d); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds2343.40%120.00%
Al Viro1324.53%120.00%
Linus Torvalds (pre-git)1018.87%120.00%
Marcin Ślusarz47.55%120.00%
Dave Jones35.66%120.00%
Total53100.00%5100.00%


static inline void fs16_sub(struct super_block *sbp, __fs16 *n, int d) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) le16_add_cpu((__le16 *)n, -d); else be16_add_cpu((__be16 *)n, -d); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds2749.09%120.00%
Al Viro1323.64%120.00%
Linus Torvalds (pre-git)814.55%120.00%
Marcin Ślusarz47.27%120.00%
Dave Jones35.45%120.00%
Total55100.00%5100.00%

#endif /* _UFS_SWAB_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds21742.05%112.50%
Linus Torvalds (pre-git)14027.13%225.00%
Al Viro11121.51%112.50%
Dave Jones316.01%225.00%
Marcin Ślusarz163.10%112.50%
Harvey Harrison10.19%112.50%
Total516100.00%8100.00%
Directory: fs/ufs
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.