summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/adfs/dir_f.c2
-rw-r--r--fs/afs/vnode.c2
-rw-r--r--fs/befs/ChangeLog2
-rw-r--r--fs/befs/btree.c2
-rw-r--r--fs/befs/linuxvfs.c2
-rw-r--r--fs/bio.c4
-rw-r--r--fs/buffer.c4
-rw-r--r--fs/cifs/cifs_unicode.h2
-rw-r--r--fs/cifs/cifspdu.h2
-rw-r--r--fs/dcache.c7
-rw-r--r--fs/devfs/base.c6
-rw-r--r--fs/direct-io.c2
-rw-r--r--fs/eventpoll.c4
-rw-r--r--fs/ext2/acl.c8
-rw-r--r--fs/ext2/xattr.c19
-rw-r--r--fs/ext2/xattr.h12
-rw-r--r--fs/ext2/xattr_trusted.c10
-rw-r--r--fs/ext2/xattr_user.c48
-rw-r--r--fs/ext3/acl.c8
-rw-r--r--fs/ext3/dir.c20
-rw-r--r--fs/ext3/file.c60
-rw-r--r--fs/ext3/xattr.c19
-rw-r--r--fs/ext3/xattr.h14
-rw-r--r--fs/ext3/xattr_trusted.c10
-rw-r--r--fs/ext3/xattr_user.c48
-rw-r--r--fs/hpfs/dnode.c2
-rw-r--r--fs/inode.c16
-rw-r--r--fs/jbd/revoke.c2
-rw-r--r--fs/jffs2/compr_rtime.c2
-rw-r--r--fs/jfs/jfs_dmap.c2
-rw-r--r--fs/jfs/jfs_xattr.h6
-rw-r--r--fs/jfs/xattr.c7
-rw-r--r--fs/mpage.c2
-rw-r--r--fs/nfsd/export.c2
-rw-r--r--fs/nfsd/nfs4xdr.c2
-rw-r--r--fs/nfsd/nfsctl.c2
-rw-r--r--fs/ntfs/aops.c4
-rw-r--r--fs/ntfs/attrib.c2
-rw-r--r--fs/ntfs/layout.h2
-rw-r--r--fs/ntfs/mft.c2
-rw-r--r--fs/ntfs/namei.c2
-rw-r--r--fs/proc/array.c3
-rw-r--r--fs/proc/proc_misc.c4
-rw-r--r--fs/quota_v2.c2
-rw-r--r--fs/reiserfs/do_balan.c2
-rw-r--r--fs/reiserfs/journal.c10
-rw-r--r--fs/reiserfs/lbalance.c2
-rw-r--r--fs/reiserfs/stree.c2
-rw-r--r--fs/reiserfs/super.c2
-rw-r--r--fs/seq_file.c2
-rw-r--r--fs/udf/dir.c2
-rw-r--r--fs/xattr.c6
-rw-r--r--fs/xfs/linux/xfs_globals.c9
-rw-r--r--fs/xfs/linux/xfs_iops.c23
-rw-r--r--fs/xfs/linux/xfs_sysctl.c7
-rw-r--r--fs/xfs/linux/xfs_sysctl.h6
-rw-r--r--fs/xfs/pagebuf/page_buf.c105
-rw-r--r--fs/xfs/pagebuf/page_buf.h4
-rw-r--r--fs/xfs/support/debug.c4
-rw-r--r--fs/xfs/xfs_attr.h2
-rw-r--r--fs/xfs/xfs_attr_leaf.c2
-rw-r--r--fs/xfs/xfs_buf.h2
-rw-r--r--fs/xfs/xfs_buf_item.c2
-rw-r--r--fs/xfs/xfs_da_btree.c4
-rw-r--r--fs/xfs/xfs_dir_leaf.c2
-rw-r--r--fs/xfs/xfs_dquot.c4
-rw-r--r--fs/xfs/xfs_inode.c2
-rw-r--r--fs/xfs/xfs_log.h6
-rw-r--r--fs/xfs/xfs_mount.c2
-rw-r--r--fs/xfs/xfs_trans_dquot.c2
70 files changed, 316 insertions, 283 deletions
diff --git a/fs/adfs/dir_f.c b/fs/adfs/dir_f.c
index b1028793967f..cee4bb9552d9 100644
--- a/fs/adfs/dir_f.c
+++ b/fs/adfs/dir_f.c
@@ -259,7 +259,7 @@ adfs_obj2dir(struct adfs_direntry *de, struct object_info *obj)
/*
* get a directory entry. Note that the caller is responsible
- * for holding the relevent locks.
+ * for holding the relevant locks.
*/
int
__adfs_dir_get(struct adfs_dir *dir, int pos, struct object_info *obj)
diff --git a/fs/afs/vnode.c b/fs/afs/vnode.c
index ab2d7b241fc3..8fe1cc583413 100644
--- a/fs/afs/vnode.c
+++ b/fs/afs/vnode.c
@@ -272,7 +272,7 @@ int afs_vnode_fetch_data(afs_vnode_t *vnode, struct afs_rxfs_fetch_descriptor *d
/*****************************************************************************/
/*
* break any outstanding callback on a vnode
- * - only relevent to server that issued it
+ * - only relevant to server that issued it
*/
int afs_vnode_give_up_callback(afs_vnode_t *vnode)
{
diff --git a/fs/befs/ChangeLog b/fs/befs/ChangeLog
index 3ad7c308be08..ce8c787916be 100644
--- a/fs/befs/ChangeLog
+++ b/fs/befs/ChangeLog
@@ -117,7 +117,7 @@ Version 0.6 (2001-12-15)
* Rewrote datastream positon lookups.
(datastream.c) [WD]
-* Moved the TODO list to it's own file.
+* Moved the TODO list to its own file.
Version 0.50 (2001-11-13)
diff --git a/fs/befs/btree.c b/fs/befs/btree.c
index c5ed07677b69..b885cf1822e0 100644
--- a/fs/befs/btree.c
+++ b/fs/befs/btree.c
@@ -41,7 +41,7 @@
/* Befs B+tree structure:
*
* The first thing in the tree is the tree superblock. It tells you
- * all kinds of usefull things about the tree, like where the rootnode
+ * all kinds of useful things about the tree, like where the rootnode
* is located, and the size of the nodes (always 1024 with current version
* of BeOS).
*
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 67821952734b..0b5772d6fc94 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -541,7 +541,7 @@ befs_utf2nls(struct super_block *sb, const char *in,
wchar_t uni;
int unilen, utflen;
char *result;
- int maxlen = in_len; /* The utf8->nls conversion cant make more chars */
+ int maxlen = in_len; /* The utf8->nls conversion can't make more chars */
befs_debug(sb, "---> utf2nls()");
diff --git a/fs/bio.c b/fs/bio.c
index 27e36530aa0e..3002a6b05dd4 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -334,7 +334,7 @@ oom:
* @bdev: I/O target
*
* Return the approximate number of pages we can send to this target.
- * There's no guarentee that you will be able to fit this number of pages
+ * There's no guarantee that you will be able to fit this number of pages
* into a bio, it does not account for dynamic restrictions that vary
* on offset.
*/
@@ -383,7 +383,7 @@ int bio_add_page(struct bio *bio, struct page *page, unsigned int len,
return 0;
/*
- * we might loose a segment or two here, but rather that than
+ * we might lose a segment or two here, but rather that than
* make this too complex.
*/
retry_segments:
diff --git a/fs/buffer.c b/fs/buffer.c
index db30b305962a..9258e2d6b6fe 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2495,7 +2495,7 @@ int block_write_full_page(struct page *page, get_block_t *get_block,
/*
* The page straddles i_size. It must be zeroed out on each and every
- * writepage invokation because it may be mmapped. "A file is mapped
+ * writepage invocation because it may be mmapped. "A file is mapped
* in multiples of the page size. For a file that is not a multiple of
* the page size, the remaining memory is zeroed when mapped, and
* writes to that region are not written out to the file."
@@ -2584,7 +2584,7 @@ int submit_bh(int rw, struct buffer_head * bh)
* BH_Lock state bit), any buffer that appears to be clean when doing a
* write request, and any buffer that appears to be up-to-date when doing
* read request. Further it marks as clean buffers that are processed for
- * writing (the buffer cache wont assume that they are actually clean until
+ * writing (the buffer cache won't assume that they are actually clean until
* the buffer gets unlocked).
*
* ll_rw_block sets b_end_io to simple completion handler that marks
diff --git a/fs/cifs/cifs_unicode.h b/fs/cifs/cifs_unicode.h
index c0b1ed049983..f4b7ed7ee4ff 100644
--- a/fs/cifs/cifs_unicode.h
+++ b/fs/cifs/cifs_unicode.h
@@ -99,7 +99,7 @@ UniStrcat(wchar_t * ucs1, const wchar_t * ucs2)
* UniStrchr: Find a character in a string
*
* Returns:
- * Address of first occurance of character in string
+ * Address of first occurrence of character in string
* or NULL if the character is not in the string
*/
static inline wchar_t *
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h
index d21e513937fc..10bc936bbe70 100644
--- a/fs/cifs/cifspdu.h
+++ b/fs/cifs/cifspdu.h
@@ -1245,7 +1245,7 @@ typedef struct smb_com_transaction2_get_dfs_refer_req {
__u8 Reserved3;
__u16 SubCommand; /* one setup word */
__u16 ByteCount;
- __u8 Pad[3]; /* Win2K has sent 0x0F01 (max resp length perhaps?) followed by one byte pad - doesnt seem to matter though */
+ __u8 Pad[3]; /* Win2K has sent 0x0F01 (max resp length perhaps?) followed by one byte pad - doesn't seem to matter though */
__u16 MaxReferralLevel;
char RequestFileName[1];
} TRANSACTION2_GET_DFS_REFER_REQ;
diff --git a/fs/dcache.c b/fs/dcache.c
index a93b44eb0d84..ef29520b5325 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1004,8 +1004,11 @@ struct dentry * d_lookup(struct dentry * parent, struct qstr * name)
*/
if (unlikely(move_count != dentry->d_move_count))
break;
- if (!d_unhashed(dentry))
- found = dget(dentry);
+ if (!d_unhashed(dentry)) {
+ atomic_inc(&dentry->d_count);
+ dentry->d_vfs_flags |= DCACHE_REFERENCED;
+ found = dentry;
+ }
spin_unlock(&dentry->d_lock);
break;
}
diff --git a/fs/devfs/base.c b/fs/devfs/base.c
index b82077b01ec1..b1f69f0afed1 100644
--- a/fs/devfs/base.c
+++ b/fs/devfs/base.c
@@ -1312,7 +1312,7 @@ static struct devfs_entry *get_devfs_entry_from_vfs_inode (struct inode *inode)
* free_dentry - Free the dentry for a device entry and invalidate inode.
* @de: The entry.
*
- * This must only be called after the entry has been unhooked from it's
+ * This must only be called after the entry has been unhooked from its
* parent directory.
*/
@@ -1584,7 +1584,7 @@ static int _devfs_unhook (struct devfs_entry *de)
/**
- * _devfs_unregister - Unregister a device entry from it's parent.
+ * _devfs_unregister - Unregister a device entry from its parent.
* @dir: The parent directory.
* @de: The entry to unregister.
*
@@ -2658,7 +2658,7 @@ static int devfs_rmdir (struct inode *dir, struct dentry *dentry)
else de->u.dir.no_more_additions = TRUE;
write_unlock (&de->u.dir.lock);
if (err) return err;
- /* Now unhook the directory from it's parent */
+ /* Now unhook the directory from its parent */
write_lock (&de->parent->u.dir.lock);
if ( !_devfs_unhook (de) ) err = -ENOENT;
write_unlock (&de->parent->u.dir.lock);
diff --git a/fs/direct-io.c b/fs/direct-io.c
index ea502932379a..d0d1677d18b8 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -42,7 +42,7 @@
/*
* This code generally works in units of "dio_blocks". A dio_block is
* somewhere between the hard sector size and the filesystem block size. it
- * is determined on a per-invokation basis. When talking to the filesystem
+ * is determined on a per-invocation basis. When talking to the filesystem
* we need to convert dio_blocks to fs_blocks by scaling the dio_block quantity
* down by dio->blkfactor. Similarly, fs-blocksize quantities are converted
* to bio_block quantities by shifting left by blkfactor.
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index dd886ac3488b..292cb491d30e 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -97,7 +97,7 @@
/*
* Remove the item from the list and perform its initialization.
- * This is usefull for us because we can test if the item is linked
+ * This is useful for us because we can test if the item is linked
* using "EP_IS_LINKED(p)".
*/
#define EP_LIST_DEL(p) do { list_del(p); INIT_LIST_HEAD(p); } while (0)
@@ -950,7 +950,7 @@ static void ep_ptable_queue_proc(struct file *file, wait_queue_head_t *whead, po
}
else
{
- /* We have to signal that an error occured */
+ /* We have to signal that an error occurred */
epi->nwait = -1;
}
}
diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c
index c694cfc798e8..9367f43f4acb 100644
--- a/fs/ext2/acl.c
+++ b/fs/ext2/acl.c
@@ -419,7 +419,7 @@ ext2_acl_chmod(struct inode *inode)
*/
static size_t
ext2_xattr_list_acl_access(char *list, struct inode *inode,
- const char *name, int name_len, int flags)
+ const char *name, int name_len)
{
const size_t size = sizeof(XATTR_NAME_ACL_ACCESS);
@@ -432,7 +432,7 @@ ext2_xattr_list_acl_access(char *list, struct inode *inode,
static size_t
ext2_xattr_list_acl_default(char *list, struct inode *inode,
- const char *name, int name_len, int flags)
+ const char *name, int name_len)
{
const size_t size = sizeof(XATTR_NAME_ACL_DEFAULT);
@@ -465,7 +465,7 @@ ext2_xattr_get_acl(struct inode *inode, int type, void *buffer, size_t size)
static int
ext2_xattr_get_acl_access(struct inode *inode, const char *name,
- void *buffer, size_t size, int flags)
+ void *buffer, size_t size)
{
if (strcmp(name, "") != 0)
return -EINVAL;
@@ -474,7 +474,7 @@ ext2_xattr_get_acl_access(struct inode *inode, const char *name,
static int
ext2_xattr_get_acl_default(struct inode *inode, const char *name,
- void *buffer, size_t size, int flags)
+ void *buffer, size_t size)
{
if (strcmp(name, "") != 0)
return -EINVAL;
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
index 72fd8b2c4b54..2383ec92098e 100644
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@ -199,7 +199,7 @@ ext2_xattr_handler(int name_index)
*/
ssize_t
ext2_getxattr(struct dentry *dentry, const char *name,
- void *buffer, size_t size, int flags)
+ void *buffer, size_t size)
{
struct ext2_xattr_handler *handler;
struct inode *inode = dentry->d_inode;
@@ -207,7 +207,7 @@ ext2_getxattr(struct dentry *dentry, const char *name,
handler = ext2_xattr_resolve_name(&name);
if (!handler)
return -EOPNOTSUPP;
- return handler->get(inode, name, buffer, size, flags);
+ return handler->get(inode, name, buffer, size);
}
/*
@@ -217,9 +217,9 @@ ext2_getxattr(struct dentry *dentry, const char *name,
* BKL held [before 2.5.x]
*/
ssize_t
-ext2_listxattr(struct dentry *dentry, char *buffer, size_t size, int flags)
+ext2_listxattr(struct dentry *dentry, char *buffer, size_t size)
{
- return ext2_xattr_list(dentry->d_inode, buffer, size, flags);
+ return ext2_xattr_list(dentry->d_inode, buffer, size);
}
/*
@@ -250,7 +250,7 @@ ext2_setxattr(struct dentry *dentry, const char *name,
* BKL held [before 2.5.x]
*/
int
-ext2_removexattr(struct dentry *dentry, const char *name, int flags)
+ext2_removexattr(struct dentry *dentry, const char *name)
{
struct ext2_xattr_handler *handler;
struct inode *inode = dentry->d_inode;
@@ -258,7 +258,7 @@ ext2_removexattr(struct dentry *dentry, const char *name, int flags)
handler = ext2_xattr_resolve_name(&name);
if (!handler)
return -EOPNOTSUPP;
- return handler->set(inode, name, NULL, 0, flags | XATTR_REPLACE);
+ return handler->set(inode, name, NULL, 0, XATTR_REPLACE);
}
/*
@@ -371,8 +371,7 @@ cleanup:
* used / required on success.
*/
int
-ext2_xattr_list(struct inode *inode, char *buffer, size_t buffer_size,
- int flags)
+ext2_xattr_list(struct inode *inode, char *buffer, size_t buffer_size)
{
struct buffer_head *bh = NULL;
struct ext2_xattr_entry *entry;
@@ -412,7 +411,7 @@ bad_block: ext2_error(inode->i_sb, "ext2_xattr_list",
handler = ext2_xattr_handler(entry->e_name_index);
if (handler)
size += handler->list(NULL, inode, entry->e_name,
- entry->e_name_len, flags);
+ entry->e_name_len);
}
if (ext2_xattr_cache_insert(bh))
@@ -435,7 +434,7 @@ bad_block: ext2_error(inode->i_sb, "ext2_xattr_list",
handler = ext2_xattr_handler(entry->e_name_index);
if (handler)
buf += handler->list(buf, inode, entry->e_name,
- entry->e_name_len, flags);
+ entry->e_name_len);
}
error = size;
diff --git a/fs/ext2/xattr.h b/fs/ext2/xattr.h
index 5221a575ad5d..1fdb6f970b66 100644
--- a/fs/ext2/xattr.h
+++ b/fs/ext2/xattr.h
@@ -58,9 +58,9 @@ struct ext2_xattr_entry {
struct ext2_xattr_handler {
char *prefix;
size_t (*list)(char *list, struct inode *inode, const char *name,
- int name_len, int flags);
+ int name_len);
int (*get)(struct inode *inode, const char *name, void *buffer,
- size_t size, int flags);
+ size_t size);
int (*set)(struct inode *inode, const char *name, const void *buffer,
size_t size, int flags);
};
@@ -69,12 +69,12 @@ extern int ext2_xattr_register(int, struct ext2_xattr_handler *);
extern void ext2_xattr_unregister(int, struct ext2_xattr_handler *);
extern int ext2_setxattr(struct dentry *, const char *, const void *, size_t, int);
-extern ssize_t ext2_getxattr(struct dentry *, const char *, void *, size_t, int);
-extern ssize_t ext2_listxattr(struct dentry *, char *, size_t, int);
-extern int ext2_removexattr(struct dentry *, const char *, int);
+extern ssize_t ext2_getxattr(struct dentry *, const char *, void *, size_t);
+extern ssize_t ext2_listxattr(struct dentry *, char *, size_t);
+extern int ext2_removexattr(struct dentry *, const char *);
extern int ext2_xattr_get(struct inode *, int, const char *, void *, size_t);
-extern int ext2_xattr_list(struct inode *, char *, size_t, int flags);
+extern int ext2_xattr_list(struct inode *, char *, size_t);
extern int ext2_xattr_set(struct inode *, int, const char *, const void *, size_t, int);
extern void ext2_xattr_delete_inode(struct inode *);
diff --git a/fs/ext2/xattr_trusted.c b/fs/ext2/xattr_trusted.c
index bfe2cc2e4f26..d9478aed723f 100644
--- a/fs/ext2/xattr_trusted.c
+++ b/fs/ext2/xattr_trusted.c
@@ -16,11 +16,11 @@
static size_t
ext2_xattr_trusted_list(char *list, struct inode *inode,
- const char *name, int name_len, int flags)
+ const char *name, int name_len)
{
const int prefix_len = sizeof(XATTR_TRUSTED_PREFIX)-1;
- if (!((flags & XATTR_KERNEL_CONTEXT) || capable(CAP_SYS_ADMIN)))
+ if (!capable(CAP_SYS_ADMIN))
return 0;
if (list) {
@@ -33,11 +33,11 @@ ext2_xattr_trusted_list(char *list, struct inode *inode,
static int
ext2_xattr_trusted_get(struct inode *inode, const char *name,
- void *buffer, size_t size, int flags)
+ void *buffer, size_t size)
{
if (strcmp(name, "") == 0)
return -EINVAL;
- if (!((flags & XATTR_KERNEL_CONTEXT) || capable(CAP_SYS_ADMIN)))
+ if (!capable(CAP_SYS_ADMIN))
return -EPERM;
return ext2_xattr_get(inode, EXT2_XATTR_INDEX_TRUSTED, name,
buffer, size);
@@ -49,7 +49,7 @@ ext2_xattr_trusted_set(struct inode *inode, const char *name,
{
if (strcmp(name, "") == 0)
return -EINVAL;
- if (!((flags & XATTR_KERNEL_CONTEXT) || capable(CAP_SYS_ADMIN)))
+ if (!capable(CAP_SYS_ADMIN))
return -EPERM;
return ext2_xattr_set(inode, EXT2_XATTR_INDEX_TRUSTED, name,
value, size, flags);
diff --git a/fs/ext2/xattr_user.c b/fs/ext2/xattr_user.c
index cdcc78e6a713..027beb89c7e0 100644
--- a/fs/ext2/xattr_user.c
+++ b/fs/ext2/xattr_user.c
@@ -19,12 +19,11 @@
static size_t
ext2_xattr_user_list(char *list, struct inode *inode,
- const char *name, int name_len, int flags)
+ const char *name, int name_len)
{
const int prefix_len = sizeof(XATTR_USER_PREFIX)-1;
- if (!(flags & XATTR_KERNEL_CONTEXT) &&
- !test_opt(inode->i_sb, XATTR_USER))
+ if (!test_opt(inode->i_sb, XATTR_USER))
return 0;
if (list) {
@@ -37,49 +36,46 @@ ext2_xattr_user_list(char *list, struct inode *inode,
static int
ext2_xattr_user_get(struct inode *inode, const char *name,
- void *buffer, size_t size, int flags)
+ void *buffer, size_t size)
{
+ int error;
+
if (strcmp(name, "") == 0)
return -EINVAL;
- if (!(flags & XATTR_KERNEL_CONTEXT)) {
- int error;
-
- if (!test_opt(inode->i_sb, XATTR_USER))
- return -EOPNOTSUPP;
+ if (!test_opt(inode->i_sb, XATTR_USER))
+ return -EOPNOTSUPP;
#ifdef CONFIG_EXT2_FS_POSIX_ACL
- error = ext2_permission_locked(inode, MAY_READ);
+ error = ext2_permission_locked(inode, MAY_READ);
#else
- error = permission(inode, MAY_READ);
+ error = permission(inode, MAY_READ);
#endif
- if (error)
- return error;
- }
- return ext2_xattr_get(inode, EXT2_XATTR_INDEX_USER, name,
- buffer, size);
+ if (error)
+ return error;
+
+ return ext2_xattr_get(inode, EXT2_XATTR_INDEX_USER, name, buffer, size);
}
static int
ext2_xattr_user_set(struct inode *inode, const char *name,
const void *value, size_t size, int flags)
{
+ int error;
+
if (strcmp(name, "") == 0)
return -EINVAL;
+ if (!test_opt(inode->i_sb, XATTR_USER))
+ return -EOPNOTSUPP;
if ( !S_ISREG(inode->i_mode) &&
(!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX))
return -EPERM;
- if (!(flags & XATTR_KERNEL_CONTEXT)) {
- int error;
-
- if (!test_opt(inode->i_sb, XATTR_USER))
- return -EOPNOTSUPP;
#ifdef CONFIG_EXT2_FS_POSIX_ACL
- error = ext2_permission_locked(inode, MAY_WRITE);
+ error = ext2_permission_locked(inode, MAY_WRITE);
#else
- error = permission(inode, MAY_WRITE);
+ error = permission(inode, MAY_WRITE);
#endif
- if (error)
- return error;
- }
+ if (error)
+ return error;
+
return ext2_xattr_set(inode, EXT2_XATTR_INDEX_USER, name,
value, size, flags);
}
diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c
index eeaef931bd11..fc6c53e936bb 100644
--- a/fs/ext3/acl.c
+++ b/fs/ext3/acl.c
@@ -431,7 +431,7 @@ ext3_acl_chmod(struct inode *inode)
*/
static size_t
ext3_xattr_list_acl_access(char *list, struct inode *inode,
- const char *name, int name_len, int flags)
+ const char *name, int name_len)
{
const size_t size = sizeof(XATTR_NAME_ACL_ACCESS);
@@ -444,7 +444,7 @@ ext3_xattr_list_acl_access(char *list, struct inode *inode,
static size_t
ext3_xattr_list_acl_default(char *list, struct inode *inode,
- const char *name, int name_len, int flags)
+ const char *name, int name_len)
{
const size_t size = sizeof(XATTR_NAME_ACL_DEFAULT);
@@ -477,7 +477,7 @@ ext3_xattr_get_acl(struct inode *inode, int type, void *buffer, size_t size)
static int
ext3_xattr_get_acl_access(struct inode *inode, const char *name,
- void *buffer, size_t size, int flags)
+ void *buffer, size_t size)
{
if (strcmp(name, "") != 0)
return -EINVAL;
@@ -486,7 +486,7 @@ ext3_xattr_get_acl_access(struct inode *inode, const char *name,
static int
ext3_xattr_get_acl_default(struct inode *inode, const char *name,
- void *buffer, size_t size, int flags)
+ void *buffer, size_t size)
{
if (strcmp(name, "") != 0)
return -EINVAL;
diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c
index 936ed5234988..e51368478f9c 100644
--- a/fs/ext3/dir.c
+++ b/fs/ext3/dir.c
@@ -33,12 +33,17 @@ static unsigned char ext3_filetype_table[] = {
static int ext3_readdir(struct file *, void *, filldir_t);
static int ext3_dx_readdir(struct file * filp,
void * dirent, filldir_t filldir);
+static int ext3_release_dir (struct inode * inode,
+ struct file * filp);
struct file_operations ext3_dir_operations = {
.read = generic_read_dir,
.readdir = ext3_readdir, /* we take BKL. needed?*/
.ioctl = ext3_ioctl, /* BKL held */
.fsync = ext3_sync_file, /* BKL held */
+#ifdef CONFIG_EXT3_INDEX
+ .release = ext3_release_dir,
+#endif
};
@@ -275,7 +280,11 @@ static void free_rb_tree_fname(struct rb_root *root)
*/
parent = n->rb_parent;
fname = rb_entry(n, struct fname, rb_hash);
- kfree(fname);
+ while (fname) {
+ struct fname * old = fname;
+ fname = fname->next;
+ kfree (old);
+ }
if (!parent)
root->rb_node = 0;
else if (parent->rb_left == n)
@@ -481,4 +490,13 @@ finished:
UPDATE_ATIME(inode);
return 0;
}
+
+static int ext3_release_dir (struct inode * inode, struct file * filp)
+{
+ if (is_dx(inode) && filp->private_data)
+ ext3_htree_free_dir_info(filp->private_data);
+
+ return 0;
+}
+
#endif
diff --git a/fs/ext3/file.c b/fs/ext3/file.c
index 3afb4e946097..7a329a70a6f2 100644
--- a/fs/ext3/file.c
+++ b/fs/ext3/file.c
@@ -55,29 +55,61 @@ static int ext3_open_file (struct inode * inode, struct file * filp)
return 0;
}
-/*
- * ext3_file_write().
- *
- * Most things are done in ext3_prepare_write() and ext3_commit_write().
- */
-
static ssize_t
ext3_file_write(struct kiocb *iocb, const char *buf, size_t count, loff_t pos)
{
struct file *file = iocb->ki_filp;
struct inode *inode = file->f_dentry->d_inode;
+ int ret, err;
+
+ ret = generic_file_aio_write(iocb, buf, count, pos);
/*
- * Nasty: if the file is subject to synchronous writes then we need
- * to force generic_osync_inode() to call ext3_write_inode().
- * We do that by marking the inode dirty. This adds much more
- * computational expense than we need, but we're going to sync
- * anyway.
+ * Skip flushing if there was an error, or if nothing was written.
+ */
+ if (ret <= 0)
+ return ret;
+
+ /*
+ * If the inode is IS_SYNC, or is O_SYNC and we are doing data
+ * journalling then we need to make sure that we force the transaction
+ * to disk to keep all metadata uptodate synchronously.
*/
- if (IS_SYNC(inode) || (file->f_flags & O_SYNC))
- mark_inode_dirty(inode);
+ if (file->f_flags & O_SYNC) {
+ /*
+ * If we are non-data-journaled, then the dirty data has
+ * already been flushed to backing store by generic_osync_inode,
+ * and the inode has been flushed too if there have been any
+ * modifications other than mere timestamp updates.
+ *
+ * Open question --- do we care about flushing timestamps too
+ * if the inode is IS_SYNC?
+ */
+ if (!ext3_should_journal_data(inode))
+ return ret;
+
+ goto force_commit;
+ }
- return generic_file_aio_write(iocb, buf, count, pos);
+ /*
+ * So we know that there has been no forced data flush. If the inode
+ * is marked IS_SYNC, we need to force one ourselves.
+ */
+ if (!IS_SYNC(inode))
+ return ret;
+
+ /*
+ * Open question #2 --- should we force data to disk here too? If we
+ * don't, the only impact is that data=writeback filesystems won't
+ * flush data to disk automatically on IS_SYNC, only metadata (but
+ * historically, that is what ext2 has done.)
+ */
+
+force_commit:
+ err = ext3_force_commit(inode->i_sb);
+ if (err)
+ return err;
+ return ret;
}
struct file_operations ext3_file_operations = {
diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c
index 0ab7a4ee0c62..d20beb60bb45 100644
--- a/fs/ext3/xattr.c
+++ b/fs/ext3/xattr.c
@@ -195,7 +195,7 @@ ext3_xattr_handler(int name_index)
*/
ssize_t
ext3_getxattr(struct dentry *dentry, const char *name,
- void *buffer, size_t size, int flags)
+ void *buffer, size_t size)
{
struct ext3_xattr_handler *handler;
struct inode *inode = dentry->d_inode;
@@ -203,7 +203,7 @@ ext3_getxattr(struct dentry *dentry, const char *name,
handler = ext3_xattr_resolve_name(&name);
if (!handler)
return -EOPNOTSUPP;
- return handler->get(inode, name, buffer, size, flags);
+ return handler->get(inode, name, buffer, size);
}
/*
@@ -212,9 +212,9 @@ ext3_getxattr(struct dentry *dentry, const char *name,
* dentry->d_inode->i_sem down
*/
ssize_t
-ext3_listxattr(struct dentry *dentry, char *buffer, size_t size, int flags)
+ext3_listxattr(struct dentry *dentry, char *buffer, size_t size)
{
- return ext3_xattr_list(dentry->d_inode, buffer, size, flags);
+ return ext3_xattr_list(dentry->d_inode, buffer, size);
}
/*
@@ -243,7 +243,7 @@ ext3_setxattr(struct dentry *dentry, const char *name,
* dentry->d_inode->i_sem down
*/
int
-ext3_removexattr(struct dentry *dentry, const char *name, int flags)
+ext3_removexattr(struct dentry *dentry, const char *name)
{
struct ext3_xattr_handler *handler;
struct inode *inode = dentry->d_inode;
@@ -251,7 +251,7 @@ ext3_removexattr(struct dentry *dentry, const char *name, int flags)
handler = ext3_xattr_resolve_name(&name);
if (!handler)
return -EOPNOTSUPP;
- return handler->set(inode, name, NULL, 0, flags | XATTR_REPLACE);
+ return handler->set(inode, name, NULL, 0, XATTR_REPLACE);
}
/*
@@ -364,8 +364,7 @@ cleanup:
* used / required on success.
*/
int
-ext3_xattr_list(struct inode *inode, char *buffer, size_t buffer_size,
- int flags)
+ext3_xattr_list(struct inode *inode, char *buffer, size_t buffer_size)
{
struct buffer_head *bh = NULL;
struct ext3_xattr_entry *entry;
@@ -405,7 +404,7 @@ bad_block: ext3_error(inode->i_sb, "ext3_xattr_list",
handler = ext3_xattr_handler(entry->e_name_index);
if (handler)
size += handler->list(NULL, inode, entry->e_name,
- entry->e_name_len, flags);
+ entry->e_name_len);
}
if (ext3_xattr_cache_insert(bh))
@@ -428,7 +427,7 @@ bad_block: ext3_error(inode->i_sb, "ext3_xattr_list",
handler = ext3_xattr_handler(entry->e_name_index);
if (handler)
buf += handler->list(buf, inode, entry->e_name,
- entry->e_name_len, flags);
+ entry->e_name_len);
}
error = size;
diff --git a/fs/ext3/xattr.h b/fs/ext3/xattr.h
index f0a50a5cacf3..ff3e10d8d701 100644
--- a/fs/ext3/xattr.h
+++ b/fs/ext3/xattr.h
@@ -57,9 +57,9 @@ struct ext3_xattr_entry {
struct ext3_xattr_handler {
char *prefix;
size_t (*list)(char *list, struct inode *inode, const char *name,
- int name_len, int flags);
+ int name_len);
int (*get)(struct inode *inode, const char *name, void *buffer,
- size_t size, int flags);
+ size_t size);
int (*set)(struct inode *inode, const char *name, const void *buffer,
size_t size, int flags);
};
@@ -68,12 +68,12 @@ extern int ext3_xattr_register(int, struct ext3_xattr_handler *);
extern void ext3_xattr_unregister(int, struct ext3_xattr_handler *);
extern int ext3_setxattr(struct dentry *, const char *, const void *, size_t, int);
-extern ssize_t ext3_getxattr(struct dentry *, const char *, void *, size_t, int);
-extern ssize_t ext3_listxattr(struct dentry *, char *, size_t, int);
-extern int ext3_removexattr(struct dentry *, const char *, int);
+extern ssize_t ext3_getxattr(struct dentry *, const char *, void *, size_t);
+extern ssize_t ext3_listxattr(struct dentry *, char *, size_t);
+extern int ext3_removexattr(struct dentry *, const char *);
extern int ext3_xattr_get(struct inode *, int, const char *, void *, size_t);
-extern int ext3_xattr_list(struct inode *, char *, size_t, int flags);
+extern int ext3_xattr_list(struct inode *, char *, size_t);
extern int ext3_xattr_set(struct inode *, int, const char *, const void *, size_t, int);
extern int ext3_xattr_set_handle(handle_t *, struct inode *, int, const char *, const void *, size_t, int);
@@ -97,7 +97,7 @@ ext3_xattr_get(struct inode *inode, int name_index, const char *name,
}
static inline int
-ext3_xattr_list(struct inode *inode, void *buffer, size_t size, int flags)
+ext3_xattr_list(struct inode *inode, void *buffer, size_t size)
{
return -EOPNOTSUPP;
}
diff --git a/fs/ext3/xattr_trusted.c b/fs/ext3/xattr_trusted.c
index fe8c7768dc8e..45b1549c4491 100644
--- a/fs/ext3/xattr_trusted.c
+++ b/fs/ext3/xattr_trusted.c
@@ -17,11 +17,11 @@
static size_t
ext3_xattr_trusted_list(char *list, struct inode *inode,
- const char *name, int name_len, int flags)
+ const char *name, int name_len)
{
const int prefix_len = sizeof(XATTR_TRUSTED_PREFIX)-1;
- if (!((flags & XATTR_KERNEL_CONTEXT) || capable(CAP_SYS_ADMIN)))
+ if (!capable(CAP_SYS_ADMIN))
return 0;
if (list) {
@@ -34,11 +34,11 @@ ext3_xattr_trusted_list(char *list, struct inode *inode,
static int
ext3_xattr_trusted_get(struct inode *inode, const char *name,
- void *buffer, size_t size, int flags)
+ void *buffer, size_t size)
{
if (strcmp(name, "") == 0)
return -EINVAL;
- if (!((flags & XATTR_KERNEL_CONTEXT) || capable(CAP_SYS_ADMIN)))
+ if (!capable(CAP_SYS_ADMIN))
return -EPERM;
return ext3_xattr_get(inode, EXT3_XATTR_INDEX_TRUSTED, name,
buffer, size);
@@ -50,7 +50,7 @@ ext3_xattr_trusted_set(struct inode *inode, const char *name,
{
if (strcmp(name, "") == 0)
return -EINVAL;
- if (!((flags & XATTR_KERNEL_CONTEXT) || capable(CAP_SYS_ADMIN)))
+ if (!capable(CAP_SYS_ADMIN))
return -EPERM;
return ext3_xattr_set(inode, EXT3_XATTR_INDEX_TRUSTED, name,
value, size, flags);
diff --git a/fs/ext3/xattr_user.c b/fs/ext3/xattr_user.c
index 0ba3ac0be5dd..b93a74ded763 100644
--- a/fs/ext3/xattr_user.c
+++ b/fs/ext3/xattr_user.c
@@ -21,12 +21,11 @@
static size_t
ext3_xattr_user_list(char *list, struct inode *inode,
- const char *name, int name_len, int flags)
+ const char *name, int name_len)
{
const int prefix_len = sizeof(XATTR_USER_PREFIX)-1;
- if (!(flags & XATTR_KERNEL_CONTEXT) &&
- !test_opt(inode->i_sb, XATTR_USER))
+ if (!test_opt(inode->i_sb, XATTR_USER))
return 0;
if (list) {
@@ -39,49 +38,46 @@ ext3_xattr_user_list(char *list, struct inode *inode,
static int
ext3_xattr_user_get(struct inode *inode, const char *name,
- void *buffer, size_t size, int flags)
+ void *buffer, size_t size)
{
+ int error;
+
if (strcmp(name, "") == 0)
return -EINVAL;
- if (!(flags & XATTR_KERNEL_CONTEXT)) {
- int error;
-
- if (!test_opt(inode->i_sb, XATTR_USER))
- return -EOPNOTSUPP;
+ if (!test_opt(inode->i_sb, XATTR_USER))
+ return -EOPNOTSUPP;
#ifdef CONFIG_EXT3_FS_POSIX_ACL
- error = ext3_permission_locked(inode, MAY_READ);
+ error = ext3_permission_locked(inode, MAY_READ);
#else
- error = permission(inode, MAY_READ);
+ error = permission(inode, MAY_READ);
#endif
- if (error)
- return error;
- }
- return ext3_xattr_get(inode, EXT3_XATTR_INDEX_USER, name,
- buffer, size);
+ if (error)
+ return error;
+
+ return ext3_xattr_get(inode, EXT3_XATTR_INDEX_USER, name, buffer, size);
}
static int
ext3_xattr_user_set(struct inode *inode, const char *name,
const void *value, size_t size, int flags)
{
+ int error;
+
if (strcmp(name, "") == 0)
return -EINVAL;
+ if (!test_opt(inode->i_sb, XATTR_USER))
+ return -EOPNOTSUPP;
if ( !S_ISREG(inode->i_mode) &&
(!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX))
return -EPERM;
- if (!(flags & XATTR_KERNEL_CONTEXT)) {
- int error;
-
- if (!test_opt(inode->i_sb, XATTR_USER))
- return -EOPNOTSUPP;
#ifdef CONFIG_EXT3_FS_POSIX_ACL
- error = ext3_permission_locked(inode, MAY_WRITE);
+ error = ext3_permission_locked(inode, MAY_WRITE);
#else
- error = permission(inode, MAY_WRITE);
+ error = permission(inode, MAY_WRITE);
#endif
- if (error)
- return error;
- }
+ if (error)
+ return error;
+
return ext3_xattr_set(inode, EXT3_XATTR_INDEX_USER, name,
value, size, flags);
}
diff --git a/fs/hpfs/dnode.c b/fs/hpfs/dnode.c
index eaac1e98d62b..fbe4b03e3ab4 100644
--- a/fs/hpfs/dnode.c
+++ b/fs/hpfs/dnode.c
@@ -188,7 +188,7 @@ struct hpfs_dirent *hpfs_add_de(struct super_block *s, struct dnode *d, unsigned
return de;
}
-/* Delete dirent and don't care about it's subtree */
+/* Delete dirent and don't care about its subtree */
void hpfs_delete_de(struct super_block *s, struct dnode *d, struct hpfs_dirent *de)
{
diff --git a/fs/inode.c b/fs/inode.c
index 4179e6a45075..4c609aebb191 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -81,6 +81,16 @@ static LIST_HEAD(anon_hash_chain); /* for inodes with NULL i_sb */
spinlock_t inode_lock = SPIN_LOCK_UNLOCKED;
/*
+ * iprune_sem provides exclusion between the kswapd or try_to_free_pages
+ * icache shrinking path, and the umount path. Without this exclusion,
+ * by the time prune_icache calls iput for the inode whose pages it has
+ * been invalidating, or by the time it calls clear_inode & destroy_inode
+ * from its final dispose_list, the struct super_block they refer to
+ * (for inode->i_sb->s_op) may already have been freed and reused.
+ */
+static DECLARE_MUTEX(iprune_sem);
+
+/*
* Statistics gathering..
*/
struct inodes_stat_t inodes_stat;
@@ -320,6 +330,7 @@ int invalidate_inodes(struct super_block * sb)
int busy;
LIST_HEAD(throw_away);
+ down(&iprune_sem);
spin_lock(&inode_lock);
busy = invalidate_list(&inode_in_use, sb, &throw_away);
busy |= invalidate_list(&inode_unused, sb, &throw_away);
@@ -328,6 +339,7 @@ int invalidate_inodes(struct super_block * sb)
spin_unlock(&inode_lock);
dispose_list(&throw_away);
+ up(&iprune_sem);
return busy;
}
@@ -395,6 +407,7 @@ static void prune_icache(int nr_to_scan)
int nr_scanned;
unsigned long reap = 0;
+ down(&iprune_sem);
spin_lock(&inode_lock);
for (nr_scanned = 0; nr_scanned < nr_to_scan; nr_scanned++) {
struct inode *inode;
@@ -429,7 +442,10 @@ static void prune_icache(int nr_to_scan)
}
inodes_stat.nr_unused -= nr_pruned;
spin_unlock(&inode_lock);
+
dispose_list(&freeable);
+ up(&iprune_sem);
+
if (current_is_kswapd)
mod_page_state(kswapd_inodesteal, reap);
else
diff --git a/fs/jbd/revoke.c b/fs/jbd/revoke.c
index 2b8500757fae..8aa1f8969832 100644
--- a/fs/jbd/revoke.c
+++ b/fs/jbd/revoke.c
@@ -577,7 +577,7 @@ int journal_set_revoke(journal_t *journal,
record = find_revoke_record(journal, blocknr);
if (record) {
- /* If we have multiple occurences, only record the
+ /* If we have multiple occurrences, only record the
* latest sequence number in the hashed record */
if (tid_gt(sequence, record->sequence))
record->sequence = sequence;
diff --git a/fs/jffs2/compr_rtime.c b/fs/jffs2/compr_rtime.c
index 64edfea3d531..83dfe53fe91b 100644
--- a/fs/jffs2/compr_rtime.c
+++ b/fs/jffs2/compr_rtime.c
@@ -13,7 +13,7 @@
* Very simple lz77-ish encoder.
*
* Theory of operation: Both encoder and decoder have a list of "last
- * occurances" for every possible source-value; after sending the
+ * occurrences" for every possible source-value; after sending the
* first source-byte, the second byte indicated the "run" length of
* matches
*
diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index 0d3a45444f15..52db99c54481 100644
--- a/fs/jfs/jfs_dmap.c
+++ b/fs/jfs/jfs_dmap.c
@@ -1112,7 +1112,7 @@ int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks)
* current allocation in place if the number of additional blocks
* can fit into a dmap, the last block of the current allocation
* is not the last block of the file system, and the start of the
- * inplace extension is not on an allocation group boundry.
+ * inplace extension is not on an allocation group boundary.
*/
if (addnblocks > BPERDMAP || extblkno >= bmp->db_mapsize ||
(extblkno & (bmp->db_agsize - 1)) == 0) {
diff --git a/fs/jfs/jfs_xattr.h b/fs/jfs/jfs_xattr.h
index 0e5ae78b0964..acc196e66c70 100644
--- a/fs/jfs/jfs_xattr.h
+++ b/fs/jfs/jfs_xattr.h
@@ -57,8 +57,8 @@ extern int __jfs_setxattr(struct inode *, const char *, const void *, size_t,
extern int jfs_setxattr(struct dentry *, const char *, const void *, size_t,
int);
extern ssize_t __jfs_getxattr(struct inode *, const char *, void *, size_t);
-extern ssize_t jfs_getxattr(struct dentry *, const char *, void *, size_t, int);
-extern ssize_t jfs_listxattr(struct dentry *, char *, size_t, int);
-extern int jfs_removexattr(struct dentry *, const char *, int);
+extern ssize_t jfs_getxattr(struct dentry *, const char *, void *, size_t);
+extern ssize_t jfs_listxattr(struct dentry *, char *, size_t);
+extern int jfs_removexattr(struct dentry *, const char *);
#endif /* H_JFS_XATTR */
diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c
index 19d3e5b4e8a5..a9c455de618b 100644
--- a/fs/jfs/xattr.c
+++ b/fs/jfs/xattr.c
@@ -962,13 +962,12 @@ ssize_t __jfs_getxattr(struct inode *inode, const char *name, void *data,
}
ssize_t jfs_getxattr(struct dentry *dentry, const char *name, void *data,
- size_t buf_size, int flags)
+ size_t buf_size)
{
return __jfs_getxattr(dentry->d_inode, name, data, buf_size);
}
-ssize_t jfs_listxattr(struct dentry * dentry, char *data, size_t buf_size,
- int flags)
+ssize_t jfs_listxattr(struct dentry * dentry, char *data, size_t buf_size)
{
struct inode *inode = dentry->d_inode;
char *buffer;
@@ -1014,7 +1013,7 @@ ssize_t jfs_listxattr(struct dentry * dentry, char *data, size_t buf_size,
return size;
}
-int jfs_removexattr(struct dentry *dentry, const char *name, int flags)
+int jfs_removexattr(struct dentry *dentry, const char *name)
{
return __jfs_setxattr(dentry->d_inode, name, 0, 0, XATTR_REPLACE);
}
diff --git a/fs/mpage.c b/fs/mpage.c
index 3460144c1894..45f79b8da045 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -598,7 +598,7 @@ out:
* If a page is already under I/O, generic_writepages() skips it, even
* if it's dirty. This is desirable behaviour for memory-cleaning writeback,
* but it is INCORRECT for data-integrity system calls such as fsync(). fsync()
- * and msync() need to guarentee that all the data which was dirty at the time
+ * and msync() need to guarantee that all the data which was dirty at the time
* the call was made get new I/O started against them. So if called_for_sync()
* is true, we must wait for existing IO to complete.
*
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 370b10e5fa01..03c01534a522 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -626,7 +626,7 @@ exp_export(struct nfsctl_export *nxp)
exp = exp_get_by_name(clp, nd.mnt, nd.dentry, NULL);
- /* must make sure there wont be an ex_fsid clash */
+ /* must make sure there won't be an ex_fsid clash */
if ((nxp->ex_flags & NFSEXP_FSID) &&
(fsid_key = exp_get_fsid_key(clp, nxp->ex_dev)) &&
!IS_ERR(fsid_key) &&
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 2271aed96c42..db77e132a71e 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1770,7 +1770,7 @@ nfsd4_encode_readlink(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_r
* XXX: By default, the ->readlink() VFS op will truncate symlinks
* if they would overflow the buffer. Is this kosher in NFSv4? If
* not, one easy fix is: if ->readlink() precisely fills the buffer,
- * assume that truncation occured, and return NFS4ERR_RESOURCE.
+ * assume that truncation occurred, and return NFS4ERR_RESOURCE.
*/
nfserr = nfsd_readlink(readlink->rl_rqstp, readlink->rl_fhp, page, &maxcount);
if (nfserr)
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 7cc70b08b27d..7eed97e690a3 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -77,7 +77,7 @@ static ssize_t (*write_op[])(struct file *, char *, size_t) = {
};
/* an argresp is stored in an allocated page and holds the
- * size of the argument or response, along with it's content
+ * size of the argument or response, along with its content
*/
struct argresp {
ssize_t size;
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c
index 8e80a2be182a..f69f5c599eb3 100644
--- a/fs/ntfs/aops.c
+++ b/fs/ntfs/aops.c
@@ -942,7 +942,7 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
* the below memcpy() already takes care of the mmap-at-end-of-file
* requirements. If the file is converted to a non-resident one, then
* the code path use is switched to the non-resident one where the
- * zeroing happens on each ntfs_writepage() invokation.
+ * zeroing happens on each ntfs_writepage() invocation.
*
* The above also applies nicely when i_size is decreased.
*
@@ -1087,7 +1087,7 @@ static int ntfs_prepare_nonresident_write(struct page *page,
if (block >= ablock) {
// TODO: block is above allocated_size, need to
- // allocate it. Best done in one go to accomodate not
+ // allocate it. Best done in one go to accommodate not
// only block but all above blocks up to and including:
// ((page->index << PAGE_CACHE_SHIFT) + to + blocksize
// - 1) >> blobksize_bits. Obviously will need to round
diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c
index 6e09b5eecb52..f2e945da1db9 100644
--- a/fs/ntfs/attrib.c
+++ b/fs/ntfs/attrib.c
@@ -830,7 +830,7 @@ run_list_element *decompress_mapping_pairs(const ntfs_volume *vol,
goto io_error;
for (deltaxcn = (s8)buf[b--]; b > b2; b--)
deltaxcn = (deltaxcn << 8) + buf[b];
- /* Change the current lcn to it's new value. */
+ /* Change the current lcn to its new value. */
lcn += deltaxcn;
#ifdef DEBUG
/*
diff --git a/fs/ntfs/layout.h b/fs/ntfs/layout.h
index e055b6df65de..bccc0e9e00d4 100644
--- a/fs/ntfs/layout.h
+++ b/fs/ntfs/layout.h
@@ -152,7 +152,7 @@ typedef enum {
* been written to disk. The values 0 and -1 (ie. 0xffff) are not used. All
* last u16's of each sector have to be equal to the usn (during reading) or
* are set to it (during writing). If they are not, an incomplete multi sector
- * transfer has occured when the data was written.
+ * transfer has occurred when the data was written.
* The maximum size for the update sequence array is fixed to:
* maximum size = usa_ofs + (usa_count * 2) = 510 bytes
* The 510 bytes comes from the fact that the last u16 in the array has to
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c
index 6ca688ebb928..95f3cb04112f 100644
--- a/fs/ntfs/mft.c
+++ b/fs/ntfs/mft.c
@@ -202,7 +202,7 @@ err_out:
* records/inodes present in the page before I/O can proceed. In that case we
* wouldn't need to bother with PG_locked and PG_uptodate as nobody will be
* accessing anything without owning the mrec_lock semaphore. But we do need
- * to use them because of the read_cache_page() invokation and the code becomes
+ * to use them because of the read_cache_page() invocation and the code becomes
* so much simpler this way that it is well worth it.
*
* The mft record is now ours and we return a pointer to it. You need to check
diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c
index 262075ef25fb..ada7835cee6d 100644
--- a/fs/ntfs/namei.c
+++ b/fs/ntfs/namei.c
@@ -233,7 +233,7 @@ handle_name:
m = NULL;
ctx = NULL;
- /* Check if a conversion error occured. */
+ /* Check if a conversion error occurred. */
if ((signed)nls_name.len < 0) {
err = (signed)nls_name.len;
goto err_out;
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 37fb278f96d7..186864bb7898 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -358,7 +358,8 @@ int proc_pid_stat(struct task_struct *task, char * buffer)
nice,
0UL /* removed */,
jiffies_to_clock_t(task->it_real_value),
- (unsigned long long) jiffies_64_to_clock_t(task->start_time),
+ (unsigned long long)
+ jiffies_64_to_clock_t(task->start_time - INITIAL_JIFFIES),
vsize,
mm ? mm->rss : 0, /* you might want to shift this left 3 */
task->rlim[RLIMIT_RSS].rlim_cur,
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index 92167d0ecb5f..ca32b7fab254 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -104,7 +104,7 @@ static int uptime_read_proc(char *page, char **start, off_t off,
unsigned long uptime_remainder;
int len;
- uptime = get_jiffies_64();
+ uptime = get_jiffies_64() - INITIAL_JIFFIES;
uptime_remainder = (unsigned long) do_div(uptime, HZ);
#if HZ!=100
@@ -320,7 +320,7 @@ static int kstat_read_proc(char *page, char **start, off_t off,
{
int i, len;
extern unsigned long total_forks;
- u64 jif = get_jiffies_64();
+ u64 jif = get_jiffies_64() - INITIAL_JIFFIES;
unsigned int sum = 0, user = 0, nice = 0, system = 0, idle = 0, iowait = 0;
for (i = 0 ; i < NR_CPUS; i++) {
diff --git a/fs/quota_v2.c b/fs/quota_v2.c
index b67fde8fd9a2..4f26a84efea3 100644
--- a/fs/quota_v2.c
+++ b/fs/quota_v2.c
@@ -415,7 +415,7 @@ static int v2_write_dquot(struct dquot *dquot)
if (!dquot->dq_off)
if ((ret = dq_insert_tree(dquot)) < 0) {
- printk(KERN_ERR "VFS: Error %Zd occured while creating quota.\n", ret);
+ printk(KERN_ERR "VFS: Error %Zd occurred while creating quota.\n", ret);
return ret;
}
filp = sb_dqopt(dquot->dq_sb)->files[type];
diff --git a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c
index aef5c01340ba..0e5c173f5634 100644
--- a/fs/reiserfs/do_balan.c
+++ b/fs/reiserfs/do_balan.c
@@ -1381,7 +1381,7 @@ static int check_before_balancing (struct tree_balance * tb)
if ( cur_tb ) {
reiserfs_panic (tb->tb_sb, "vs-12335: check_before_balancing: "
"suspect that schedule occurred based on cur_tb not being null at this point in code. "
- "do_balance cannot properly handle schedule occuring while it runs.");
+ "do_balance cannot properly handle schedule occurring while it runs.");
}
/* double check that buffers that we will modify are unlocked. (fix_nodes should already have
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 045247937245..d90636bfe358 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -1629,7 +1629,7 @@ struct buffer_head * reiserfs_breada (struct block_device *dev, int block, int b
/*
** read and replay the log
** on a clean unmount, the journal header's next unflushed pointer will be to an invalid
-** transaction. This tests that before finding all the transactions in the log, whic makes normal mount times fast.
+** transaction. This tests that before finding all the transactions in the log, which makes normal mount times fast.
**
** After a crash, this starts with the next unflushed transaction, and replays until it finds one too old, or invalid.
**
@@ -1913,7 +1913,7 @@ static int journal_init_dev( struct super_block *super,
result = -ENOMEM;
if( result != 0 )
printk( "sh-458: journal_init_dev: cannot init journal device\n '%s': %i",
- kdevname( to_kdev_t(jdev) ), result );
+ bdevname(journal->j_dev_bd), result );
else if (jdev != super->s_dev) {
set_blocksize(journal->j_dev_bd, super->s_blocksize);
@@ -1931,7 +1931,7 @@ static int journal_init_dev( struct super_block *super,
printk( "journal_init_dev: '%s' is not a block device", jdev_name );
result = -ENOTBLK;
} else if( jdev_inode -> i_bdev == NULL ) {
- printk( "journal_init_dev: bdev unintialized for '%s'", jdev_name );
+ printk( "journal_init_dev: bdev uninitialized for '%s'", jdev_name );
result = -ENOMEM;
} else {
/* ok */
@@ -1946,7 +1946,7 @@ static int journal_init_dev( struct super_block *super,
if( result != 0 ) {
release_journal_dev( super, journal );
}
- printk( "journal_init_dev: journal device: %s", kdevname(to_kdev_t(jdev)) );
+ printk( "journal_init_dev: journal device: %s", bdevname(journal->j_dev_bd));
return result;
}
@@ -2523,7 +2523,7 @@ int show_reiserfs_locks(void) {
** haven't hit disk yet. called from bitmap.c
**
** if it starts flushing things, it ors SCHEDULE_OCCURRED into repeat.
-** note, this is just if schedule has a chance of occuring. I need to
+** note, this is just if schedule has a chance of occurring. I need to
** change flush_commit_lists to have a repeat parameter too.
**
*/
diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c
index 12d163c85d2e..37c3b0f45196 100644
--- a/fs/reiserfs/lbalance.c
+++ b/fs/reiserfs/lbalance.c
@@ -1192,7 +1192,7 @@ void leaf_paste_entries (
}
- /* change item key if neccessary (when we paste before 0-th entry */
+ /* change item key if necessary (when we paste before 0-th entry */
if (!before)
{
set_le_ih_k_offset (ih, deh_offset(new_dehs));
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c
index 8d6dfeec1e06..da39bbabadca 100644
--- a/fs/reiserfs/stree.c
+++ b/fs/reiserfs/stree.c
@@ -1495,7 +1495,7 @@ int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th,
/* Repeat this loop until we either cut the item without needing
- to balance, or we fix_nodes without schedule occuring */
+ to balance, or we fix_nodes without schedule occurring */
while ( 1 ) {
/* Determine the balance mode, position of the first byte to
be cut, and size to be cut. In case of the indirect item
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 198bdfec0d90..b461b4c324f3 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -1356,7 +1356,7 @@ static int reiserfs_statfs (struct super_block * s, struct statfs * buf)
buf->f_bavail = buf->f_bfree;
buf->f_blocks = sb_block_count(rs) - sb_bmap_nr(rs) - 1;
buf->f_bsize = s->s_blocksize;
- /* changed to accomodate gcc folks.*/
+ /* changed to accommodate gcc folks.*/
buf->f_type = REISERFS_SUPER_MAGIC;
return 0;
}
diff --git a/fs/seq_file.c b/fs/seq_file.c
index ac5ab8beba9e..7d2b18a7bfe4 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -250,7 +250,7 @@ int seq_release(struct inode *inode, struct file *file)
* @s: string
* @esc: set of characters that need escaping
*
- * Puts string into buffer, replacing each occurence of character from
+ * Puts string into buffer, replacing each occurrence of character from
* @esc with usual octal escape. Returns 0 in case of success, -1 - in
* case of overflow.
*/
diff --git a/fs/udf/dir.c b/fs/udf/dir.c
index 78d6bc0acfef..748d63e1a2a9 100644
--- a/fs/udf/dir.c
+++ b/fs/udf/dir.c
@@ -19,7 +19,7 @@
*
* HISTORY
*
- * 10/05/98 dgb Split directory operations into it's own file
+ * 10/05/98 dgb Split directory operations into its own file
* Implemented directory reads via do_udf_readdir
* 10/06/98 Made directory operations work!
* 11/17/98 Rewrote directory to support ICBTAG_FLAG_AD_LONG
diff --git a/fs/xattr.c b/fs/xattr.c
index 6b6c7094a037..9463c877bcb2 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -160,7 +160,7 @@ getxattr(struct dentry *d, char *name, void *value, size_t size)
if (error)
goto out;
down(&d->d_inode->i_sem);
- error = d->d_inode->i_op->getxattr(d, kname, kvalue, size, 0);
+ error = d->d_inode->i_op->getxattr(d, kname, kvalue, size);
up(&d->d_inode->i_sem);
}
@@ -233,7 +233,7 @@ listxattr(struct dentry *d, char *list, size_t size)
if (error)
goto out;
down(&d->d_inode->i_sem);
- error = d->d_inode->i_op->listxattr(d, klist, size, 0);
+ error = d->d_inode->i_op->listxattr(d, klist, size);
up(&d->d_inode->i_sem);
}
@@ -308,7 +308,7 @@ removexattr(struct dentry *d, char *name)
if (error)
goto out;
down(&d->d_inode->i_sem);
- error = d->d_inode->i_op->removexattr(d, kname, 0);
+ error = d->d_inode->i_op->removexattr(d, kname);
up(&d->d_inode->i_sem);
}
out:
diff --git a/fs/xfs/linux/xfs_globals.c b/fs/xfs/linux/xfs_globals.c
index 7a8d9d753189..e645e61238ad 100644
--- a/fs/xfs/linux/xfs_globals.c
+++ b/fs/xfs/linux/xfs_globals.c
@@ -37,9 +37,18 @@
#include <xfs.h>
+/*
+ * System memory size - used to scale certain data structures in XFS.
+ */
unsigned long xfs_physmem;
/*
+ * Tunable XFS parameters. xfs_params is required even when CONFIG_SYSCTL=n,
+ * other XFS code uses these values.
+ */
+xfs_param_t xfs_params = { 0, 1, 0, 0, 0 };
+
+/*
* Used to serialize atomicIncWithWrap.
*/
spinlock_t Atomic_spin = SPIN_LOCK_UNLOCKED;
diff --git a/fs/xfs/linux/xfs_iops.c b/fs/xfs/linux/xfs_iops.c
index 82fc4ad60ec1..65ef55576483 100644
--- a/fs/xfs/linux/xfs_iops.c
+++ b/fs/xfs/linux/xfs_iops.c
@@ -523,7 +523,7 @@ linvfs_truncate(
*/
#define SYSTEM_NAME "system." /* VFS shared names/values */
-#define ROOT_NAME "xfsroot." /* XFS ondisk names/values */
+#define ROOT_NAME "trusted." /* root's own names/values */
#define USER_NAME "user." /* user's own names/values */
STATIC xattr_namespace_t xfs_namespace_array[] = {
{ .name= SYSTEM_NAME, .namelen= sizeof(SYSTEM_NAME)-1,.exists= NULL },
@@ -590,7 +590,7 @@ linvfs_setxattr(
error = -EINVAL;
if (flags & XATTR_CREATE)
return error;
- error = -ENOATTR;
+ error = -EOPNOTSUPP;
p += xfs_namespaces[SYSTEM_NAMES].namelen;
if (strcmp(p, POSIXACL_ACCESS) == 0) {
error = xfs_acl_vset(vp, (void *) data, size,
@@ -632,7 +632,7 @@ linvfs_setxattr(
VOP_ATTR_SET(vp, p, (void *) data, size, xflags, NULL, error);
return -error;
}
- return -ENOATTR;
+ return -EOPNOTSUPP;
}
STATIC ssize_t
@@ -640,8 +640,7 @@ linvfs_getxattr(
struct dentry *dentry,
const char *name,
void *data,
- size_t size,
- int flags)
+ size_t size)
{
ssize_t error;
int xflags = 0;
@@ -651,7 +650,7 @@ linvfs_getxattr(
if (strncmp(name, xfs_namespaces[SYSTEM_NAMES].name,
xfs_namespaces[SYSTEM_NAMES].namelen) == 0) {
- error = -ENOATTR;
+ error = -EOPNOTSUPP;
p += xfs_namespaces[SYSTEM_NAMES].namelen;
if (strcmp(p, POSIXACL_ACCESS) == 0) {
error = xfs_acl_vget(vp, data, size, _ACL_TYPE_ACCESS);
@@ -690,7 +689,7 @@ linvfs_getxattr(
error = -size;
return -error;
}
- return -ENOATTR;
+ return -EOPNOTSUPP;
}
@@ -698,8 +697,7 @@ STATIC ssize_t
linvfs_listxattr(
struct dentry *dentry,
char *data,
- size_t size,
- int flags)
+ size_t size)
{
ssize_t error;
int result = 0;
@@ -743,8 +741,7 @@ linvfs_listxattr(
STATIC int
linvfs_removexattr(
struct dentry *dentry,
- const char *name,
- int flags)
+ const char *name)
{
int error;
int xflags = 0;
@@ -754,7 +751,7 @@ linvfs_removexattr(
if (strncmp(name, xfs_namespaces[SYSTEM_NAMES].name,
xfs_namespaces[SYSTEM_NAMES].namelen) == 0) {
- error = -ENOATTR;
+ error = -EOPNOTSUPP;
p += xfs_namespaces[SYSTEM_NAMES].namelen;
if (strcmp(p, POSIXACL_ACCESS) == 0)
error = xfs_acl_vremove(vp, _ACL_TYPE_ACCESS);
@@ -782,7 +779,7 @@ linvfs_removexattr(
VOP_ATTR_REMOVE(vp, p, xflags, NULL, error);
return -error;
}
- return -ENOATTR;
+ return -EOPNOTSUPP;
}
diff --git a/fs/xfs/linux/xfs_sysctl.c b/fs/xfs/linux/xfs_sysctl.c
index 37d2b99c418a..321e549626cd 100644
--- a/fs/xfs/linux/xfs_sysctl.c
+++ b/fs/xfs/linux/xfs_sysctl.c
@@ -34,17 +34,10 @@
#include <linux/sysctl.h>
#include <linux/proc_fs.h>
-/*
- * Tunable XFS parameters
- */
-
-extern struct xfsstats xfsstats;
STATIC ulong xfs_min[XFS_PARAM] = { 0, 0, 0, 0, 0 };
STATIC ulong xfs_max[XFS_PARAM] = { 1, 1, 1, 1, 127 };
-xfs_param_t xfs_params = { 0, 1, 0, 0, 0 };
-
static struct ctl_table_header *xfs_table_header;
diff --git a/fs/xfs/linux/xfs_sysctl.h b/fs/xfs/linux/xfs_sysctl.h
index eeafff926067..476b41499f5f 100644
--- a/fs/xfs/linux/xfs_sysctl.h
+++ b/fs/xfs/linux/xfs_sysctl.h
@@ -64,8 +64,8 @@ extern xfs_param_t xfs_params;
extern void xfs_sysctl_register(void);
extern void xfs_sysctl_unregister(void);
#else
-static __inline void xfs_sysctl_register(void) { };
-static __inline void xfs_sysctl_unregister(void) { };
-#endif
+# define xfs_sysctl_register() do { } while (0)
+# define xfs_sysctl_unregister() do { } while (0)
+#endif /* CONFIG_SYSCTL */
#endif /* __XFS_SYSCTL_H__ */
diff --git a/fs/xfs/pagebuf/page_buf.c b/fs/xfs/pagebuf/page_buf.c
index 05e086ad25df..41cd10f73b84 100644
--- a/fs/xfs/pagebuf/page_buf.c
+++ b/fs/xfs/pagebuf/page_buf.c
@@ -57,6 +57,7 @@
#include <linux/sysctl.h>
#include <linux/proc_fs.h>
#include <linux/workqueue.h>
+#include <linux/suspend.h>
#include <support/debug.h>
#include <support/kmem.h>
@@ -155,37 +156,35 @@ struct pbstats pbstats;
* Pagebuf hashing
*/
-/* This structure must be a power of 2 long for the hash to work */
+#define NBITS 8
+#define NHASH (1<<NBITS)
+
typedef struct {
struct list_head pb_hash;
int pb_count;
spinlock_t pb_hash_lock;
} pb_hash_t;
-static pb_hash_t *pbhash;
-static unsigned int pb_hash_mask;
-static unsigned int pb_hash_shift;
-static unsigned int pb_order;
+STATIC pb_hash_t pbhash[NHASH];
#define pb_hash(pb) &pbhash[pb->pb_hash_index]
-/*
- * This hash is the same one as used on the Linux buffer cache,
- * see fs/buffer.c
- */
-
-#define _hashfn(dev,block) \
- ((((dev)<<(pb_hash_shift - 6)) ^ ((dev)<<(pb_hash_shift - 9))) ^ \
- (((block)<<(pb_hash_shift - 6)) ^ ((block) >> 13) ^ \
- ((block) << (pb_hash_shift - 12))))
-
-static inline int
+STATIC int
_bhash(
dev_t dev,
loff_t base)
{
+ int bit, hval;
+
base >>= 9;
-
- return (_hashfn(dev, base) & pb_hash_mask);
+ /*
+ * dev_t is 16 bits, loff_t is always 64 bits
+ */
+ base ^= dev;
+ for (bit = hval = 0; base != 0 && bit < sizeof(base) * 8; bit += NBITS) {
+ hval ^= (int)base & (NHASH-1);
+ base >>= NBITS;
+ }
+ return hval;
}
/*
@@ -703,8 +702,7 @@ found:
* are in memory. The buffer may have unallocated holes, if
* some, but not all, of the blocks are in memory. Even where
* pages are present in the buffer, not all of every page may be
- * valid. The file system may use pagebuf_segment to visit the
- * various segments of the buffer.
+ * valid.
*/
page_buf_t *
pagebuf_find( /* find buffer for block */
@@ -721,11 +719,10 @@ pagebuf_find( /* find buffer for block */
* pagebuf_get
*
* pagebuf_get assembles a buffer covering the specified range.
- * Some or all of the blocks in the range may be valid. The file
- * system may use pagebuf_segment to visit the various segments
- * of the buffer. Storage in memory for all portions of the
- * buffer will be allocated, although backing storage may not be.
- * If PBF_READ is set in flags, pagebuf_read
+ * Some or all of the blocks in the range may be valid. Storage
+ * in memory for all portions of the buffer will be allocated,
+ * although backing storage may not be. If PBF_READ is set in
+ * flags, pagebuf_iostart is called also.
*/
page_buf_t *
pagebuf_get( /* allocate a buffer */
@@ -1200,8 +1197,10 @@ pagebuf_iostart( /* start I/O on a buffer */
return status;
}
- pb->pb_flags &= ~(PBF_READ|PBF_WRITE|PBF_ASYNC|PBF_DELWRI|PBF_READ_AHEAD);
- pb->pb_flags |= flags & (PBF_READ|PBF_WRITE|PBF_ASYNC|PBF_SYNC|PBF_READ_AHEAD);
+ pb->pb_flags &=
+ ~(PBF_READ|PBF_WRITE|PBF_ASYNC|PBF_DELWRI|PBF_READ_AHEAD);
+ pb->pb_flags |= flags &
+ (PBF_READ|PBF_WRITE|PBF_ASYNC|PBF_SYNC|PBF_READ_AHEAD);
BUG_ON(pb->pb_bn == PAGE_BUF_DADDR_NULL);
@@ -1298,7 +1297,6 @@ int
pagebuf_iorequest( /* start real I/O */
page_buf_t *pb) /* buffer to convey to device */
{
- int status = 0;
int i, map_i, total_nr_pages, nr_pages;
struct bio *bio;
int offset = pb->pb_offset;
@@ -1313,7 +1311,7 @@ pagebuf_iorequest( /* start real I/O */
if (pb->pb_flags & PBF_DELWRI) {
pagebuf_delwri_queue(pb, 1);
- return status;
+ return 0;
}
/* Set the count to 1 initially, this will stop an I/O
@@ -1413,10 +1411,11 @@ next_chunk:
io_submitted:
if (atomic_dec_and_test(&pb->pb_io_remaining) == 1) {
+ pb->pb_locked = 0;
pagebuf_iodone(pb, 0);
}
- return status < 0 ? status : 0;
+ return 0;
}
/*
@@ -1459,7 +1458,7 @@ pagebuf_mapout_locked(
caddr_t
pagebuf_offset(
page_buf_t *pb,
- off_t offset)
+ size_t offset)
{
struct page *page;
@@ -1586,6 +1585,10 @@ pagebuf_daemon(
INIT_LIST_HEAD(&tmp);
do {
+ /* swsusp */
+ if (current->flags & PF_FREEZE)
+ refrigerator(PF_IOTHREAD);
+
if (pbd_active == 1) {
del_timer(&pb_daemon_timer);
pb_daemon_timer.expires = jiffies +
@@ -1864,39 +1867,7 @@ pagebuf_shaker(void)
int __init
pagebuf_init(void)
{
- int order, mempages, i;
- unsigned int nr_hash;
- extern int xfs_physmem;
-
- mempages = xfs_physmem >>= 16;
- mempages *= sizeof(pb_hash_t);
- for (order = 0; (1 << order) < mempages; order++)
- ;
-
- if (order > 3) order = 3; /* cap us at 2K buckets */
-
- do {
- unsigned long tmp;
-
- nr_hash = (PAGE_SIZE << order) / sizeof(pb_hash_t);
- nr_hash = 1 << (ffs(nr_hash) - 1);
- pb_hash_mask = (nr_hash - 1);
- tmp = nr_hash;
- pb_hash_shift = 0;
- while((tmp >>= 1UL) != 0UL)
- pb_hash_shift++;
-
- pbhash = (pb_hash_t *)
- __get_free_pages(GFP_KERNEL, order);
- pb_order = order;
- } while (pbhash == NULL && --order > 0);
- printk("pagebuf cache hash table entries: %d (order: %d, %ld bytes)\n",
- nr_hash, order, (PAGE_SIZE << order));
-
- for(i = 0; i < nr_hash; i++) {
- spin_lock_init(&pbhash[i].pb_hash_lock);
- INIT_LIST_HEAD(&pbhash[i].pb_hash);
- }
+ int i;
pagebuf_table_header = register_sysctl_table(pagebuf_root_table, 1);
@@ -1914,6 +1885,11 @@ pagebuf_init(void)
return -ENOMEM;
}
+ for (i = 0; i < NHASH; i++) {
+ spin_lock_init(&pbhash[i].pb_hash_lock);
+ INIT_LIST_HEAD(&pbhash[i].pb_hash);
+ }
+
#ifdef PAGEBUF_TRACE
pb_trace.buf = (pagebuf_trace_t *)kmalloc(
PB_TRACE_BUFSIZE * sizeof(pagebuf_trace_t), GFP_KERNEL);
@@ -1940,7 +1916,6 @@ pagebuf_terminate(void)
kmem_cache_destroy(pagebuf_cache);
kmem_shake_deregister(pagebuf_shaker);
- free_pages((unsigned long)pbhash, pb_order);
unregister_sysctl_table(pagebuf_table_header);
#ifdef CONFIG_PROC_FS
diff --git a/fs/xfs/pagebuf/page_buf.h b/fs/xfs/pagebuf/page_buf.h
index 52bde568a638..cba1771eba37 100644
--- a/fs/xfs/pagebuf/page_buf.h
+++ b/fs/xfs/pagebuf/page_buf.h
@@ -215,8 +215,8 @@ typedef struct page_buf_s {
unsigned short pb_error; /* error code on I/O */
unsigned short pb_page_count; /* size of page array */
unsigned short pb_offset; /* page offset in first page */
- unsigned short pb_hash_index; /* hash table index */
unsigned char pb_locked; /* page array is locked */
+ unsigned char pb_hash_index; /* hash table index */
struct page **pb_pages; /* array of page pointers */
struct page *pb_page_array[PB_PAGES]; /* inline pages */
#ifdef PAGEBUF_LOCK_TRACKING
@@ -329,7 +329,7 @@ extern int pagebuf_iorequest( /* start real I/O */
extern int pagebuf_iowait( /* wait for buffer I/O done */
page_buf_t *); /* buffer to wait on */
-extern caddr_t pagebuf_offset(page_buf_t *, off_t);
+extern caddr_t pagebuf_offset(page_buf_t *, size_t);
extern void pagebuf_iomove( /* move data in/out of pagebuf */
page_buf_t *, /* buffer to manipulate */
diff --git a/fs/xfs/support/debug.c b/fs/xfs/support/debug.c
index 524238f6f922..e8a60e5c7f19 100644
--- a/fs/xfs/support/debug.c
+++ b/fs/xfs/support/debug.c
@@ -85,8 +85,8 @@ void
cmn_err(register int level, char *fmt, ...)
{
char *fp = fmt;
+ ulong flags;
int len;
- unsigned long flags;
va_list ap;
level &= XFS_ERR_MASK;
@@ -110,8 +110,8 @@ cmn_err(register int level, char *fmt, ...)
void
icmn_err(register int level, char *fmt, va_list ap)
{
+ ulong flags;
int len;
- int flags;
level &= XFS_ERR_MASK;
if(level > XFS_MAX_ERR_LEVEL)
diff --git a/fs/xfs/xfs_attr.h b/fs/xfs/xfs_attr.h
index 0184e7b72cab..de61abd0dcb0 100644
--- a/fs/xfs/xfs_attr.h
+++ b/fs/xfs/xfs_attr.h
@@ -69,7 +69,7 @@
/*
* The maximum size (into the kernel or returned from the kernel) of an
* attribute value or the buffer used for an attr_list() call. Larger
- * sizes will result in an E2BIG return code.
+ * sizes will result in an ERANGE return code.
*/
#define ATTR_MAX_VALUELEN (64*1024) /* max length of a value */
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c
index 6dd7d0b23c4b..0867745661bf 100644
--- a/fs/xfs/xfs_attr_leaf.c
+++ b/fs/xfs/xfs_attr_leaf.c
@@ -1374,7 +1374,7 @@ xfs_attr_leaf_toosmall(xfs_da_state_t *state, int *action)
count * sizeof(xfs_attr_leaf_entry_t) +
INT_GET(leaf->hdr.usedbytes, ARCH_CONVERT);
if (bytes > (state->blocksize >> 1)) {
- *action = 0; /* blk over 50%, dont try to join */
+ *action = 0; /* blk over 50%, don't try to join */
return(0);
}
diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h
index 4c8755b42071..945c4d7570ad 100644
--- a/fs/xfs/xfs_buf.h
+++ b/fs/xfs/xfs_buf.h
@@ -153,7 +153,7 @@ typedef struct pb_target xfs_buftarg_t;
#define XFS_BUF_PTR(bp) (xfs_caddr_t)((bp)->pb_addr)
-extern inline xfs_caddr_t xfs_buf_offset(page_buf_t *bp, off_t offset)
+extern inline xfs_caddr_t xfs_buf_offset(page_buf_t *bp, size_t offset)
{
if (bp->pb_flags & PBF_MAPPED)
return XFS_BUF_PTR(bp) + offset;
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
index b5acad2dcb36..e89b2cbbed44 100644
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -924,7 +924,7 @@ xfs_buf_item_relse(
/*
- * Add the given log item with it's callback to the list of callbacks
+ * Add the given log item with its callback to the list of callbacks
* to be called when the buffer's I/O completes. If it is not set
* already, set the buffer's b_iodone() routine to be
* xfs_buf_iodone_callbacks() and link the log item into the list of
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c
index b42ce0313a5b..b8fc94e8be2b 100644
--- a/fs/xfs/xfs_da_btree.c
+++ b/fs/xfs/xfs_da_btree.c
@@ -830,8 +830,8 @@ xfs_da_node_toosmall(xfs_da_state_t *state, int *action)
node = (xfs_da_intnode_t *)info;
count = INT_GET(node->hdr.count, ARCH_CONVERT);
if (count > (state->node_ents >> 1)) {
- *action = 0; /* blk over 50%, dont try to join */
- return(0); /* blk over 50%, dont try to join */
+ *action = 0; /* blk over 50%, don't try to join */
+ return(0); /* blk over 50%, don't try to join */
}
/*
diff --git a/fs/xfs/xfs_dir_leaf.c b/fs/xfs/xfs_dir_leaf.c
index 8dfb1ab6ff2f..267565a82e89 100644
--- a/fs/xfs/xfs_dir_leaf.c
+++ b/fs/xfs/xfs_dir_leaf.c
@@ -1341,7 +1341,7 @@ xfs_dir_leaf_toosmall(xfs_da_state_t *state, int *action)
count * ((uint)sizeof(xfs_dir_leaf_name_t)-1) +
INT_GET(leaf->hdr.namebytes, ARCH_CONVERT);
if (bytes > (state->blocksize >> 1)) {
- *action = 0; /* blk over 50%, dont try to join */
+ *action = 0; /* blk over 50%, don't try to join */
return(0);
}
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index b27349c69538..2a8c831e5716 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -840,7 +840,7 @@ xfs_qm_dqlookup(
* Given the file system, inode OR id, and type (UDQUOT/GDQUOT), return a
* a locked dquot, doing an allocation (if requested) as needed.
* When both an inode and an id are given, the inode's id takes precedence.
- * That is, if the id changes while we dont hold the ilock inside this
+ * That is, if the id changes while we don't hold the ilock inside this
* function, the new dquot is returned, not necessarily the one requested
* in the id argument.
*/
@@ -1449,7 +1449,7 @@ xfs_qm_dqpurge(
xfs_dqtrace_entry(dqp, "DQPURGE ->DQFLUSH: DQDIRTY");
/* dqflush unlocks dqflock */
/*
- * Given that dqpurge is a very rare occurence, it is OK
+ * Given that dqpurge is a very rare occurrence, it is OK
* that we're holding the hashlist and mplist locks
* across the disk write. But, ... XXXsup
*
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 9c21a670f53d..eb54238024e8 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1001,7 +1001,7 @@ xfs_iread_extents(
}
/*
- * Allocate an inode on disk and return a copy of it's in-core version.
+ * Allocate an inode on disk and return a copy of its in-core version.
* The in-core inode is locked exclusively. Set mode, nlink, and rdev
* appropriately within the inode. The uid and gid for the inode are
* set according to the contents of the given cred structure.
diff --git a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h
index 02955f0c0b46..e6c1a8a78351 100644
--- a/fs/xfs/xfs_log.h
+++ b/fs/xfs/xfs_log.h
@@ -53,11 +53,11 @@
* endian issues in treating two 32 bit numbers as one 64 bit number
*/
static
-#ifdef __GNUC__
-# if !((__GNUC__ == 2) && (__GNUC_MINOR__ == 95))
+#if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 95)
+__attribute__((unused)) /* gcc 2.95 miscompiles this when inlined */
+#else
__inline__
#endif
-#endif
xfs_lsn_t _lsn_cmp(xfs_lsn_t lsn1, xfs_lsn_t lsn2, xfs_arch_t arch)
{
if (CYCLE_LSN(lsn1, arch) != CYCLE_LSN(lsn2, arch))
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 6fa2f67a7416..d6ad9949b3aa 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -1023,7 +1023,7 @@ xfs_mountfs(
/*
* If the xfs quota code isn't installed,
* we have to reset the quotachk'd bit.
- * If an error occured, qm_mount_quotas code
+ * If an error occurred, qm_mount_quotas code
* has already disabled quotas. So, just finish
* mounting, and get on with the boring life
* without disk quotas.
diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c
index 478b2686fc7b..19c83f9d4700 100644
--- a/fs/xfs/xfs_trans_dquot.c
+++ b/fs/xfs/xfs_trans_dquot.c
@@ -755,7 +755,7 @@ xfs_trans_reserve_quota_bydquots(
/*
* Lock the dquot and change the reservation if we can.
- * This doesnt change the actual usage, just the reservation.
+ * This doesn't change the actual usage, just the reservation.
* The inode sent in is locked.
*
* Returns 0 on success, EDQUOT or other errors otherwise