Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6
Browse files Browse the repository at this point in the history
* 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6: (87 commits)
  [XFS] Fix merge failure
  [XFS] The forward declarations for the xfs_ioctl() helpers and the
  [XFS] Update XFS documentation for noikeep/ikeep.
  [XFS] Update XFS Documentation for ikeep and ihashsize
  [XFS] Remove unused HAVE_SPLICE macro.
  [XFS] Remove CONFIG_XFS_SECURITY.
  [XFS] xfs_bmap_compute_maxlevels should be based on di_forkoff
  [XFS] Always use di_forkoff when checking for attr space.
  [XFS] Ensure the inode is joined in xfs_itruncate_finish
  [XFS] Remove periodic logging of in-core superblock counters.
  [XFS] fix logic error in xfs_alloc_ag_vextent_near()
  [XFS] Don't error out on good I/Os.
  [XFS] Catch log unmount failures.
  [XFS] Sanitise xfs_log_force error checking.
  [XFS] Check for errors when changing buffer pointers.
  [XFS] Don't allow silent errors in xfs_inactive().
  [XFS] Catch errors from xfs_imap().
  [XFS] xfs_bulkstat_one_dinode() never returns an error.
  [XFS] xfs_iflush_fork() never returns an error.
  [XFS] Catch unwritten extent conversion errors.
  ...
  • Loading branch information
Linus Torvalds committed Apr 18, 2008
2 parents 188da98 + 65e67f5 commit 253ba4e
Show file tree
Hide file tree
Showing 66 changed files with 1,907 additions and 2,304 deletions.
15 changes: 7 additions & 8 deletions Documentation/filesystems/xfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,15 @@ When mounting an XFS filesystem, the following options are accepted.
and also gets the setgid bit set if it is a directory itself.

ihashsize=value
Sets the number of hash buckets available for hashing the
in-memory inodes of the specified mount point. If a value
of zero is used, the value selected by the default algorithm
will be displayed in /proc/mounts.
In memory inode hashes have been removed, so this option has
no function as of August 2007. Option is deprecated.

ikeep/noikeep
When inode clusters are emptied of inodes, keep them around
on the disk (ikeep) - this is the traditional XFS behaviour
and is still the default for now. Using the noikeep option,
inode clusters are returned to the free space pool.
When ikeep is specified, XFS does not delete empty inode clusters
and keeps them around on disk. ikeep is the traditional XFS
behaviour. When noikeep is specified, empty inode clusters
are returned to the free space pool. The default is noikeep for
non-DMAPI mounts, while ikeep is the default when DMAPI is in use.

inode64
Indicates that XFS is allowed to create inodes at any location
Expand Down
12 changes: 0 additions & 12 deletions fs/xfs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,6 @@ config XFS_QUOTA
with or without the generic quota support enabled (CONFIG_QUOTA) -
they are completely independent subsystems.

config XFS_SECURITY
bool "XFS Security Label support"
depends on XFS_FS
help
Security labels support alternative access control models
implemented by security modules like SELinux. This option
enables an extended attribute namespace for inode security
labels in the XFS filesystem.

If you are not using a security module that requires using
extended attributes for inode security labels, say N.

config XFS_POSIX_ACL
bool "XFS POSIX ACL support"
depends on XFS_FS
Expand Down
6 changes: 3 additions & 3 deletions fs/xfs/linux-2.6/kmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ kmem_alloc(size_t size, unsigned int __nocast flags)
#ifdef DEBUG
if (unlikely(!(flags & KM_LARGE) && (size > PAGE_SIZE))) {
printk(KERN_WARNING "Large %s attempt, size=%ld\n",
__FUNCTION__, (long)size);
__func__, (long)size);
dump_stack();
}
#endif
Expand All @@ -52,7 +52,7 @@ kmem_alloc(size_t size, unsigned int __nocast flags)
if (!(++retries % 100))
printk(KERN_ERR "XFS: possible memory allocation "
"deadlock in %s (mode:0x%x)\n",
__FUNCTION__, lflags);
__func__, lflags);
congestion_wait(WRITE, HZ/50);
} while (1);
}
Expand Down Expand Up @@ -129,7 +129,7 @@ kmem_zone_alloc(kmem_zone_t *zone, unsigned int __nocast flags)
if (!(++retries % 100))
printk(KERN_ERR "XFS: possible memory allocation "
"deadlock in %s (mode:0x%x)\n",
__FUNCTION__, lflags);
__func__, lflags);
congestion_wait(WRITE, HZ/50);
} while (1);
}
Expand Down
12 changes: 8 additions & 4 deletions fs/xfs/linux-2.6/xfs_aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,12 @@ xfs_end_bio_unwritten(
size_t size = ioend->io_size;

if (likely(!ioend->io_error)) {
if (!XFS_FORCED_SHUTDOWN(ip->i_mount))
xfs_iomap_write_unwritten(ip, offset, size);
if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) {
int error;
error = xfs_iomap_write_unwritten(ip, offset, size);
if (error)
ioend->io_error = error;
}
xfs_setfilesize(ioend);
}
xfs_destroy_ioend(ioend);
Expand Down Expand Up @@ -1532,9 +1536,9 @@ xfs_vm_bmap(
struct xfs_inode *ip = XFS_I(inode);

xfs_itrace_entry(XFS_I(inode));
xfs_rwlock(ip, VRWLOCK_READ);
xfs_ilock(ip, XFS_IOLOCK_SHARED);
xfs_flush_pages(ip, (xfs_off_t)0, -1, 0, FI_REMAPF);
xfs_rwunlock(ip, VRWLOCK_READ);
xfs_iunlock(ip, XFS_IOLOCK_SHARED);
return generic_block_bmap(mapping, block, xfs_get_blocks);
}

Expand Down
8 changes: 4 additions & 4 deletions fs/xfs/linux-2.6/xfs_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ _xfs_buf_lookup_pages(
printk(KERN_ERR
"XFS: possible memory allocation "
"deadlock in %s (mode:0x%x)\n",
__FUNCTION__, gfp_mask);
__func__, gfp_mask);

XFS_STATS_INC(xb_page_retries);
xfsbufd_wakeup(0, gfp_mask);
Expand Down Expand Up @@ -598,7 +598,7 @@ xfs_buf_get_flags(
error = _xfs_buf_map_pages(bp, flags);
if (unlikely(error)) {
printk(KERN_WARNING "%s: failed to map pages\n",
__FUNCTION__);
__func__);
goto no_buffer;
}
}
Expand Down Expand Up @@ -778,7 +778,7 @@ xfs_buf_get_noaddr(
error = _xfs_buf_map_pages(bp, XBF_MAPPED);
if (unlikely(error)) {
printk(KERN_WARNING "%s: failed to map pages\n",
__FUNCTION__);
__func__);
goto fail_free_mem;
}

Expand Down Expand Up @@ -1060,7 +1060,7 @@ xfs_buf_iostart(
bp->b_flags &= ~(XBF_READ | XBF_WRITE | XBF_ASYNC);
bp->b_flags |= flags & (XBF_DELWRI | XBF_ASYNC);
xfs_buf_delwri_queue(bp, 1);
return status;
return 0;
}

bp->b_flags &= ~(XBF_READ | XBF_WRITE | XBF_ASYNC | XBF_DELWRI | \
Expand Down
8 changes: 6 additions & 2 deletions fs/xfs/linux-2.6/xfs_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,15 @@ static inline int XFS_bwrite(xfs_buf_t *bp)
return error;
}

static inline int xfs_bdwrite(void *mp, xfs_buf_t *bp)
/*
* No error can be returned from xfs_buf_iostart for delwri
* buffers as they are queued and no I/O is issued.
*/
static inline void xfs_bdwrite(void *mp, xfs_buf_t *bp)
{
bp->b_strat = xfs_bdstrat_cb;
bp->b_fspriv3 = mp;
return xfs_buf_iostart(bp, XBF_DELWRI | XBF_ASYNC);
(void)xfs_buf_iostart(bp, XBF_DELWRI | XBF_ASYNC);
}

#define XFS_bdstrat(bp) xfs_buf_iorequest(bp)
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/linux-2.6/xfs_cred.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ typedef struct cred {
extern struct cred *sys_cred;

/* this is a hack.. (assumes sys_cred is the only cred_t in the system) */
static __inline int capable_cred(cred_t *cr, int cid)
static inline int capable_cred(cred_t *cr, int cid)
{
return (cr == sys_cred) ? 1 : capable(cid);
}
Expand Down
14 changes: 6 additions & 8 deletions fs/xfs/linux-2.6/xfs_export.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "xfs_trans.h"
#include "xfs_sb.h"
#include "xfs_ag.h"
#include "xfs_dir2.h"
#include "xfs_dmapi.h"
#include "xfs_mount.h"
#include "xfs_export.h"
Expand All @@ -30,8 +31,6 @@
#include "xfs_inode.h"
#include "xfs_vfsops.h"

static struct dentry dotdot = { .d_name.name = "..", .d_name.len = 2, };

/*
* Note that we only accept fileids which are long enough rather than allow
* the parent generation number to default to zero. XFS considers zero a
Expand Down Expand Up @@ -66,7 +65,7 @@ xfs_fs_encode_fh(
int len;

/* Directories don't need their parent encoded, they have ".." */
if (S_ISDIR(inode->i_mode))
if (S_ISDIR(inode->i_mode) || !connectable)
fileid_type = FILEID_INO32_GEN;
else
fileid_type = FILEID_INO32_GEN_PARENT;
Expand Down Expand Up @@ -213,17 +212,16 @@ xfs_fs_get_parent(
struct dentry *child)
{
int error;
bhv_vnode_t *cvp;
struct xfs_inode *cip;
struct dentry *parent;

cvp = NULL;
error = xfs_lookup(XFS_I(child->d_inode), &dotdot, &cvp);
error = xfs_lookup(XFS_I(child->d_inode), &xfs_name_dotdot, &cip);
if (unlikely(error))
return ERR_PTR(-error);

parent = d_alloc_anon(vn_to_inode(cvp));
parent = d_alloc_anon(cip->i_vnode);
if (unlikely(!parent)) {
VN_RELE(cvp);
iput(cip->i_vnode);
return ERR_PTR(-ENOMEM);
}
return parent;
Expand Down
13 changes: 4 additions & 9 deletions fs/xfs/linux-2.6/xfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,16 +469,11 @@ xfs_file_open_exec(
struct inode *inode)
{
struct xfs_mount *mp = XFS_M(inode->i_sb);
struct xfs_inode *ip = XFS_I(inode);

if (unlikely(mp->m_flags & XFS_MOUNT_DMAPI)) {
if (DM_EVENT_ENABLED(XFS_I(inode), DM_EVENT_READ)) {
bhv_vnode_t *vp = vn_from_inode(inode);

return -XFS_SEND_DATA(mp, DM_EVENT_READ,
vp, 0, 0, 0, NULL);
}
}

if (unlikely(mp->m_flags & XFS_MOUNT_DMAPI) &&
DM_EVENT_ENABLED(ip, DM_EVENT_READ))
return -XFS_SEND_DATA(mp, DM_EVENT_READ, ip, 0, 0, 0, NULL);
return 0;
}
#endif /* HAVE_FOP_OPEN_EXEC */
Expand Down
36 changes: 11 additions & 25 deletions fs/xfs/linux-2.6/xfs_fs_subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,7 @@
*/
#include "xfs.h"
#include "xfs_vnodeops.h"

/*
* The following six includes are needed so that we can include
* xfs_inode.h. What a mess..
*/
#include "xfs_bmap_btree.h"
#include "xfs_inum.h"
#include "xfs_dir2.h"
#include "xfs_dir2_sf.h"
#include "xfs_attr_sf.h"
#include "xfs_dinode.h"

#include "xfs_inode.h"

int fs_noerr(void) { return 0; }
Expand All @@ -42,11 +31,10 @@ xfs_tosspages(
xfs_off_t last,
int fiopt)
{
bhv_vnode_t *vp = XFS_ITOV(ip);
struct inode *inode = vn_to_inode(vp);
struct address_space *mapping = ip->i_vnode->i_mapping;

if (VN_CACHED(vp))
truncate_inode_pages(inode->i_mapping, first);
if (mapping->nrpages)
truncate_inode_pages(mapping, first);
}

int
Expand All @@ -56,15 +44,14 @@ xfs_flushinval_pages(
xfs_off_t last,
int fiopt)
{
bhv_vnode_t *vp = XFS_ITOV(ip);
struct inode *inode = vn_to_inode(vp);
struct address_space *mapping = ip->i_vnode->i_mapping;
int ret = 0;

if (VN_CACHED(vp)) {
if (mapping->nrpages) {
xfs_iflags_clear(ip, XFS_ITRUNCATED);
ret = filemap_write_and_wait(inode->i_mapping);
ret = filemap_write_and_wait(mapping);
if (!ret)
truncate_inode_pages(inode->i_mapping, first);
truncate_inode_pages(mapping, first);
}
return ret;
}
Expand All @@ -77,17 +64,16 @@ xfs_flush_pages(
uint64_t flags,
int fiopt)
{
bhv_vnode_t *vp = XFS_ITOV(ip);
struct inode *inode = vn_to_inode(vp);
struct address_space *mapping = ip->i_vnode->i_mapping;
int ret = 0;
int ret2;

if (VN_DIRTY(vp)) {
if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) {
xfs_iflags_clear(ip, XFS_ITRUNCATED);
ret = filemap_fdatawrite(inode->i_mapping);
ret = filemap_fdatawrite(mapping);
if (flags & XFS_B_ASYNC)
return ret;
ret2 = filemap_fdatawait(inode->i_mapping);
ret2 = filemap_fdatawait(mapping);
if (!ret)
ret = ret2;
}
Expand Down
Loading

0 comments on commit 253ba4e

Please sign in to comment.