diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 12:13:00 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 12:13:00 -0700 |
commit | f063a0c0c995d010960efcc1b2ed14b99674f25c (patch) | |
tree | 106e30acd1a58b3cf9f3c15abe1de83f1919e03b /drivers/staging/autofs/autofs_i.h | |
parent | 3c3762957818dc902222733a8184f23102e24472 (diff) | |
parent | 5af634789c93b97cfb314a102436716be8fbc577 (diff) | |
download | op-kernel-dev-f063a0c0c995d010960efcc1b2ed14b99674f25c.zip op-kernel-dev-f063a0c0c995d010960efcc1b2ed14b99674f25c.tar.gz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (841 commits)
Staging: brcm80211: fix usage of roundup in structures
Staging: bcm: fix up network device reference counting
Staging: keucr: fix up US_ macro change
staging: brcm80211: brcmfmac: Removed codeversion from firmware filenames.
staging: brcm80211: Remove unnecessary header files.
staging: brcm80211: Remove unnecessary includes from bcmutils.c
staging: brcm80211: Removed unnecessary pktsetprio() function.
Staging: brcm80211: remove typedefs.h
Staging: brcm80211: remove uintptr typedef usage
Staging: hv: remove struct vmbus_channel_interface
Staging: hv: remove Open from struct vmbus_channel_interface
Staging: hv: storvsc: call vmbus_open directly
Staging: hv: netvsc: call vmbus_open directly
Staging: hv: channel: export vmbus_open to modules
Staging: hv: remove Close from struct vmbus_channel_interface
Staging: hv: netvsc: call vmbus_close directly
Staging: hv: storvsc: call vmbus_close directly
Staging: hv: channel: export vmbus_close to modules
Staging: hv: remove SendPacket from struct vmbus_channel_interface
Staging: hv: storvsc: call vmbus_sendpacket directly
...
Fix up conflicts in
drivers/staging/cx25821/cx25821-audio-upstream.c
drivers/staging/cx25821/cx25821-audio.h
due to warring whitespace cleanups (neither of which were all that great)
Diffstat (limited to 'drivers/staging/autofs/autofs_i.h')
-rw-r--r-- | drivers/staging/autofs/autofs_i.h | 165 |
1 files changed, 165 insertions, 0 deletions
diff --git a/drivers/staging/autofs/autofs_i.h b/drivers/staging/autofs/autofs_i.h new file mode 100644 index 0000000..647a143 --- /dev/null +++ b/drivers/staging/autofs/autofs_i.h @@ -0,0 +1,165 @@ +/* -*- linux-c -*- ------------------------------------------------------- * + * + * drivers/staging/autofs/autofs_i.h + * + * Copyright 1997-1998 Transmeta Corporation - All Rights Reserved + * + * This file is part of the Linux kernel and is made available under + * the terms of the GNU General Public License, version 2, or at your + * option, any later version, incorporated herein by reference. + * + * ----------------------------------------------------------------------- */ + +/* Internal header file for autofs */ + +#include <linux/auto_fs.h> + +/* This is the range of ioctl() numbers we claim as ours */ +#define AUTOFS_IOC_FIRST AUTOFS_IOC_READY +#define AUTOFS_IOC_COUNT 32 + +#include <linux/kernel.h> +#include <linux/slab.h> +#include <linux/time.h> +#include <linux/string.h> +#include <linux/wait.h> +#include <linux/dcache.h> +#include <linux/namei.h> +#include <linux/mount.h> +#include <linux/sched.h> + +#include <asm/current.h> +#include <asm/uaccess.h> + +#ifdef DEBUG +#define DPRINTK(D) (printk D) +#else +#define DPRINTK(D) ((void)0) +#endif + +/* + * If the daemon returns a negative response (AUTOFS_IOC_FAIL) then the + * kernel will keep the negative response cached for up to the time given + * here, although the time can be shorter if the kernel throws the dcache + * entry away. This probably should be settable from user space. + */ +#define AUTOFS_NEGATIVE_TIMEOUT (60*HZ) /* 1 minute */ + +/* Structures associated with the root directory hash table */ + +#define AUTOFS_HASH_SIZE 67 + +struct autofs_dir_ent { + int hash; + char *name; + int len; + ino_t ino; + struct dentry *dentry; + /* Linked list of entries */ + struct autofs_dir_ent *next; + struct autofs_dir_ent **back; + /* The following entries are for the expiry system */ + unsigned long last_usage; + struct list_head exp; +}; + +struct autofs_dirhash { + struct autofs_dir_ent *h[AUTOFS_HASH_SIZE]; + struct list_head expiry_head; +}; + +struct autofs_wait_queue { + wait_queue_head_t queue; + struct autofs_wait_queue *next; + autofs_wqt_t wait_queue_token; + /* We use the following to see what we are waiting for */ + int hash; + int len; + char *name; + /* This is for status reporting upon return */ + int status; + int wait_ctr; +}; + +struct autofs_symlink { + char *data; + int len; + time_t mtime; +}; + +#define AUTOFS_MAX_SYMLINKS 256 + +#define AUTOFS_ROOT_INO 1 +#define AUTOFS_FIRST_SYMLINK 2 +#define AUTOFS_FIRST_DIR_INO (AUTOFS_FIRST_SYMLINK+AUTOFS_MAX_SYMLINKS) + +#define AUTOFS_SYMLINK_BITMAP_LEN \ + ((AUTOFS_MAX_SYMLINKS+((sizeof(long)*1)-1))/(sizeof(long)*8)) + +#define AUTOFS_SBI_MAGIC 0x6d4a556d + +struct autofs_sb_info { + u32 magic; + struct file *pipe; + struct pid *oz_pgrp; + int catatonic; + struct super_block *sb; + unsigned long exp_timeout; + ino_t next_dir_ino; + struct autofs_wait_queue *queues; /* Wait queue pointer */ + struct autofs_dirhash dirhash; /* Root directory hash */ + struct autofs_symlink symlink[AUTOFS_MAX_SYMLINKS]; + unsigned long symlink_bitmap[AUTOFS_SYMLINK_BITMAP_LEN]; +}; + +static inline struct autofs_sb_info *autofs_sbi(struct super_block *sb) +{ + return (struct autofs_sb_info *)(sb->s_fs_info); +} + +/* autofs_oz_mode(): do we see the man behind the curtain? (The + processes which do manipulations for us in user space sees the raw + filesystem without "magic".) */ + +static inline int autofs_oz_mode(struct autofs_sb_info *sbi) { + return sbi->catatonic || task_pgrp(current) == sbi->oz_pgrp; +} + +/* Hash operations */ + +void autofs_initialize_hash(struct autofs_dirhash *); +struct autofs_dir_ent *autofs_hash_lookup(const struct autofs_dirhash *,struct qstr *); +void autofs_hash_insert(struct autofs_dirhash *,struct autofs_dir_ent *); +void autofs_hash_delete(struct autofs_dir_ent *); +struct autofs_dir_ent *autofs_hash_enum(const struct autofs_dirhash *,off_t *,struct autofs_dir_ent *); +void autofs_hash_dputall(struct autofs_dirhash *); +void autofs_hash_nuke(struct autofs_sb_info *); + +/* Expiration-handling functions */ + +void autofs_update_usage(struct autofs_dirhash *,struct autofs_dir_ent *); +struct autofs_dir_ent *autofs_expire(struct super_block *,struct autofs_sb_info *, struct vfsmount *mnt); + +/* Operations structures */ + +extern const struct inode_operations autofs_root_inode_operations; +extern const struct inode_operations autofs_symlink_inode_operations; +extern const struct file_operations autofs_root_operations; + +/* Initializing function */ + +int autofs_fill_super(struct super_block *, void *, int); +void autofs_kill_sb(struct super_block *sb); +struct inode *autofs_iget(struct super_block *, unsigned long); + +/* Queue management functions */ + +int autofs_wait(struct autofs_sb_info *,struct qstr *); +int autofs_wait_release(struct autofs_sb_info *,autofs_wqt_t,int); +void autofs_catatonic_mode(struct autofs_sb_info *); + +#ifdef DEBUG +void autofs_say(const char *name, int len); +#else +#define autofs_say(n,l) ((void)0) +#endif |