internal.h 3.38 KB
Newer Older
1
/* internal AFS stuff
Linus Torvalds's avatar
Linus Torvalds committed
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
 *
 * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
 * Written by David Howells (dhowells@redhat.com)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 */

#ifndef AFS_INTERNAL_H
#define AFS_INTERNAL_H

#include <linux/compiler.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/pagemap.h>

/*
 * debug tracing
 */
#define kenter(FMT, a...)	printk("==> %s("FMT")\n",__FUNCTION__ , ## a)
#define kleave(FMT, a...)	printk("<== %s()"FMT"\n",__FUNCTION__ , ## a)
#define kdebug(FMT, a...)	printk(FMT"\n" , ## a)
#define kproto(FMT, a...)	printk("### "FMT"\n" , ## a)
#define knet(FMT, a...)		printk(FMT"\n" , ## a)

#ifdef __KDEBUG
#define _enter(FMT, a...)	kenter(FMT , ## a)
#define _leave(FMT, a...)	kleave(FMT , ## a)
#define _debug(FMT, a...)	kdebug(FMT , ## a)
#define _proto(FMT, a...)	kproto(FMT , ## a)
#define _net(FMT, a...)		knet(FMT , ## a)
#else
#define _enter(FMT, a...)	do { } while(0)
#define _leave(FMT, a...)	do { } while(0)
#define _debug(FMT, a...)	do { } while(0)
#define _proto(FMT, a...)	do { } while(0)
#define _net(FMT, a...)		do { } while(0)
#endif

static inline void afs_discard_my_signals(void)
{
	while (signal_pending(current)) {
		siginfo_t sinfo;

		spin_lock_irq(&current->sighand->siglock);
		dequeue_signal(current,&current->blocked, &sinfo);
		spin_unlock_irq(&current->sighand->siglock);
	}
}

/*
 * cell.c
 */
extern struct rw_semaphore afs_proc_cells_sem;
extern struct list_head afs_proc_cells;
#ifdef AFS_CACHING_SUPPORT
extern struct cachefs_index_def afs_cache_cell_index_def;
#endif

/*
 * dir.c
 */
66
extern const struct inode_operations afs_dir_inode_operations;
67
extern const struct file_operations afs_dir_file_operations;
Linus Torvalds's avatar
Linus Torvalds committed
68 69 70 71

/*
 * file.c
 */
72
extern const struct address_space_operations afs_fs_aops;
73
extern const struct inode_operations afs_file_inode_operations;
Linus Torvalds's avatar
Linus Torvalds committed
74 75

#ifdef AFS_CACHING_SUPPORT
76
extern int afs_cache_get_page_cookie(struct page *, struct cachefs_page **);
Linus Torvalds's avatar
Linus Torvalds committed
77 78 79 80 81
#endif

/*
 * inode.c
 */
82 83 84 85
extern int afs_iget(struct super_block *, struct afs_fid *, struct inode **);
extern int afs_inode_getattr(struct vfsmount *, struct dentry *,
			     struct kstat *);
extern void afs_clear_inode(struct inode *);
Linus Torvalds's avatar
Linus Torvalds committed
86 87 88 89 90 91 92 93 94 95 96

/*
 * main.c
 */
#ifdef AFS_CACHING_SUPPORT
extern struct cachefs_netfs afs_cache_netfs;
#endif

/*
 * mntpt.c
 */
97
extern const struct inode_operations afs_mntpt_inode_operations;
98
extern const struct file_operations afs_mntpt_file_operations;
Linus Torvalds's avatar
Linus Torvalds committed
99 100 101 102
extern struct afs_timer afs_mntpt_expiry_timer;
extern struct afs_timer_ops afs_mntpt_expiry_timer_ops;
extern unsigned long afs_mntpt_expiry_timeout;

103
extern int afs_mntpt_check_symlink(struct afs_vnode *);
Linus Torvalds's avatar
Linus Torvalds committed
104 105 106 107 108 109 110 111 112 113 114 115

/*
 * super.c
 */
extern int afs_fs_init(void);
extern void afs_fs_exit(void);

#define AFS_CB_HASH_COUNT (PAGE_SIZE / sizeof(struct list_head))

extern struct list_head afs_cb_hash_tbl[];
extern spinlock_t afs_cb_hash_lock;

116 117 118 119
#define afs_cb_hash(SRV, FID)						\
	afs_cb_hash_tbl[((unsigned long)(SRV) +				\
			 (FID)->vid + (FID)->vnode + (FID)->unique) &	\
			(AFS_CB_HASH_COUNT - 1)]
Linus Torvalds's avatar
Linus Torvalds committed
120 121 122 123 124 125

/*
 * proc.c
 */
extern int afs_proc_init(void);
extern void afs_proc_cleanup(void);
126 127
extern int afs_proc_cell_setup(struct afs_cell *);
extern void afs_proc_cell_remove(struct afs_cell *);
Linus Torvalds's avatar
Linus Torvalds committed
128 129

#endif /* AFS_INTERNAL_H */