diff options
| author | David S. Miller <davem@nuts.davemloft.net> | 2004-07-11 03:01:09 -0700 |
|---|---|---|
| committer | David S. Miller <davem@nuts.davemloft.net> | 2004-07-11 03:01:09 -0700 |
| commit | 8e9865825f037dd6147ada4147daa7449ac480e3 (patch) | |
| tree | 1403bbe409c7ed15809459f3ccd976fee60a70a4 /include/linux | |
| parent | 13a7e44eb4e2426bbbeeab74e0132b55d50339e9 (diff) | |
| parent | 1baaf2ab322c414d718de98ed2bee7a8bb48af80 (diff) | |
Merge nuts.davemloft.net:/disk1/BK/network-2.6
into nuts.davemloft.net:/disk1/BK/net-2.6
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/crc-ccitt.h | 15 | ||||
| -rw-r--r-- | include/linux/crc16.h | 15 | ||||
| -rw-r--r-- | include/linux/fs.h | 19 | ||||
| -rw-r--r-- | include/linux/iso_fs.h | 2 | ||||
| -rw-r--r-- | include/linux/mount.h | 21 | ||||
| -rw-r--r-- | include/linux/mtd/mtd.h | 19 | ||||
| -rw-r--r-- | include/linux/namei.h | 1 | ||||
| -rw-r--r-- | include/linux/namespace.h | 2 | ||||
| -rw-r--r-- | include/linux/ppp_defs.h | 4 | ||||
| -rw-r--r-- | include/linux/quotaops.h | 19 |
10 files changed, 78 insertions, 39 deletions
diff --git a/include/linux/crc-ccitt.h b/include/linux/crc-ccitt.h new file mode 100644 index 000000000000..f52696a1ff0d --- /dev/null +++ b/include/linux/crc-ccitt.h @@ -0,0 +1,15 @@ +#ifndef _LINUX_CRC_CCITT_H +#define _LINUX_CRC_CCITT_H + +#include <linux/types.h> + +extern u16 const crc_ccitt_table[256]; + +extern u16 crc_ccitt(u16 crc, const u8 *buffer, size_t len); + +static inline u16 crc_ccitt_byte(u16 crc, const u8 c) +{ + return (crc >> 8) ^ crc_ccitt_table[(crc ^ c) & 0xff]; +} + +#endif /* _LINUX_CRC_CCITT_H */ diff --git a/include/linux/crc16.h b/include/linux/crc16.h deleted file mode 100644 index a077021e1c38..000000000000 --- a/include/linux/crc16.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _LINUX_CRC16_H -#define _LINUX_CRC16_H - -#include <linux/types.h> - -extern u16 const crc16_table[256]; - -extern u16 crc16(u16 crc, const u8 *buffer, size_t len); - -static inline u16 crc16_byte(u16 crc, const u8 c) -{ - return (crc >> 8) ^ crc16_table[(crc ^ c) & 0xff]; -} - -#endif /* _LINUX_CRC16_H */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 92e525264998..3d24beb4ac36 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -133,14 +133,13 @@ extern int leases_enable, dir_notify_enable, lease_break_time; #define S_SYNC 1 /* Writes are synced at once */ #define S_NOATIME 2 /* Do not update access times */ -#define S_QUOTA 4 /* Quota initialized for file */ -#define S_APPEND 8 /* Append-only file */ -#define S_IMMUTABLE 16 /* Immutable file */ -#define S_DEAD 32 /* removed, but still open directory */ -#define S_NOQUOTA 64 /* Inode is not counted to quota */ -#define S_DIRSYNC 128 /* Directory modifications are synchronous */ -#define S_NOCMTIME 256 /* Do not update file c/mtime */ -#define S_SWAPFILE 512 /* Do not truncate: swapon got its bmaps */ +#define S_APPEND 4 /* Append-only file */ +#define S_IMMUTABLE 8 /* Immutable file */ +#define S_DEAD 16 /* removed, but still open directory */ +#define S_NOQUOTA 32 /* Inode is not counted to quota */ +#define S_DIRSYNC 64 /* Directory modifications are synchronous */ +#define S_NOCMTIME 128 /* Do not update file c/mtime */ +#define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */ /* * Note that nosuid etc flags are inode-specific: setting some file-system @@ -164,7 +163,6 @@ extern int leases_enable, dir_notify_enable, lease_break_time; ((inode)->i_flags & (S_SYNC|S_DIRSYNC))) #define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK) -#define IS_QUOTAINIT(inode) ((inode)->i_flags & S_QUOTA) #define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA) #define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) #define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) @@ -718,6 +716,7 @@ extern int send_sigurg(struct fown_struct *fown); #define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */ #define MNT_DETACH 0x00000002 /* Just detach from the tree */ +#define MNT_EXPIRE 0x00000004 /* Mark for expiry */ extern struct list_head super_blocks; extern spinlock_t sb_lock; @@ -1342,6 +1341,8 @@ extern ino_t find_inode_number(struct dentry *, struct qstr *); /* needed for stackable file system support */ extern loff_t default_llseek(struct file *file, loff_t offset, int origin); +extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); + extern void inode_init_once(struct inode *); extern void iput(struct inode *); extern struct inode * igrab(struct inode *); diff --git a/include/linux/iso_fs.h b/include/linux/iso_fs.h index 23cdbf83cb16..dd53b6cd2173 100644 --- a/include/linux/iso_fs.h +++ b/include/linux/iso_fs.h @@ -277,7 +277,7 @@ static inline unsigned long isofs_get_ino(unsigned long block, * and "offset" will hold normalized values. Only directories are * affected making it safe to call even for non-directory file * types. */ -static void inline +static inline void isofs_normalize_block_and_offset(struct iso_directory_record* de, unsigned long *block, unsigned long *offset) diff --git a/include/linux/mount.h b/include/linux/mount.h index 61554dda78a8..42e2c9460088 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -29,8 +29,11 @@ struct vfsmount struct list_head mnt_child; /* and going through their mnt_child */ atomic_t mnt_count; int mnt_flags; + int mnt_expiry_mark; /* true if marked for expiry */ char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ struct list_head mnt_list; + struct list_head mnt_fslink; /* link in fs-specific expiry list */ + struct namespace *mnt_namespace; /* containing namespace */ }; static inline struct vfsmount *mntget(struct vfsmount *mnt) @@ -42,7 +45,7 @@ static inline struct vfsmount *mntget(struct vfsmount *mnt) extern void __mntput(struct vfsmount *mnt); -static inline void mntput(struct vfsmount *mnt) +static inline void _mntput(struct vfsmount *mnt) { if (mnt) { if (atomic_dec_and_test(&mnt->mnt_count)) @@ -50,10 +53,26 @@ static inline void mntput(struct vfsmount *mnt) } } +static inline void mntput(struct vfsmount *mnt) +{ + if (mnt) { + mnt->mnt_expiry_mark = 0; + _mntput(mnt); + } +} + extern void free_vfsmnt(struct vfsmount *mnt); extern struct vfsmount *alloc_vfsmnt(const char *name); extern struct vfsmount *do_kern_mount(const char *fstype, int flags, const char *name, void *data); + +struct nameidata; + +extern int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd, + int mnt_flags, struct list_head *fslist); + +extern void mark_mounts_for_expiry(struct list_head *mounts); + extern spinlock_t vfsmount_lock; #endif diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index d186585b73a4..7718658e8e1b 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -12,6 +12,11 @@ #include <linux/module.h> #include <linux/uio.h> +struct kvec { + void *iov_base; /* and that should *never* hold a userland pointer */ + size_t iov_len; +}; + #endif /* __KERNEL__ */ struct erase_info_user { @@ -200,16 +205,16 @@ struct mtd_info { /* This function is not yet implemented */ int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); - /* iovec-based read/write methods. We need these especially for NAND flash, + /* kvec-based read/write methods. We need these especially for NAND flash, with its limited number of write cycles per erase. NB: The 'count' parameter is the number of _vectors_, each of which contains an (ofs, len) tuple. */ - int (*readv) (struct mtd_info *mtd, struct iovec *vecs, unsigned long count, loff_t from, size_t *retlen); - int (*readv_ecc) (struct mtd_info *mtd, struct iovec *vecs, unsigned long count, loff_t from, + int (*readv) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen); + int (*readv_ecc) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel); - int (*writev) (struct mtd_info *mtd, const struct iovec *vecs, unsigned long count, loff_t to, size_t *retlen); - int (*writev_ecc) (struct mtd_info *mtd, const struct iovec *vecs, unsigned long count, loff_t to, + int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen); + int (*writev_ecc) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel); /* Sync */ @@ -250,10 +255,10 @@ struct mtd_notifier { extern void register_mtd_user (struct mtd_notifier *new); extern int unregister_mtd_user (struct mtd_notifier *old); -int default_mtd_writev(struct mtd_info *mtd, const struct iovec *vecs, +int default_mtd_writev(struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen); -int default_mtd_readv(struct mtd_info *mtd, struct iovec *vecs, +int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen); #define MTD_ERASE(mtd, args...) (*(mtd->erase))(mtd, args) diff --git a/include/linux/namei.h b/include/linux/namei.h index adcafdec8ee7..1bbfa296e11f 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h @@ -61,6 +61,7 @@ extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *)); extern int FASTCALL(path_walk(const char *, struct nameidata *)); extern int FASTCALL(link_path_walk(const char *, struct nameidata *)); extern void path_release(struct nameidata *); +extern void path_release_on_umount(struct nameidata *); extern struct dentry * lookup_one_len(const char *, struct dentry *, int); extern struct dentry * lookup_hash(struct qstr *, struct dentry *); diff --git a/include/linux/namespace.h b/include/linux/namespace.h index fdd8abb07386..9eca1558d72f 100644 --- a/include/linux/namespace.h +++ b/include/linux/namespace.h @@ -14,7 +14,7 @@ struct namespace { extern void umount_tree(struct vfsmount *); extern int copy_namespace(int, struct task_struct *); -void __put_namespace(struct namespace *namespace); +extern void __put_namespace(struct namespace *namespace); static inline void put_namespace(struct namespace *namespace) { diff --git a/include/linux/ppp_defs.h b/include/linux/ppp_defs.h index 58c71466a726..402056cd049d 100644 --- a/include/linux/ppp_defs.h +++ b/include/linux/ppp_defs.h @@ -42,7 +42,7 @@ #ifndef _PPP_DEFS_H_ #define _PPP_DEFS_H_ -#include <linux/crc16.h> +#include <linux/crc-ccitt.h> /* * The basic PPP frame. @@ -97,7 +97,7 @@ #define PPP_INITFCS 0xffff /* Initial FCS value */ #define PPP_GOODFCS 0xf0b8 /* Good final FCS value */ -#define PPP_FCS(fcs, c) crc16_byte(fcs, c) +#define PPP_FCS(fcs, c) crc_ccitt_byte(fcs, c) /* * Extended asyncmap - allows any character to be escaped. diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 9db474dcafd5..acc926c64e78 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h @@ -69,9 +69,22 @@ static __inline__ void DQUOT_INIT(struct inode *inode) /* The same as with DQUOT_INIT */ static __inline__ void DQUOT_DROP(struct inode *inode) { - if (IS_QUOTAINIT(inode)) { - BUG_ON(!inode->i_sb); - inode->i_sb->dq_op->drop(inode); /* Ops must be set when there's any quota... */ + /* Here we can get arbitrary inode from clear_inode() so we have + * to be careful. OTOH we don't need locking as quota operations + * are allowed to change only at mount time */ + if (!IS_NOQUOTA(inode) && inode->i_sb && inode->i_sb->dq_op + && inode->i_sb->dq_op->drop) { + int cnt; + /* Test before calling to rule out calls from proc and such + * where we are not allowed to block. Note that this is + * actually reliable test even without the lock - the caller + * must assure that nobody can come after the DQUOT_DROP and + * add quota pointers back anyway */ + for (cnt = 0; cnt < MAXQUOTAS; cnt++) + if (inode->i_dquot[cnt] != NODQUOT) + break; + if (cnt < MAXQUOTAS) + inode->i_sb->dq_op->drop(inode); } } |
