mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-12 19:20:28 +03:00
Make include/linux/ conform to ZFS style standard
No semantic changes. Fix the following types of style issues: blank after preprocessor # #define followed by space instead of tab improper first line of block comment indent by spaces instead of tabs last line in file is blank missing blank after open comment missing space before left brace non-continuation indented 4 spaces spaces instead of tabs unparenthesized return expression Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
This commit is contained in:
parent
4b393c50ae
commit
ce319db57b
@ -23,9 +23,8 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_BITOPS_COMPAT_H
|
||||
#define _SPL_BITOPS_COMPAT_H
|
||||
#define _SPL_BITOPS_COMPAT_H
|
||||
|
||||
#include <linux/bitops.h>
|
||||
|
||||
#endif /* _SPL_BITOPS_COMPAT_H */
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_COMPILER_COMPAT_H
|
||||
#define _SPL_COMPILER_COMPAT_H
|
||||
#define _SPL_COMPILER_COMPAT_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
* handlers, all running on the same CPU.
|
||||
*/
|
||||
/* Taken from 2.6.33.2 */
|
||||
# define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
|
||||
#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
|
||||
#endif
|
||||
|
||||
#endif /* _SPL_COMPILER_COMPAT_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_DELAY_COMPAT_H
|
||||
#define _SPL_DELAY_COMPAT_H
|
||||
#define _SPL_DELAY_COMPAT_H
|
||||
|
||||
#include <linux/delay.h>
|
||||
#include <linux/time.h>
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_FILE_COMPAT_H
|
||||
#define _SPL_FILE_COMPAT_H
|
||||
#define _SPL_FILE_COMPAT_H
|
||||
|
||||
#include <linux/fs.h>
|
||||
#ifdef HAVE_FDTABLE_HEADER
|
||||
@ -33,22 +33,22 @@
|
||||
static inline struct file *
|
||||
spl_filp_open(const char *name, int flags, int mode, int *err)
|
||||
{
|
||||
struct file *filp = NULL;
|
||||
int rc;
|
||||
struct file *filp = NULL;
|
||||
int rc;
|
||||
|
||||
filp = filp_open(name, flags, mode);
|
||||
if (IS_ERR(filp)) {
|
||||
rc = PTR_ERR(filp);
|
||||
if (err)
|
||||
*err = rc;
|
||||
filp = NULL;
|
||||
}
|
||||
return filp;
|
||||
filp = filp_open(name, flags, mode);
|
||||
if (IS_ERR(filp)) {
|
||||
rc = PTR_ERR(filp);
|
||||
if (err)
|
||||
*err = rc;
|
||||
filp = NULL;
|
||||
}
|
||||
return (filp);
|
||||
}
|
||||
|
||||
#define spl_filp_close(f) filp_close(f, NULL)
|
||||
#define spl_filp_poff(f) (&(f)->f_pos)
|
||||
#define spl_filp_write(fp, b, s, p) (fp)->f_op->write((fp), (b), (s), p)
|
||||
#define spl_filp_close(f) filp_close(f, NULL)
|
||||
#define spl_filp_poff(f) (&(f)->f_pos)
|
||||
#define spl_filp_write(fp, b, s, p) (fp)->f_op->write((fp), (b), (s), p)
|
||||
|
||||
static inline int
|
||||
spl_filp_fallocate(struct file *fp, int mode, loff_t offset, loff_t len)
|
||||
@ -65,7 +65,7 @@ spl_filp_fallocate(struct file *fp, int mode, loff_t offset, loff_t len)
|
||||
error = fp->f_dentry->d_inode->i_op->fallocate(
|
||||
fp->f_dentry->d_inode, mode, offset, len);
|
||||
#endif /* HAVE_INODE_FALLOCATE */
|
||||
#endif /*HAVE_FILE_FALLOCATE */
|
||||
#endif /* HAVE_FILE_FALLOCATE */
|
||||
|
||||
return (error);
|
||||
}
|
||||
@ -97,4 +97,3 @@ spl_filp_fallocate(struct file *fp, int mode, loff_t offset, loff_t len)
|
||||
#endif
|
||||
|
||||
#endif /* SPL_FILE_COMPAT_H */
|
||||
|
||||
|
@ -23,29 +23,28 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_LIST_COMPAT_H
|
||||
#define _SPL_LIST_COMPAT_H
|
||||
#define _SPL_LIST_COMPAT_H
|
||||
|
||||
#include <linux/list.h>
|
||||
|
||||
#ifndef list_for_each_entry_safe_reverse
|
||||
|
||||
/**
|
||||
/*
|
||||
* list_for_each_entry_safe_reverse
|
||||
* @pos: the type * to use as a loop cursor.
|
||||
* @n: another type * to use as temporary storage
|
||||
* @head: the head for your list.
|
||||
* @member: the name of the list_struct within the struct.
|
||||
* @pos: the type * to use as a loop cursor.
|
||||
* @n: another type * to use as temporary storage
|
||||
* @head: the head for your list.
|
||||
* @member: the name of the list_struct within the struct.
|
||||
*
|
||||
* Iterate backwards over list of given type, safe against removal
|
||||
* of list entry.
|
||||
*/
|
||||
#define list_for_each_entry_safe_reverse(pos, n, head, member) \
|
||||
for (pos = list_entry((head)->prev, typeof(*pos), member), \
|
||||
n = list_entry(pos->member.prev, typeof(*pos), member); \
|
||||
&pos->member != (head); \
|
||||
pos = n, n = list_entry(n->member.prev, typeof(*n), member))
|
||||
#define list_for_each_entry_safe_reverse(pos, n, head, member) \
|
||||
for (pos = list_entry((head)->prev, typeof(*pos), member), \
|
||||
n = list_entry(pos->member.prev, typeof(*pos), member); \
|
||||
&pos->member != (head); \
|
||||
pos = n, n = list_entry(n->member.prev, typeof(*n), member))
|
||||
|
||||
#endif /* list_for_each_entry_safe_reverse */
|
||||
|
||||
#endif /* SPL_LIST_COMPAT_H */
|
||||
|
||||
|
@ -23,10 +23,10 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_MATH64_COMPAT_H
|
||||
#define _SPL_MATH64_COMPAT_H
|
||||
#define _SPL_MATH64_COMPAT_H
|
||||
|
||||
#ifndef abs64
|
||||
#define abs64(x) ({ uint64_t t = (x) >> 63; ((x) ^ t) - t; })
|
||||
#define abs64(x) ({ uint64_t t = (x) >> 63; ((x) ^ t) - t; })
|
||||
#endif
|
||||
|
||||
#endif /* _SPL_MATH64_COMPAT_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_MM_COMPAT_H
|
||||
#define _SPL_MM_COMPAT_H
|
||||
#define _SPL_MM_COMPAT_H
|
||||
|
||||
#include <linux/mm.h>
|
||||
#include <linux/fs.h>
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_PROC_COMPAT_H
|
||||
#define _SPL_PROC_COMPAT_H
|
||||
#define _SPL_PROC_COMPAT_H
|
||||
|
||||
#include <linux/proc_fs.h>
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_RWSEM_COMPAT_H
|
||||
#define _SPL_RWSEM_COMPAT_H
|
||||
#define _SPL_RWSEM_COMPAT_H
|
||||
|
||||
#include <linux/rwsem.h>
|
||||
|
||||
@ -53,15 +53,16 @@
|
||||
int rwsem_tryupgrade(struct rw_semaphore *rwsem);
|
||||
|
||||
#if defined(RWSEM_SPINLOCK_IS_RAW)
|
||||
#define spl_rwsem_lock_irqsave(lk, fl) raw_spin_lock_irqsave(lk, fl)
|
||||
#define spl_rwsem_unlock_irqrestore(lk, fl) raw_spin_unlock_irqrestore(lk, fl)
|
||||
#define spl_rwsem_trylock_irqsave(lk, fl) raw_spin_trylock_irqsave(lk, fl)
|
||||
#define spl_rwsem_lock_irqsave(lk, fl) raw_spin_lock_irqsave(lk, fl)
|
||||
#define spl_rwsem_unlock_irqrestore(lk, fl) \
|
||||
raw_spin_unlock_irqrestore(lk, fl)
|
||||
#define spl_rwsem_trylock_irqsave(lk, fl) raw_spin_trylock_irqsave(lk, fl)
|
||||
#else
|
||||
#define spl_rwsem_lock_irqsave(lk, fl) spin_lock_irqsave(lk, fl)
|
||||
#define spl_rwsem_unlock_irqrestore(lk, fl) spin_unlock_irqrestore(lk, fl)
|
||||
#define spl_rwsem_trylock_irqsave(lk, fl) spin_trylock_irqsave(lk, fl)
|
||||
#define spl_rwsem_lock_irqsave(lk, fl) spin_lock_irqsave(lk, fl)
|
||||
#define spl_rwsem_unlock_irqrestore(lk, fl) spin_unlock_irqrestore(lk, fl)
|
||||
#define spl_rwsem_trylock_irqsave(lk, fl) spin_trylock_irqsave(lk, fl)
|
||||
#endif /* RWSEM_SPINLOCK_IS_RAW */
|
||||
|
||||
#define spl_rwsem_is_locked(rwsem) rwsem_is_locked(rwsem)
|
||||
#define spl_rwsem_is_locked(rwsem) rwsem_is_locked(rwsem)
|
||||
|
||||
#endif /* _SPL_RWSEM_COMPAT_H */
|
||||
|
@ -23,23 +23,23 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_WAIT_COMPAT_H
|
||||
#define _SPL_WAIT_COMPAT_H
|
||||
#define _SPL_WAIT_COMPAT_H
|
||||
|
||||
#include <linux/sched.h>
|
||||
#include <linux/wait.h>
|
||||
|
||||
#ifndef HAVE_WAIT_ON_BIT_ACTION
|
||||
# define spl_wait_on_bit(word, bit, mode) wait_on_bit(word, bit, mode)
|
||||
#define spl_wait_on_bit(word, bit, mode) wait_on_bit(word, bit, mode)
|
||||
#else
|
||||
|
||||
static inline int
|
||||
spl_bit_wait(void *word)
|
||||
{
|
||||
schedule();
|
||||
return 0;
|
||||
schedule();
|
||||
return (0);
|
||||
}
|
||||
|
||||
#define spl_wait_on_bit(word, bit, mode) \
|
||||
#define spl_wait_on_bit(word, bit, mode) \
|
||||
wait_on_bit(word, bit, spl_bit_wait, mode)
|
||||
|
||||
#endif /* HAVE_WAIT_ON_BIT_ACTION */
|
||||
|
@ -22,15 +22,15 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_ZLIB_COMPAT_H
|
||||
#define _SPL_ZLIB_COMPAT_H
|
||||
#define _SPL_ZLIB_COMPAT_H
|
||||
|
||||
#include <linux/zlib.h>
|
||||
|
||||
#ifdef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE
|
||||
#define spl_zlib_deflate_workspacesize(wb, ml) \
|
||||
#define spl_zlib_deflate_workspacesize(wb, ml) \
|
||||
zlib_deflate_workspacesize(wb, ml)
|
||||
#else
|
||||
#define spl_zlib_deflate_workspacesize(wb, ml) \
|
||||
#define spl_zlib_deflate_workspacesize(wb, ml) \
|
||||
zlib_deflate_workspacesize()
|
||||
#endif /* HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user