Skip to content

Commit

Permalink
Merge branch 'master' of git://oss.sgi.com/xfs/xfs into for-linus
Browse files Browse the repository at this point in the history
Conflicts:
	fs/xfs/linux-2.6/xfs_lrw.c
  • Loading branch information
Alex Elder committed Sep 16, 2009
2 parents 0cb583f + 9ef96da commit fdec29c
Show file tree
Hide file tree
Showing 39 changed files with 593 additions and 928 deletions.
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -5694,7 +5694,7 @@ F: include/xen/

XFS FILESYSTEM
P: Silicon Graphics Inc
M: Felix Blyakher <felixb@sgi.com>
M: Alex Elder <aelder@sgi.com>
M: [email protected]
L: [email protected]
W: http://oss.sgi.com/projects/xfs
Expand Down
1 change: 0 additions & 1 deletion fs/xfs/linux-2.6/xfs_aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ xfs_setfilesize(
if (ip->i_d.di_size < isize) {
ip->i_d.di_size = isize;
ip->i_update_core = 1;
ip->i_update_size = 1;
xfs_mark_inode_dirty_sync(ip);
}

Expand Down
19 changes: 14 additions & 5 deletions fs/xfs/linux-2.6/xfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,21 @@ xfs_file_release(
*/
STATIC int
xfs_file_fsync(
struct file *filp,
struct dentry *dentry,
int datasync)
struct file *file,
struct dentry *dentry,
int datasync)
{
xfs_iflags_clear(XFS_I(dentry->d_inode), XFS_ITRUNCATED);
return -xfs_fsync(XFS_I(dentry->d_inode));
struct inode *inode = dentry->d_inode;
struct xfs_inode *ip = XFS_I(inode);
int error;

/* capture size updates in I/O completion before writing the inode. */
error = filemap_fdatawait(inode->i_mapping);
if (error)
return error;

xfs_iflags_clear(ip, XFS_ITRUNCATED);
return -xfs_fsync(ip);
}

STATIC int
Expand Down
1 change: 0 additions & 1 deletion fs/xfs/linux-2.6/xfs_iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include "xfs_error.h"
#include "xfs_itable.h"
#include "xfs_rw.h"
#include "xfs_acl.h"
#include "xfs_attr.h"
#include "xfs_buf_item.h"
#include "xfs_utils.h"
Expand Down
8 changes: 5 additions & 3 deletions fs/xfs/linux-2.6/xfs_lrw.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,19 +812,21 @@ xfs_write(

/* Handle various SYNC-type writes */
if ((file->f_flags & O_SYNC) || IS_SYNC(inode)) {
loff_t end = pos + ret - 1;
int error2;

xfs_iunlock(xip, iolock);
if (need_i_mutex)
mutex_unlock(&inode->i_mutex);
error2 = filemap_write_and_wait_range(mapping, pos,
pos + ret - 1);

error2 = filemap_write_and_wait_range(mapping, pos, end);
if (!error)
error = error2;
if (need_i_mutex)
mutex_lock(&inode->i_mutex);
xfs_ilock(xip, iolock);
error2 = xfs_write_sync_logforce(mp, xip);

error2 = xfs_fsync(xip);
if (!error)
error = error2;
}
Expand Down
51 changes: 23 additions & 28 deletions fs/xfs/linux-2.6/xfs_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,9 @@

DEFINE_PER_CPU(struct xfsstats, xfsstats);

STATIC int
xfs_read_xfsstats(
char *buffer,
char **start,
off_t offset,
int count,
int *eof,
void *data)
static int xfs_stat_proc_show(struct seq_file *m, void *v)
{
int c, i, j, len, val;
int c, i, j, val;
__uint64_t xs_xstrat_bytes = 0;
__uint64_t xs_write_bytes = 0;
__uint64_t xs_read_bytes = 0;
Expand Down Expand Up @@ -60,18 +53,18 @@ xfs_read_xfsstats(
};

/* Loop over all stats groups */
for (i=j=len = 0; i < ARRAY_SIZE(xstats); i++) {
len += sprintf(buffer + len, "%s", xstats[i].desc);
for (i=j = 0; i < ARRAY_SIZE(xstats); i++) {
seq_printf(m, "%s", xstats[i].desc);
/* inner loop does each group */
while (j < xstats[i].endpoint) {
val = 0;
/* sum over all cpus */
for_each_possible_cpu(c)
val += *(((__u32*)&per_cpu(xfsstats, c) + j));
len += sprintf(buffer + len, " %u", val);
seq_printf(m, " %u", val);
j++;
}
buffer[len++] = '\n';
seq_putc(m, '\n');
}
/* extra precision counters */
for_each_possible_cpu(i) {
Expand All @@ -80,36 +73,38 @@ xfs_read_xfsstats(
xs_read_bytes += per_cpu(xfsstats, i).xs_read_bytes;
}

len += sprintf(buffer + len, "xpc %Lu %Lu %Lu\n",
seq_printf(m, "xpc %Lu %Lu %Lu\n",
xs_xstrat_bytes, xs_write_bytes, xs_read_bytes);
len += sprintf(buffer + len, "debug %u\n",
seq_printf(m, "debug %u\n",
#if defined(DEBUG)
1);
#else
0);
#endif
return 0;
}

if (offset >= len) {
*start = buffer;
*eof = 1;
return 0;
}
*start = buffer + offset;
if ((len -= offset) > count)
return count;
*eof = 1;

return len;
static int xfs_stat_proc_open(struct inode *inode, struct file *file)
{
return single_open(file, xfs_stat_proc_show, NULL);
}

static const struct file_operations xfs_stat_proc_fops = {
.owner = THIS_MODULE,
.open = xfs_stat_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};

int
xfs_init_procfs(void)
{
if (!proc_mkdir("fs/xfs", NULL))
goto out;

if (!create_proc_read_entry("fs/xfs/stat", 0, NULL,
xfs_read_xfsstats, NULL))
if (!proc_create("fs/xfs/stat", 0, NULL,
&xfs_stat_proc_fops))
goto out_remove_entry;
return 0;

Expand Down
24 changes: 14 additions & 10 deletions fs/xfs/linux-2.6/xfs_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,15 +579,19 @@ xfs_showargs(
else if (mp->m_qflags & XFS_UQUOTA_ACCT)
seq_puts(m, "," MNTOPT_UQUOTANOENF);

if (mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_OQUOTA_ENFD))
seq_puts(m, "," MNTOPT_PRJQUOTA);
else if (mp->m_qflags & XFS_PQUOTA_ACCT)
seq_puts(m, "," MNTOPT_PQUOTANOENF);

if (mp->m_qflags & (XFS_GQUOTA_ACCT|XFS_OQUOTA_ENFD))
seq_puts(m, "," MNTOPT_GRPQUOTA);
else if (mp->m_qflags & XFS_GQUOTA_ACCT)
seq_puts(m, "," MNTOPT_GQUOTANOENF);
/* Either project or group quotas can be active, not both */

if (mp->m_qflags & XFS_PQUOTA_ACCT) {
if (mp->m_qflags & XFS_OQUOTA_ENFD)
seq_puts(m, "," MNTOPT_PRJQUOTA);
else
seq_puts(m, "," MNTOPT_PQUOTANOENF);
} else if (mp->m_qflags & XFS_GQUOTA_ACCT) {
if (mp->m_qflags & XFS_OQUOTA_ENFD)
seq_puts(m, "," MNTOPT_GRPQUOTA);
else
seq_puts(m, "," MNTOPT_GQUOTANOENF);
}

if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT))
seq_puts(m, "," MNTOPT_NOQUOTA);
Expand Down Expand Up @@ -687,7 +691,7 @@ xfs_barrier_test(
return error;
}

void
STATIC void
xfs_mountfs_check_barriers(xfs_mount_t *mp)
{
int error;
Expand Down
15 changes: 0 additions & 15 deletions fs/xfs/linux-2.6/xfs_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,21 +749,6 @@ __xfs_inode_clear_reclaim_tag(
XFS_INO_TO_AGINO(mp, ip->i_ino), XFS_ICI_RECLAIM_TAG);
}

void
xfs_inode_clear_reclaim_tag(
xfs_inode_t *ip)
{
xfs_mount_t *mp = ip->i_mount;
xfs_perag_t *pag = xfs_get_perag(mp, ip->i_ino);

read_lock(&pag->pag_ici_lock);
spin_lock(&ip->i_flags_lock);
__xfs_inode_clear_reclaim_tag(mp, pag, ip);
spin_unlock(&ip->i_flags_lock);
read_unlock(&pag->pag_ici_lock);
xfs_put_perag(mp, pag);
}

STATIC int
xfs_reclaim_inode_now(
struct xfs_inode *ip,
Expand Down
1 change: 0 additions & 1 deletion fs/xfs/linux-2.6/xfs_sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ int xfs_reclaim_inodes(struct xfs_mount *mp, int mode);

void xfs_inode_set_reclaim_tag(struct xfs_inode *ip);
void __xfs_inode_set_reclaim_tag(struct xfs_perag *pag, struct xfs_inode *ip);
void xfs_inode_clear_reclaim_tag(struct xfs_inode *ip);
void __xfs_inode_clear_reclaim_tag(struct xfs_mount *mp, struct xfs_perag *pag,
struct xfs_inode *ip);

Expand Down
78 changes: 32 additions & 46 deletions fs/xfs/quota/xfs_qm_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,50 +48,34 @@

struct xqmstats xqmstats;

STATIC int
xfs_qm_read_xfsquota(
char *buffer,
char **start,
off_t offset,
int count,
int *eof,
void *data)
static int xqm_proc_show(struct seq_file *m, void *v)
{
int len;

/* maximum; incore; ratio free to inuse; freelist */
len = sprintf(buffer, "%d\t%d\t%d\t%u\n",
seq_printf(m, "%d\t%d\t%d\t%u\n",
ndquot,
xfs_Gqm? atomic_read(&xfs_Gqm->qm_totaldquots) : 0,
xfs_Gqm? xfs_Gqm->qm_dqfree_ratio : 0,
xfs_Gqm? xfs_Gqm->qm_dqfreelist.qh_nelems : 0);

if (offset >= len) {
*start = buffer;
*eof = 1;
return 0;
}
*start = buffer + offset;
if ((len -= offset) > count)
return count;
*eof = 1;

return len;
return 0;
}

STATIC int
xfs_qm_read_stats(
char *buffer,
char **start,
off_t offset,
int count,
int *eof,
void *data)
static int xqm_proc_open(struct inode *inode, struct file *file)
{
int len;
return single_open(file, xqm_proc_show, NULL);
}

static const struct file_operations xqm_proc_fops = {
.owner = THIS_MODULE,
.open = xqm_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};

static int xqmstat_proc_show(struct seq_file *m, void *v)
{
/* quota performance statistics */
len = sprintf(buffer, "qm %u %u %u %u %u %u %u %u\n",
seq_printf(m, "qm %u %u %u %u %u %u %u %u\n",
xqmstats.xs_qm_dqreclaims,
xqmstats.xs_qm_dqreclaim_misses,
xqmstats.xs_qm_dquot_dups,
Expand All @@ -100,25 +84,27 @@ xfs_qm_read_stats(
xqmstats.xs_qm_dqwants,
xqmstats.xs_qm_dqshake_reclaims,
xqmstats.xs_qm_dqinact_reclaims);
return 0;
}

if (offset >= len) {
*start = buffer;
*eof = 1;
return 0;
}
*start = buffer + offset;
if ((len -= offset) > count)
return count;
*eof = 1;

return len;
static int xqmstat_proc_open(struct inode *inode, struct file *file)
{
return single_open(file, xqmstat_proc_show, NULL);
}

static const struct file_operations xqmstat_proc_fops = {
.owner = THIS_MODULE,
.open = xqmstat_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};

void
xfs_qm_init_procfs(void)
{
create_proc_read_entry("fs/xfs/xqmstat", 0, NULL, xfs_qm_read_stats, NULL);
create_proc_read_entry("fs/xfs/xqm", 0, NULL, xfs_qm_read_xfsquota, NULL);
proc_create("fs/xfs/xqmstat", 0, NULL, &xqmstat_proc_fops);
proc_create("fs/xfs/xqm", 0, NULL, &xqm_proc_fops);
}

void
Expand Down
9 changes: 9 additions & 0 deletions fs/xfs/xfs_ag.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,15 @@ typedef struct xfs_perag
xfs_agino_t pagi_count; /* number of allocated inodes */
int pagb_count; /* pagb slots in use */
xfs_perag_busy_t *pagb_list; /* unstable blocks */

/*
* Inode allocation search lookup optimisation.
* If the pagino matches, the search for new inodes
* doesn't need to search the near ones again straight away
*/
xfs_agino_t pagl_pagino;
xfs_agino_t pagl_leftrec;
xfs_agino_t pagl_rightrec;
#ifdef __KERNEL__
spinlock_t pagb_lock; /* lock for pagb_list */

Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/xfs_bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3713,7 +3713,7 @@ xfs_bmap_local_to_extents(
* entry (null if none). Else, *lastxp will be set to the index
* of the found entry; *gotp will contain the entry.
*/
xfs_bmbt_rec_host_t * /* pointer to found extent entry */
STATIC xfs_bmbt_rec_host_t * /* pointer to found extent entry */
xfs_bmap_search_multi_extents(
xfs_ifork_t *ifp, /* inode fork pointer */
xfs_fileoff_t bno, /* block number searched for */
Expand Down
11 changes: 0 additions & 11 deletions fs/xfs/xfs_bmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,17 +392,6 @@ xfs_bmap_count_blocks(
int whichfork,
int *count);

/*
* Search the extent records for the entry containing block bno.
* If bno lies in a hole, point to the next entry. If bno lies
* past eof, *eofp will be set, and *prevp will contain the last
* entry (null if none). Else, *lastxp will be set to the index
* of the found entry; *gotp will contain the entry.
*/
xfs_bmbt_rec_host_t *
xfs_bmap_search_multi_extents(struct xfs_ifork *, xfs_fileoff_t, int *,
xfs_extnum_t *, xfs_bmbt_irec_t *, xfs_bmbt_irec_t *);

#endif /* __KERNEL__ */

#endif /* __XFS_BMAP_H__ */
Loading

0 comments on commit fdec29c

Please sign in to comment.