summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRichard Henderson <rth@are.twiddle.net>2003-01-01 10:11:47 -0800
committerRichard Henderson <rth@are.twiddle.net>2003-01-01 10:11:47 -0800
commit47516c7a3f394b82694bf2c60d93be6ae08d1b64 (patch)
tree9793035200e629bec4f2133009add011a5b45a2b /include/linux
parentd77e03bd31e6c994408fc01eaf0ebf263779864d (diff)
parent4c55cc628bf2eaa15a8d5814974ad61e71d7e30c (diff)
Merge with mainline.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/coda_psdev.h2
-rw-r--r--include/linux/devfs_fs_kernel.h44
-rw-r--r--include/linux/efs_fs.h2
-rw-r--r--include/linux/ext3_fs.h3
-rw-r--r--include/linux/fb.h8
-rw-r--r--include/linux/font.h45
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/moduleloader.h19
-rw-r--r--include/linux/msdos_fs.h3
-rw-r--r--include/linux/nfsd/xdr.h1
-rw-r--r--include/linux/pci_ids.h37
-rw-r--r--include/linux/quota.h71
-rw-r--r--include/linux/quotaops.h55
13 files changed, 153 insertions, 139 deletions
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index 0e3f73f7a73e..5c3fefddd4f7 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -6,6 +6,8 @@
#define CODA_SUPER_MAGIC 0x73757245
+struct statfs;
+
struct coda_sb_info
{
struct venus_comm * sbi_vcomm;
diff --git a/include/linux/devfs_fs_kernel.h b/include/linux/devfs_fs_kernel.h
index 15c85cccdded..491dc297b930 100644
--- a/include/linux/devfs_fs_kernel.h
+++ b/include/linux/devfs_fs_kernel.h
@@ -53,17 +53,8 @@ extern int devfs_mk_symlink (devfs_handle_t dir, const char *name,
devfs_handle_t *handle, void *info);
extern devfs_handle_t devfs_mk_dir (devfs_handle_t dir, const char *name,
void *info);
-extern devfs_handle_t devfs_get_handle (devfs_handle_t dir, const char *name,
- int traverse_symlinks);
-extern devfs_handle_t devfs_get_handle_from_inode (struct inode *inode);
extern int devfs_generate_path (devfs_handle_t de, char *path, int buflen);
extern int devfs_set_file_size (devfs_handle_t de, unsigned long size);
-extern void *devfs_get_info (devfs_handle_t de);
-extern int devfs_set_info (devfs_handle_t de, void *info);
-extern devfs_handle_t devfs_get_parent (devfs_handle_t de);
-extern devfs_handle_t devfs_get_first_child (devfs_handle_t de);
-extern devfs_handle_t devfs_get_next_sibling (devfs_handle_t de);
-extern const char *devfs_get_name (devfs_handle_t de, unsigned int *namelen);
extern int devfs_only (void);
extern int devfs_register_tape (devfs_handle_t de);
extern void devfs_unregister_tape(int num);
@@ -115,19 +106,9 @@ static inline devfs_handle_t devfs_mk_dir (devfs_handle_t dir,
{
return NULL;
}
-static inline devfs_handle_t devfs_get_handle (devfs_handle_t dir,
- const char *name,
- int traverse_symlinks)
-{
- return NULL;
-}
static inline void devfs_remove(const char *fmt, ...)
{
}
-static inline devfs_handle_t devfs_get_handle_from_inode (struct inode *inode)
-{
- return NULL;
-}
static inline int devfs_generate_path (devfs_handle_t de, char *path,
int buflen)
{
@@ -137,31 +118,6 @@ static inline int devfs_set_file_size (devfs_handle_t de, unsigned long size)
{
return -ENOSYS;
}
-static inline void *devfs_get_info (devfs_handle_t de)
-{
- return NULL;
-}
-static inline int devfs_set_info (devfs_handle_t de, void *info)
-{
- return 0;
-}
-static inline devfs_handle_t devfs_get_parent (devfs_handle_t de)
-{
- return NULL;
-}
-static inline devfs_handle_t devfs_get_first_child (devfs_handle_t de)
-{
- return NULL;
-}
-static inline devfs_handle_t devfs_get_next_sibling (devfs_handle_t de)
-{
- return NULL;
-}
-static inline const char *devfs_get_name (devfs_handle_t de,
- unsigned int *namelen)
-{
- return NULL;
-}
static inline int devfs_only (void)
{
return 0;
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h
index a636043ab8a3..31096307c124 100644
--- a/include/linux/efs_fs.h
+++ b/include/linux/efs_fs.h
@@ -49,6 +49,8 @@ static inline struct efs_sb_info *SUPER_INFO(struct super_block *sb)
return sb->s_fs_info;
}
+struct statfs;
+
extern struct inode_operations efs_dir_inode_operations;
extern struct file_operations efs_dir_operations;
extern struct address_space_operations efs_symlink_aops;
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 634459be7d64..f909a967778e 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -20,6 +20,9 @@
#include <linux/ext3_fs_i.h>
#include <linux/ext3_fs_sb.h>
+
+struct statfs;
+
/*
* The second extended filesystem constants/structures
*/
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 188da2f94589..128e310b9f5d 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -97,6 +97,7 @@
#define FB_ACCEL_SIS_GLAMOUR 36 /* SiS 300/630/540 */
#define FB_ACCEL_3DLABS_PERMEDIA3 37 /* 3Dlabs Permedia 3 */
#define FB_ACCEL_ATI_RADEON 38 /* ATI Radeon family */
+#define FB_ACCEL_I810 39 /* Intel 810/815 */
#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */
#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */
@@ -424,7 +425,6 @@ struct fb_info {
#define fb_readb __raw_readb
#define fb_readw __raw_readw
#define fb_readl __raw_readl
-#define fb_readq __raw_readq
#define fb_writeb __raw_writeb
#define fb_writew __raw_writew
#define fb_writel __raw_writel
@@ -436,9 +436,11 @@ struct fb_info {
#define fb_readb(addr) (*(volatile u8 *) (addr))
#define fb_readw(addr) (*(volatile u16 *) (addr))
#define fb_readl(addr) (*(volatile u32 *) (addr))
+#define fb_readq(addr) (*(volatile u64 *) (addr))
#define fb_writeb(b,addr) (*(volatile u8 *) (addr) = (b))
#define fb_writew(b,addr) (*(volatile u16 *) (addr) = (b))
#define fb_writel(b,addr) (*(volatile u32 *) (addr) = (b))
+#define fb_writeq(b,addr) (*(volatile u64 *) (addr) = (b))
#define fb_memset memset
#endif
@@ -458,9 +460,9 @@ extern void cfb_imageblit(struct fb_info *info, struct fb_image *image);
/* drivers/video/fbmem.c */
extern int register_framebuffer(struct fb_info *fb_info);
extern int unregister_framebuffer(struct fb_info *fb_info);
-
-extern int num_registered_fb;
+extern int fb_show_logo(struct fb_info *fb_info);
extern struct fb_info *registered_fb[FB_MAX];
+extern int num_registered_fb;
/* drivers/video/fbmon.c */
extern int fbmon_valid_timings(u_int pixclock, u_int htotal, u_int vtotal,
diff --git a/include/linux/font.h b/include/linux/font.h
new file mode 100644
index 000000000000..16564d51d28e
--- /dev/null
+++ b/include/linux/font.h
@@ -0,0 +1,45 @@
+/*
+ * font.h -- `Soft' font definitions
+ *
+ * Created 1995 by Geert Uytterhoeven
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file COPYING in the main directory of this archive
+ * for more details.
+ */
+
+#ifndef _VIDEO_CONSOLE_FONT_H
+#define _VIDEO_CONSOLE_FONT_H
+
+#include <video/font.h> /* struct font_desc */
+
+#define VGA8x8_IDX 0
+#define VGA8x16_IDX 1
+#define PEARL8x8_IDX 2
+#define VGA6x11_IDX 3
+#define SUN8x16_IDX 4
+#define SUN12x22_IDX 5
+#define ACORN8x8_IDX 6
+#define MINI4x6_IDX 7
+
+extern struct font_desc font_vga_8x8,
+ font_vga_8x16,
+ font_pearl_8x8,
+ font_vga_6x11,
+ font_sun_8x16,
+ font_sun_12x22,
+ font_acorn_8x8,
+ font_mini_4x6;
+
+/* Find a font with a specific name */
+
+extern struct font_desc *find_font(char *name);
+
+/* Get the default font for a specific screen size */
+
+extern struct font_desc *get_default_font(int xres, int yres);
+
+/* Max. length for the name of a predefined font */
+#define MAX_FONT_NAME 32
+
+#endif /* _VIDEO_CONSOLE_FONT_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 3fa13b80747d..878f2d2e4a9f 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -11,7 +11,6 @@
#include <linux/limits.h>
#include <linux/wait.h>
#include <linux/types.h>
-#include <linux/vfs.h>
#include <linux/kdev_t.h>
#include <linux/ioctl.h>
#include <linux/list.h>
@@ -25,6 +24,7 @@ struct iovec;
struct nameidata;
struct pipe_inode_info;
struct poll_table_struct;
+struct statfs;
struct vm_area_struct;
struct vfsmount;
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h
index 928ae553ca37..5001ff39204d 100644
--- a/include/linux/moduleloader.h
+++ b/include/linux/moduleloader.h
@@ -15,20 +15,11 @@ unsigned long find_symbol_internal(Elf_Shdr *sechdrs,
/* These must be implemented by the specific architecture */
-/* Total size to allocate for the non-releasable code; return len or
- -error. mod->core_size is the current generic tally. */
-long module_core_size(const Elf_Ehdr *hdr,
- const Elf_Shdr *sechdrs,
- const char *secstrings,
- struct module *mod);
-
-/* Total size of (if any) sections to be freed after init. Return 0
- for none, len, or -error. mod->init_size is the current generic
- tally. */
-long module_init_size(const Elf_Ehdr *hdr,
- const Elf_Shdr *sechdrs,
- const char *secstrings,
- struct module *mod);
+/* Adjust arch-specific sections. Return 0 on success. */
+int module_frob_arch_sections(const Elf_Ehdr *hdr,
+ const Elf_Shdr *sechdrs,
+ const char *secstrings,
+ struct module *mod);
/* Allocator used for allocating struct module, core sections and init
sections. Returns NULL on failure. */
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h
index 1cb5e7d2b3d7..2945cb406b64 100644
--- a/include/linux/msdos_fs.h
+++ b/include/linux/msdos_fs.h
@@ -8,6 +8,9 @@
#include <linux/string.h>
#include <asm/byteorder.h>
+struct statfs;
+
+
#define SECTOR_SIZE 512 /* sector size (bytes) */
#define SECTOR_BITS 9 /* log2(SECTOR_SIZE) */
#define MSDOS_DPB (MSDOS_DPS) /* dir entries per block */
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h
index b00141bc86e5..970474550bb9 100644
--- a/include/linux/nfsd/xdr.h
+++ b/include/linux/nfsd/xdr.h
@@ -8,6 +8,7 @@
#define LINUX_NFSD_H
#include <linux/fs.h>
+#include <linux/vfs.h>
#include <linux/nfs.h>
struct nfsd_fhandle {
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 1befa5e1830b..f9945ae00d7a 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -263,6 +263,43 @@
/* Radeon NV-100 */
#define PCI_DEVICE_ID_ATI_RADEON_N1 0x5159
#define PCI_DEVICE_ID_ATI_RADEON_N2 0x515a
+/* Radeon R100 */
+#define PCI_DEVICE_ID_ATI_RADEON_QD 0x5144
+#define PCI_DEVICE_ID_ATI_RADEON_QE 0x5145
+#define PCI_DEVICE_ID_ATI_RADEON_QF 0x5146
+#define PCI_DEVICE_ID_ATI_RADEON_QG 0x5147
+/* Radeon RV100 (VE) */
+#define PCI_DEVICE_ID_ATI_RADEON_QY 0x5159
+#define PCI_DEVICE_ID_ATI_RADEON_QZ 0x515a
+/* Radeon R200 (8500) */
+#define PCI_DEVICE_ID_ATI_RADEON_QL 0x514c
+#define PCI_DEVICE_ID_ATI_RADEON_QN 0x514e
+#define PCI_DEVICE_ID_ATI_RADEON_QO 0x514f
+#define PCI_DEVICE_ID_ATI_RADEON_Ql 0x516c
+#define PCI_DEVICE_ID_ATI_RADEON_BB 0x4242
+/* Radeon RV200 (7500) */
+#define PCI_DEVICE_ID_ATI_RADEON_QW 0x5157
+#define PCI_DEVICE_ID_ATI_RADEON_QX 0x5158
+/* Radeon RV250 (9000) */
+#define PCI_DEVICE_ID_ATI_RADEON_Id 0x4964
+#define PCI_DEVICE_ID_ATI_RADEON_Ie 0x4965
+#define PCI_DEVICE_ID_ATI_RADEON_If 0x4966
+#define PCI_DEVICE_ID_ATI_RADEON_Ig 0x4967
+/* Radeon R300 (9700) */
+#define PCI_DEVICE_ID_ATI_RADEON_ND 0x4e44
+#define PCI_DEVICE_ID_ATI_RADEON_NE 0x4e45
+#define PCI_DEVICE_ID_ATI_RADEON_NF 0x4e46
+#define PCI_DEVICE_ID_ATI_RADEON_NG 0x4e47
+/* Radeon M6 */
+#define PCI_DEVICE_ID_ATI_RADEON_LY 0x4c59
+#define PCI_DEVICE_ID_ATI_RADEON_LZ 0x4c5a
+/* Radeon M7 */
+#define PCI_DEVICE_ID_ATI_RADEON_LW 0x4c57
+#define PCI_DEVICE_ID_ATI_RADEON_LX 0x4c58
+#define PCI_DEVICE_ID_ATI_RADEON_Ld 0x4964
+#define PCI_DEVICE_ID_ATI_RADEON_Le 0x4965
+#define PCI_DEVICE_ID_ATI_RADEON_Lf 0x4966
+#define PCI_DEVICE_ID_ATI_RADEON_Lg 0x4967
/* Radeon */
#define PCI_DEVICE_ID_ATI_RADEON_RA 0x5144
#define PCI_DEVICE_ID_ATI_RADEON_RB 0x5145
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 02bf7c53a6d4..e5b1e2187156 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -37,6 +37,7 @@
#include <linux/errno.h>
#include <linux/types.h>
+#include <linux/spinlock.h>
#define __DQUOT_VERSION__ "dquot_6.5.1"
#define __DQUOT_NUM_VERSION__ 6*10000+5*100+1
@@ -44,6 +45,9 @@
typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */
typedef __u64 qsize_t; /* Type in which we store sizes */
+extern spinlock_t dq_list_lock;
+extern spinlock_t dq_data_lock;
+
/* Size of blocks in which are counted size limits */
#define QUOTABLOCK_BITS 10
#define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS)
@@ -155,7 +159,7 @@ struct quota_format_type;
struct mem_dqinfo {
struct quota_format_type *dqi_format;
- int dqi_flags;
+ unsigned long dqi_flags;
unsigned int dqi_bgrace;
unsigned int dqi_igrace;
union {
@@ -165,18 +169,19 @@ struct mem_dqinfo {
};
#define DQF_MASK 0xffff /* Mask for format specific flags */
-#define DQF_INFO_DIRTY 0x10000 /* Is info dirty? */
-#define DQF_ANY_DQUOT_DIRTY 0x20000 /* Is any dquot dirty? */
+#define DQF_INFO_DIRTY_B 16
+#define DQF_ANY_DQUOT_DIRTY_B 17
+#define DQF_INFO_DIRTY (1 << DQF_INFO_DIRTY_B) /* Is info dirty? */
+#define DQF_ANY_DQUOT_DIRTY (1 << DQF_ANY_DQUOT_DIRTY B) /* Is any dquot dirty? */
extern inline void mark_info_dirty(struct mem_dqinfo *info)
{
- info->dqi_flags |= DQF_INFO_DIRTY;
+ set_bit(DQF_INFO_DIRTY_B, &info->dqi_flags);
}
-#define info_dirty(info) ((info)->dqi_flags & DQF_INFO_DIRTY)
-
-#define info_any_dirty(info) ((info)->dqi_flags & DQF_INFO_DIRTY ||\
- (info)->dqi_flags & DQF_ANY_DQUOT_DIRTY)
+#define info_dirty(info) test_bit(DQF_INFO_DIRTY_B, &(info)->dqi_flags)
+#define info_any_dquot_dirty(info) test_bit(DQF_ANY_DQUOT_DIRTY_B, &(info)->dqi_flags)
+#define info_any_dirty(info) (info_dirty(info) || info_any_dquot_dirty(info))
#define sb_dqopt(sb) (&(sb)->s_dquot)
@@ -195,30 +200,29 @@ extern struct dqstats dqstats;
#define NR_DQHASH 43 /* Just an arbitrary number */
-#define DQ_LOCKED 0x01 /* dquot under IO */
-#define DQ_MOD 0x02 /* dquot modified since read */
-#define DQ_BLKS 0x10 /* uid/gid has been warned about blk limit */
-#define DQ_INODES 0x20 /* uid/gid has been warned about inode limit */
-#define DQ_FAKE 0x40 /* no limits only usage */
-#define DQ_INVAL 0x80 /* dquot is going to be invalidated */
+#define DQ_MOD_B 0
+#define DQ_BLKS_B 1
+#define DQ_INODES_B 2
+#define DQ_FAKE_B 3
+
+#define DQ_MOD (1 << DQ_MOD_B) /* dquot modified since read */
+#define DQ_BLKS (1 << DQ_BLKS_B) /* uid/gid has been warned about blk limit */
+#define DQ_INODES (1 << DQ_INODES_B) /* uid/gid has been warned about inode limit */
+#define DQ_FAKE (1 << DQ_FAKE_B) /* no limits only usage */
struct dquot {
struct list_head dq_hash; /* Hash list in memory */
struct list_head dq_inuse; /* List of all quotas */
struct list_head dq_free; /* Free list element */
- wait_queue_head_t dq_wait_lock; /* Pointer to waitqueue on dquot lock */
- wait_queue_head_t dq_wait_free; /* Pointer to waitqueue for quota to be unused */
- int dq_count; /* Use count */
- int dq_dup_ref; /* Number of duplicated refences */
+ struct semaphore dq_lock; /* dquot IO lock */
+ atomic_t dq_count; /* Use count */
/* fields after this point are cleared when invalidating */
struct super_block *dq_sb; /* superblock this applies to */
unsigned int dq_id; /* ID this applies to (uid, gid) */
loff_t dq_off; /* Offset of dquot on disk */
+ unsigned long dq_flags; /* See DQ_* */
short dq_type; /* Type of quota */
- short dq_flags; /* See DQ_* */
- unsigned long dq_referenced; /* Number of times this dquot was
- referenced during its lifetime */
struct mem_dqblk dq_dqb; /* Diskquota usage */
};
@@ -276,7 +280,7 @@ struct quota_format_type {
struct quota_info {
unsigned int flags; /* Flags for diskquotas on this device */
struct semaphore dqio_sem; /* lock device while I/O in progress */
- struct semaphore dqoff_sem; /* serialize quota_off() and quota_on() on device */
+ struct rw_semaphore dqoff_sem; /* serialize quota_off() and quota_on() on device and ops using quota_info struct, pointers from inode to dquots */
struct file *files[MAXQUOTAS]; /* fp's to quotafiles */
struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */
struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */
@@ -284,26 +288,17 @@ struct quota_info {
/* Inline would be better but we need to dereference super_block which is not defined yet */
#define mark_dquot_dirty(dquot) do {\
- dquot->dq_flags |= DQ_MOD;\
- sb_dqopt(dquot->dq_sb)->info[dquot->dq_type].dqi_flags |= DQF_ANY_DQUOT_DIRTY;\
+ set_bit(DQF_ANY_DQUOT_DIRTY_B, &(sb_dqopt((dquot)->dq_sb)->info[(dquot)->dq_type].dqi_flags));\
+ set_bit(DQ_MOD_B, &(dquot)->dq_flags);\
} while (0)
-#define dquot_dirty(dquot) ((dquot)->dq_flags & DQ_MOD)
-
-static inline int is_enabled(struct quota_info *dqopt, int type)
-{
- switch (type) {
- case USRQUOTA:
- return dqopt->flags & DQUOT_USR_ENABLED;
- case GRPQUOTA:
- return dqopt->flags & DQUOT_GRP_ENABLED;
- }
- return 0;
-}
+#define dquot_dirty(dquot) test_bit(DQ_MOD_B, &(dquot)->dq_flags)
-#define sb_any_quota_enabled(sb) (is_enabled(sb_dqopt(sb), USRQUOTA) | is_enabled(sb_dqopt(sb), GRPQUOTA))
+#define sb_has_quota_enabled(sb, type) ((type)==USRQUOTA ? \
+ (sb_dqopt(sb)->flags & DQUOT_USR_ENABLED) : (sb_dqopt(sb)->flags & DQUOT_GRP_ENABLED))
-#define sb_has_quota_enabled(sb, type) (is_enabled(sb_dqopt(sb), type))
+#define sb_any_quota_enabled(sb) (sb_has_quota_enabled(sb, USRQUOTA) | \
+ sb_has_quota_enabled(sb, GRPQUOTA))
int register_quota_format(struct quota_format_type *fmt);
void unregister_quota_format(struct quota_format_type *fmt);
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 31b24e37c159..e1c502012025 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -46,36 +46,31 @@ static __inline__ void DQUOT_INIT(struct inode *inode)
{
if (!inode->i_sb)
BUG();
- lock_kernel();
if (sb_any_quota_enabled(inode->i_sb) && !IS_NOQUOTA(inode))
inode->i_sb->dq_op->initialize(inode, -1);
- unlock_kernel();
}
static __inline__ void DQUOT_DROP(struct inode *inode)
{
- lock_kernel();
if (IS_QUOTAINIT(inode)) {
if (!inode->i_sb)
BUG();
inode->i_sb->dq_op->drop(inode); /* Ops must be set when there's any quota... */
}
- unlock_kernel();
}
static __inline__ int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
{
- lock_kernel();
if (sb_any_quota_enabled(inode->i_sb)) {
/* Used space is updated in alloc_space() */
- if (inode->i_sb->dq_op->alloc_space(inode, nr, 1) == NO_QUOTA) {
- unlock_kernel();
+ if (inode->i_sb->dq_op->alloc_space(inode, nr, 1) == NO_QUOTA)
return 1;
- }
}
- else
+ else {
+ spin_lock(&dq_data_lock);
inode_add_bytes(inode, nr);
- unlock_kernel();
+ spin_unlock(&dq_data_lock);
+ }
return 0;
}
@@ -89,17 +84,16 @@ static __inline__ int DQUOT_PREALLOC_SPACE(struct inode *inode, qsize_t nr)
static __inline__ int DQUOT_ALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
{
- lock_kernel();
if (sb_any_quota_enabled(inode->i_sb)) {
/* Used space is updated in alloc_space() */
- if (inode->i_sb->dq_op->alloc_space(inode, nr, 0) == NO_QUOTA) {
- unlock_kernel();
+ if (inode->i_sb->dq_op->alloc_space(inode, nr, 0) == NO_QUOTA)
return 1;
- }
}
- else
+ else {
+ spin_lock(&dq_data_lock);
inode_add_bytes(inode, nr);
- unlock_kernel();
+ spin_unlock(&dq_data_lock);
+ }
return 0;
}
@@ -113,26 +107,23 @@ static __inline__ int DQUOT_ALLOC_SPACE(struct inode *inode, qsize_t nr)
static __inline__ int DQUOT_ALLOC_INODE(struct inode *inode)
{
- lock_kernel();
if (sb_any_quota_enabled(inode->i_sb)) {
DQUOT_INIT(inode);
- if (inode->i_sb->dq_op->alloc_inode(inode, 1) == NO_QUOTA) {
- unlock_kernel();
+ if (inode->i_sb->dq_op->alloc_inode(inode, 1) == NO_QUOTA)
return 1;
- }
}
- unlock_kernel();
return 0;
}
static __inline__ void DQUOT_FREE_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
{
- lock_kernel();
if (sb_any_quota_enabled(inode->i_sb))
inode->i_sb->dq_op->free_space(inode, nr);
- else
+ else {
+ spin_lock(&dq_data_lock);
inode_sub_bytes(inode, nr);
- unlock_kernel();
+ spin_unlock(&dq_data_lock);
+ }
}
static __inline__ void DQUOT_FREE_SPACE(struct inode *inode, qsize_t nr)
@@ -143,23 +134,17 @@ static __inline__ void DQUOT_FREE_SPACE(struct inode *inode, qsize_t nr)
static __inline__ void DQUOT_FREE_INODE(struct inode *inode)
{
- lock_kernel();
if (sb_any_quota_enabled(inode->i_sb))
inode->i_sb->dq_op->free_inode(inode, 1);
- unlock_kernel();
}
static __inline__ int DQUOT_TRANSFER(struct inode *inode, struct iattr *iattr)
{
- lock_kernel();
if (sb_any_quota_enabled(inode->i_sb) && !IS_NOQUOTA(inode)) {
DQUOT_INIT(inode);
- if (inode->i_sb->dq_op->transfer(inode, iattr) == NO_QUOTA) {
- unlock_kernel();
+ if (inode->i_sb->dq_op->transfer(inode, iattr) == NO_QUOTA)
return 1;
- }
}
- unlock_kernel();
return 0;
}
@@ -169,10 +154,8 @@ static __inline__ int DQUOT_OFF(struct super_block *sb)
{
int ret = -ENOSYS;
- lock_kernel();
if (sb->s_qcop && sb->s_qcop->quota_off)
ret = sb->s_qcop->quota_off(sb, -1);
- unlock_kernel();
return ret;
}
@@ -192,9 +175,7 @@ static __inline__ int DQUOT_OFF(struct super_block *sb)
#define DQUOT_TRANSFER(inode, iattr) (0)
extern __inline__ int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
{
- lock_kernel();
inode_add_bytes(inode, nr);
- unlock_kernel();
return 0;
}
@@ -207,9 +188,7 @@ extern __inline__ int DQUOT_PREALLOC_SPACE(struct inode *inode, qsize_t nr)
extern __inline__ int DQUOT_ALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
{
- lock_kernel();
inode_add_bytes(inode, nr);
- unlock_kernel();
return 0;
}
@@ -222,9 +201,7 @@ extern __inline__ int DQUOT_ALLOC_SPACE(struct inode *inode, qsize_t nr)
extern __inline__ void DQUOT_FREE_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
{
- lock_kernel();
inode_sub_bytes(inode, nr);
- unlock_kernel();
}
extern __inline__ void DQUOT_FREE_SPACE(struct inode *inode, qsize_t nr)