projects/linux·commit 0b61a2ba

Merge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6

0b61a2ba · Linus Torvalds <[email protected]> · 2008-02-07 19:12:12 -08:00

* 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6: (62 commits)
  [XFS] add __init/__exit mark to specific init/cleanup functions
  [XFS] Fix oops in xfs_file_readdir()
  [XFS] kill xfs_root
  [XFS] keep i_nlink updated and use proper accessors
  [XFS] stop updating inode->i_blocks
  [XFS] Make xfs_ail_check check less by default
  [XFS] Move AIL pushing into it's own thread
  [XFS] use generic_permission
  [XFS] stop re-checking permissions in xfs_swapext
  [XFS] clean up xfs_swapext
  [XFS] remove permission check from xfs_change_file_space
  [XFS] prevent panic during log recovery due to bogus op_hdr length
  [XFS] Cleanup various fid related bits:
  [XFS] Fix xfs_lowbit64
  [XFS] Remove CFORK macros and use code directly in IFORK and DFORK macros.
  [XFS] kill superflous buffer locking (2nd attempt)
  [XFS] Use kernel-supplied "roundup_pow_of_two" for simplicity
  [XFS] Remove the BPCSHIFT and NB* based macros from XFS.
  [XFS] Remove bogus assert
  [XFS] optimize XFS_IS_REALTIME_INODE w/o realtime config
  ...
Commit
0b61a2ba5dfd1620731e717d686e6ade657fd975
Parents
a13ff0bb · de2eeea6

Merge commit. Changes below are compared with the first parent: a13ff0bb.

Changes

85 files changed · +2303 −3184

FileStatusAddDelContent
fs/xfs/Makefile-linux-2.6modified+0−1View file
fs/xfs/linux-2.6/spin.hdeleted+0−45View before deletion
fs/xfs/linux-2.6/xfs_aops.cmodified+24−19View file
fs/xfs/linux-2.6/xfs_buf.cmodified+6−51View file
fs/xfs/linux-2.6/xfs_buf.hmodified+0−1View file
fs/xfs/linux-2.6/xfs_export.cmodified+17−8View file
fs/xfs/linux-2.6/xfs_file.cmodified+1−2View file
fs/xfs/linux-2.6/xfs_globals.cmodified+2−1View file
fs/xfs/linux-2.6/xfs_ioctl.cmodified+31−55View file
fs/xfs/linux-2.6/xfs_ioctl32.cmodified+6−3View file
fs/xfs/linux-2.6/xfs_iops.cmodified+136−34View file
fs/xfs/linux-2.6/xfs_linux.hmodified+3−31View file
fs/xfs/linux-2.6/xfs_lrw.cmodified+46−76View file
fs/xfs/linux-2.6/xfs_lrw.hmodified+7−9View file
fs/xfs/linux-2.6/xfs_super.cmodified+549−23View file
fs/xfs/linux-2.6/xfs_vnode.cmodified+44−73View file
fs/xfs/linux-2.6/xfs_vnode.hmodified+32−30View file
fs/xfs/quota/xfs_dquot.cmodified+5−7View file
fs/xfs/quota/xfs_dquot.hmodified+0−5View file
fs/xfs/quota/xfs_dquot_item.cmodified+11−16View file
fs/xfs/quota/xfs_qm.cmodified+6−8View file
fs/xfs/quota/xfs_qm.hmodified+3−3View file
fs/xfs/quota/xfs_qm_syscalls.cmodified+8−11View file
fs/xfs/support/debug.cmodified+6−1View file
fs/xfs/support/ktrace.cmodified+2−6View file
fs/xfs/support/ktrace.hmodified+0−3View file
fs/xfs/support/uuid.cmodified+1−1View file
fs/xfs/xfs.hmodified+1−1View file
fs/xfs/xfs_acl.cmodified+2−28View file
fs/xfs/xfs_acl.hmodified+0−2View file
fs/xfs/xfs_ag.hmodified+1−1View file
fs/xfs/xfs_alloc.cmodified+8−11View file
fs/xfs/xfs_attr.cmodified+1−1View file
fs/xfs/xfs_attr_leaf.cmodified+3−5View file
fs/xfs/xfs_bit.cmodified+0−103View file
fs/xfs/xfs_bit.hmodified+22−5View file
fs/xfs/xfs_bmap.cmodified+10−12View file
fs/xfs/xfs_bmap.hmodified+2−0View file
fs/xfs/xfs_bmap_btree.cmodified+1−2View file
fs/xfs/xfs_btree.hmodified+2−0View file
fs/xfs/xfs_buf_item.cmodified+4−6View file
fs/xfs/xfs_buf_item.hmodified+2−0View file
fs/xfs/xfs_da_btree.cmodified+5−8View file
fs/xfs/xfs_da_btree.hmodified+1−0View file
fs/xfs/xfs_dfrag.cmodified+35−49View file
fs/xfs/xfs_dinode.hmodified+27−55View file
fs/xfs/xfs_dir2.cmodified+2−1View file
fs/xfs/xfs_error.cmodified+0−31View file
fs/xfs/xfs_error.hmodified+2−0View file
fs/xfs/xfs_extfree_item.cmodified+9−12View file
fs/xfs/xfs_filestream.cmodified+1−1View file
fs/xfs/xfs_fs.hmodified+7−3View file
fs/xfs/xfs_fsops.cmodified+5−8View file
fs/xfs/xfs_ialloc_btree.hmodified+0−2View file
fs/xfs/xfs_iget.cmodified+73−112View file
fs/xfs/xfs_inode.cmodified+54−171View file
fs/xfs/xfs_inode.hmodified+40−58View file
fs/xfs/xfs_inode_item.cmodified+14−12View file
fs/xfs/xfs_iocore.cdeleted+0−119View before deletion
fs/xfs/xfs_iomap.cmodified+108−104View file
fs/xfs/xfs_iomap.hmodified+1−4View file
fs/xfs/xfs_itable.cmodified+6−6View file
fs/xfs/xfs_log.cmodified+200−216View file
fs/xfs/xfs_log.hmodified+2−1View file
fs/xfs/xfs_log_priv.hmodified+38−58View file
fs/xfs/xfs_log_recover.cmodified+92−105View file
fs/xfs/xfs_mount.cmodified+194−150View file
fs/xfs/xfs_mount.hmodified+11−116View file
fs/xfs/xfs_mru_cache.cmodified+32−22View file
fs/xfs/xfs_qmops.cmodified+3−4View file
fs/xfs/xfs_rename.cmodified+5−4View file
fs/xfs/xfs_rtalloc.cmodified+7−12View file
fs/xfs/xfs_rtalloc.hmodified+0−2View file
fs/xfs/xfs_rw.hmodified+2−10View file
fs/xfs/xfs_trans.cmodified+3−4View file
fs/xfs/xfs_trans.hmodified+5−2View file
fs/xfs/xfs_trans_ail.cmodified+220−120View file
fs/xfs/xfs_trans_item.cmodified+1−0View file
fs/xfs/xfs_trans_priv.hmodified+10−3View file
fs/xfs/xfs_utils.cmodified+6−5View file
fs/xfs/xfs_utils.hmodified+0−2View file
fs/xfs/xfs_vfsops.cmodified+29−764View file
fs/xfs/xfs_vfsops.hmodified+1−8View file
fs/xfs/xfs_vnodeops.cmodified+47−118View file
fs/xfs/xfs_vnodeops.hmodified+0−2View file

Only the first 600 diff lines are shown. Download the complete patch.

fs/xfs/Makefile-linux-2.6

View file
diff --git a/fs/xfs/Makefile-linux-2.6 b/fs/xfs/Makefile-linux-2.6
index d1491aa..9731645 100644
--- a/fs/xfs/Makefile-linux-2.6
+++ b/fs/xfs/Makefile-linux-2.6
@@ -70,7 +70,6 @@ xfs-y += xfs_alloc.o \
xfs_iget.o \
xfs_inode.o \
xfs_inode_item.o \
- xfs_iocore.o \
xfs_iomap.o \
xfs_itable.o \
xfs_dfrag.o \

fs/xfs/linux-2.6/spin.h

View before deletion
diff --git a/fs/xfs/linux-2.6/spin.h b/fs/xfs/linux-2.6/spin.h
deleted file mode 100644
index 50a6191..0000000
--- a/fs/xfs/linux-2.6/spin.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef __XFS_SUPPORT_SPIN_H__
-#define __XFS_SUPPORT_SPIN_H__
-
-#include <linux/sched.h> /* preempt needs this */
-#include <linux/spinlock.h>
-
-/*
- * Map lock_t from IRIX to Linux spinlocks.
- *
- * We do not make use of lock_t from interrupt context, so we do not
- * have to worry about disabling interrupts at all (unlike IRIX).
- */
-
-typedef spinlock_t lock_t;
-
-#define SPLDECL(s) unsigned long s
-#ifndef DEFINE_SPINLOCK
-#define DEFINE_SPINLOCK(s) spinlock_t s = SPIN_LOCK_UNLOCKED
-#endif
-
-#define spinlock_init(lock, name) spin_lock_init(lock)
-#define spinlock_destroy(lock)
-#define mutex_spinlock(lock) ({ spin_lock(lock); 0; })
-#define mutex_spinunlock(lock, s) do { spin_unlock(lock); (void)s; } while (0)
-#define nested_spinlock(lock) spin_lock(lock)
-#define nested_spinunlock(lock) spin_unlock(lock)
-
-#endif /* __XFS_SUPPORT_SPIN_H__ */

fs/xfs/linux-2.6/xfs_aops.c

View file
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 2e34b10..e051952 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -107,6 +107,18 @@ xfs_page_trace(
#define xfs_page_trace(tag, inode, page, pgoff)
#endif
+STATIC struct block_device *
+xfs_find_bdev_for_inode(
+ struct xfs_inode *ip)
+{
+ struct xfs_mount *mp = ip->i_mount;
+
+ if (XFS_IS_REALTIME_INODE(ip))
+ return mp->m_rtdev_targp->bt_bdev;
+ else
+ return mp->m_ddev_targp->bt_bdev;
+}
+
/*
* Schedule IO completion handling on a xfsdatad if this was
* the final hold on this ioend. If we are asked to wait,
@@ -151,7 +163,7 @@ xfs_destroy_ioend(
/*
* Update on-disk file size now that data has been written to disk.
* The current in-memory file size is i_size. If a write is beyond
- * eof io_new_size will be the intended file size until i_size is
+ * eof i_new_size will be the intended file size until i_size is
* updated. If this write does not extend all the way to the valid
* file size then restrict this update to the end of the write.
*/
@@ -173,7 +185,7 @@ xfs_setfilesize(
xfs_ilock(ip, XFS_ILOCK_EXCL);
- isize = MAX(ip->i_size, ip->i_iocore.io_new_size);
+ isize = MAX(ip->i_size, ip->i_new_size);
isize = MIN(isize, bsize);
if (ip->i_d.di_size < isize) {
@@ -226,12 +238,13 @@ xfs_end_bio_unwritten(
{
xfs_ioend_t *ioend =
container_of(work, xfs_ioend_t, io_work);
+ struct xfs_inode *ip = XFS_I(ioend->io_inode);
xfs_off_t offset = ioend->io_offset;
size_t size = ioend->io_size;
if (likely(!ioend->io_error)) {
- xfs_bmap(XFS_I(ioend->io_inode), offset, size,
- BMAPI_UNWRITTEN, NULL, NULL);
+ if (!XFS_FORCED_SHUTDOWN(ip->i_mount))
+ xfs_iomap_write_unwritten(ip, offset, size);
xfs_setfilesize(ioend);
}
xfs_destroy_ioend(ioend);
@@ -304,7 +317,7 @@ xfs_map_blocks(
xfs_inode_t *ip = XFS_I(inode);
int error, nmaps = 1;
- error = xfs_bmap(ip, offset, count,
+ error = xfs_iomap(ip, offset, count,
flags, mapp, &nmaps);
if (!error && (flags & (BMAPI_WRITE|BMAPI_ALLOCATE)))
xfs_iflags_set(ip, XFS_IMODIFIED);
@@ -1323,7 +1336,7 @@ __xfs_get_blocks(
offset = (xfs_off_t)iblock << inode->i_blkbits;
ASSERT(bh_result->b_size >= (1 << inode->i_blkbits));
size = bh_result->b_size;
- error = xfs_bmap(XFS_I(inode), offset, size,
+ error = xfs_iomap(XFS_I(inode), offset, size,
create ? flags : BMAPI_READ, &iomap, &niomap);
if (error)
return -error;
@@ -1471,28 +1484,21 @@ xfs_vm_direct_IO(
{
struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host;
- xfs_iomap_t iomap;
- int maps = 1;
- int error;
+ struct block_device *bdev;
ssize_t ret;
- error = xfs_bmap(XFS_I(inode), offset, 0,
- BMAPI_DEVICE, &iomap, &maps);
- if (error)
- return -error;
+ bdev = xfs_find_bdev_for_inode(XFS_I(inode));
if (rw == WRITE) {
iocb->private = xfs_alloc_ioend(inode, IOMAP_UNWRITTEN);
ret = blockdev_direct_IO_own_locking(rw, iocb, inode,
- iomap.iomap_target->bt_bdev,
- iov, offset, nr_segs,
+ bdev, iov, offset, nr_segs,
xfs_get_blocks_direct,
xfs_end_io_direct);
} else {
iocb->private = xfs_alloc_ioend(inode, IOMAP_READ);
ret = blockdev_direct_IO_no_locking(rw, iocb, inode,
- iomap.iomap_target->bt_bdev,
- iov, offset, nr_segs,
+ bdev, iov, offset, nr_segs,
xfs_get_blocks_direct,
xfs_end_io_direct);
}
@@ -1525,8 +1531,7 @@ xfs_vm_bmap(
struct inode *inode = (struct inode *)mapping->host;
struct xfs_inode *ip = XFS_I(inode);
- vn_trace_entry(XFS_I(inode), __FUNCTION__,
- (inst_t *)__return_address);
+ xfs_itrace_entry(XFS_I(inode));
xfs_rwlock(ip, VRWLOCK_READ);
xfs_flush_pages(ip, (xfs_off_t)0, -1, 0, FI_REMAPF);
xfs_rwunlock(ip, VRWLOCK_READ);

fs/xfs/linux-2.6/xfs_buf.c

View file
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index 0382c19..e347bfd 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -387,8 +387,6 @@ _xfs_buf_lookup_pages(
if (unlikely(page == NULL)) {
if (flags & XBF_READ_AHEAD) {
bp->b_page_count = i;
- for (i = 0; i < bp->b_page_count; i++)
- unlock_page(bp->b_pages[i]);
return -ENOMEM;
}
@@ -418,24 +416,17 @@ _xfs_buf_lookup_pages(
ASSERT(!PagePrivate(page));
if (!PageUptodate(page)) {
page_count--;
- if (blocksize >= PAGE_CACHE_SIZE) {
- if (flags & XBF_READ)
- bp->b_locked = 1;
- } else if (!PagePrivate(page)) {
+ if (blocksize < PAGE_CACHE_SIZE && !PagePrivate(page)) {
if (test_page_region(page, offset, nbytes))
page_count++;
}
}
+ unlock_page(page);
bp->b_pages[i] = page;
offset = 0;
}
- if (!bp->b_locked) {
- for (i = 0; i < bp->b_page_count; i++)
- unlock_page(bp->b_pages[i]);
- }
-
if (page_count == bp->b_page_count)
bp->b_flags |= XBF_DONE;
@@ -751,7 +742,6 @@ xfs_buf_associate_memory(
bp->b_pages[i] = mem_to_page((void *)pageaddr);
pageaddr += PAGE_CACHE_SIZE;
}
- bp->b_locked = 0;
bp->b_count_desired = len;
bp->b_buffer_length = buflen;
@@ -1098,25 +1088,13 @@ xfs_buf_iostart(
return status;
}
-STATIC_INLINE int
-_xfs_buf_iolocked(
- xfs_buf_t *bp)
-{
- ASSERT(bp->b_flags & (XBF_READ | XBF_WRITE));
- if (bp->b_flags & XBF_READ)
- return bp->b_locked;
- return 0;
-}
-
STATIC_INLINE void
_xfs_buf_ioend(
xfs_buf_t *bp,
int schedule)
{
- if (atomic_dec_and_test(&bp->b_io_remaining) == 1) {
- bp->b_locked = 0;
+ if (atomic_dec_and_test(&bp->b_io_remaining) == 1)
xfs_buf_ioend(bp, schedule);
- }
}
STATIC void
@@ -1147,10 +1125,6 @@ xfs_buf_bio_end_io(
if (--bvec >= bio->bi_io_vec)
prefetchw(&bvec->bv_page->flags);
-
- if (_xfs_buf_iolocked(bp)) {
- unlock_page(page);
- }
} while (bvec >= bio->bi_io_vec);
_xfs_buf_ioend(bp, 1);
@@ -1161,13 +1135,12 @@ STATIC void
_xfs_buf_ioapply(
xfs_buf_t *bp)
{
- int i, rw, map_i, total_nr_pages, nr_pages;
+ int rw, map_i, total_nr_pages, nr_pages;
struct bio *bio;
int offset = bp->b_offset;
int size = bp->b_count_desired;
sector_t sector = bp->b_bn;
unsigned int blocksize = bp->b_target->bt_bsize;
- int locking = _xfs_buf_iolocked(bp);
total_nr_pages = bp->b_page_count;
map_i = 0;
@@ -1190,7 +1163,7 @@ _xfs_buf_ioapply(
* filesystem block size is not smaller than the page size.
*/
if ((bp->b_buffer_length < PAGE_CACHE_SIZE) &&
- (bp->b_flags & XBF_READ) && locking &&
+ (bp->b_flags & XBF_READ) &&
(blocksize >= PAGE_CACHE_SIZE)) {
bio = bio_alloc(GFP_NOIO, 1);
@@ -1207,24 +1180,6 @@ _xfs_buf_ioapply(
goto submit_io;
}
- /* Lock down the pages which we need to for the request */
- if (locking && (bp->b_flags & XBF_WRITE) && (bp->b_locked == 0)) {
- for (i = 0; size; i++) {
- int nbytes = PAGE_CACHE_SIZE - offset;
- struct page *page = bp->b_pages[i];
-
- if (nbytes > size)
- nbytes = size;
-
- lock_page(page);
-
- size -= nbytes;
- offset = 0;
- }
- offset = bp->b_offset;
- size = bp->b_count_desired;
- }
-
next_chunk:
atomic_inc(&bp->b_io_remaining);
nr_pages = BIO_MAX_SECTORS >> (PAGE_SHIFT - BBSHIFT);
@@ -1571,7 +1526,7 @@ xfs_alloc_delwrite_queue(
INIT_LIST_HEAD(&btp->bt_list);
INIT_LIST_HEAD(&btp->bt_delwrite_queue);
- spinlock_init(&btp->bt_delwrite_lock, "delwri_lock");
+ spin_lock_init(&btp->bt_delwrite_lock);
btp->bt_flags = 0;
btp->bt_task = kthread_run(xfsbufd, btp, "xfsbufd");
if (IS_ERR(btp->bt_task)) {

fs/xfs/linux-2.6/xfs_buf.h

View file
diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h
index b5908a3..a3d207d 100644
--- a/fs/xfs/linux-2.6/xfs_buf.h
+++ b/fs/xfs/linux-2.6/xfs_buf.h
@@ -143,7 +143,6 @@ typedef struct xfs_buf {
void *b_fspriv2;
void *b_fspriv3;
unsigned short b_error; /* error code on I/O */
- unsigned short b_locked; /* page array is locked */
unsigned int b_page_count; /* size of page array */
unsigned int b_offset; /* page offset in first page */
struct page **b_pages; /* array of page pointers */

fs/xfs/linux-2.6/xfs_export.c

View file
diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c
index 15bd494..ca4f66c 100644
--- a/fs/xfs/linux-2.6/xfs_export.c
+++ b/fs/xfs/linux-2.6/xfs_export.c
@@ -118,20 +118,29 @@ xfs_nfs_get_inode(
u64 ino,
u32 generation)
{
- xfs_fid_t xfid;
- bhv_vnode_t *vp;
+ xfs_mount_t *mp = XFS_M(sb);
+ xfs_inode_t *ip;
int error;
- xfid.fid_len = sizeof(xfs_fid_t) - sizeof(xfid.fid_len);
- xfid.fid_pad = 0;
- xfid.fid_ino = ino;
- xfid.fid_gen = generation;
+ /*
+ * NFS can sometimes send requests for ino 0. Fail them gracefully.
+ */
+ if (ino == 0)
+ return ERR_PTR(-ESTALE);
- error = xfs_vget(XFS_M(sb), &vp, &xfid);
+ error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_SHARED, &ip, 0);
if (error)
return ERR_PTR(-error);
+ if (!ip)
+ return ERR_PTR(-EIO);
+
+ if (!ip->i_d.di_mode || ip->i_d.di_gen != generation) {
+ xfs_iput_new(ip, XFS_ILOCK_SHARED);
+ return ERR_PTR(-ENOENT);
+ }
- return vp ? vn_to_inode(vp) : NULL;
+ xfs_iunlock(ip, XFS_ILOCK_SHARED);
+ return ip->i_vnode;
}
STATIC struct dentry *

fs/xfs/linux-2.6/xfs_file.c

View file
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index 21a1c2b..edab1ff 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -350,8 +350,8 @@ xfs_file_readdir(
size = buf.used;
de = (struct hack_dirent *)buf.dirent;
- curr_offset = de->offset /* & 0x7fffffff */;
while (size > 0) {
+ curr_offset = de->offset /* & 0x7fffffff */;
if (filldir(dirent, de->name, de->namlen,
curr_offset & 0x7fffffff,
de->ino, de->d_type)) {
@@ -362,7 +362,6 @@ xfs_file_readdir(
sizeof(u64));
size -= reclen;
de = (struct hack_dirent *)((char *)de + reclen);
- curr_offset = de->offset /* & 0x7fffffff */;
}
}

fs/xfs/linux-2.6/xfs_globals.c

View file
diff --git a/fs/xfs/linux-2.6/xfs_globals.c b/fs/xfs/linux-2.6/xfs_globals.c
index 9febf9d..ef90e64 100644
--- a/fs/xfs/linux-2.6/xfs_globals.c
+++ b/fs/xfs/linux-2.6/xfs_globals.c
@@ -47,5 +47,6 @@ xfs_param_t xfs_params = {
/*
* Global system credential structure.
*/
-cred_t sys_cred_val, *sys_cred = &sys_cred_val;
+static cred_t sys_cred_val;
+cred_t *sys_cred = &sys_cred_val;

fs/xfs/linux-2.6/xfs_ioctl.c

View file
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index 98a5656..4c82a05 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -75,7 +75,6 @@ xfs_find_handle(
xfs_handle_t handle;
xfs_fsop_handlereq_t hreq;
struct inode *inode;
- bhv_vnode_t *vp;
if (copy_from_user(&hreq, arg, sizeof(hreq)))
return -XFS_ERROR(EFAULT);
@@ -134,21 +133,16 @@ xfs_find_handle(
return -XFS_ERROR(EBADF);
}
- /* we need the vnode */
- vp = vn_from_inode(inode);
-
/* now we can grab the fsid */
memcpy(&handle.ha_fsid, XFS_I(inode)->i_mount->m_fixedfsid,
sizeof(xfs_fsid_t));
hsize = sizeof(xfs_fsid_t);
if (cmd != XFS_IOC_PATH_TO_FSHANDLE) {
- xfs_inode_t *ip;
+ xfs_inode_t *ip = XFS_I(inode);
int lock_mode;
/* need to get access to the xfs_inode to read the generation */
- ip = xfs_vtoi(vp);
- ASSERT(ip);
lock_mode = xfs_ilock_map_shared(ip);
/* fill in fid section of handle from inode */
@@ -176,21 +170,19 @@ xfs_find_handle(
/*
- * Convert userspace handle data into vnode (and inode).
- * We [ab]use the fact that all the fsop_handlereq ioctl calls
- * have a data structure argument whose first component is always
- * a xfs_fsop_handlereq_t, so we can cast to and from this type.
- * This allows us to optimise the copy_from_user calls and gives
- * a handy, shared routine.
+ * Convert userspace handle data into inode.
+ *
+ * We use the fact that all the fsop_handlereq ioctl calls have a data
+ * structure argument whose first component is always a xfs_fsop_handlereq_t,
+ * so we can pass that sub structure into this handy, shared routine.
*
- * If no error, caller must always VN_RELE the returned vp.
+ * If no error, caller must always iput the returned inode.
*/
STATIC int
xfs_vget_fsop_handlereq(
xfs_mount_t *mp,
struct inode *parinode, /* parent inode pointer */
xfs_fsop_handlereq_t *hreq,
- bhv_vnode_t **vp,
struct inode **inode)
{
void __user *hanp;
@@ -199,8 +191,6 @@ xfs_vget_fsop_handlereq(
xfs_handle_t *handlep;
xfs_handle_t handle;
xfs_inode_t *ip;
- struct inode *inodep;
- bhv_vnode_t *vpp;
xfs_ino_t ino;
__u32 igen;
int error;
@@ -241,7 +231,7 @@ xfs_vget_fsop_handlereq(
}
/*
- * Get the XFS inode, building a vnode to go with it.
+ * Get the XFS inode, building a Linux inode to go with it.
*/
error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_SHARED, &ip, 0);
if (error)
@@ -253,12 +243,9 @@ xfs_vget_fsop_handlereq(
return XFS_ERROR(ENOENT);
}
- vpp = XFS_ITOV(ip);
- inodep = vn_to_inode(vpp);
xfs_iunlock(ip, XFS_ILOCK_SHARED);
- *vp = vpp;
- *inode = inodep;
+ *inode = XFS_ITOV(ip);
return 0;
}
@@ -275,7 +262,6 @@ xfs_open_by_handle(
struct file *filp;
struct inode *inode;
struct dentry *dentry;
- bhv_vnode_t *vp;
xfs_fsop_handlereq_t hreq;
if (!capable(CAP_SYS_ADMIN))
@@ -283,7 +269,7 @@ xfs_open_by_handle(
if (copy_from_user(&hreq, arg, sizeof(xfs_fsop_handlereq_t)))
return -XFS_ERROR(EFAULT);
- error = xfs_vget_fsop_handlereq(mp, parinode, &hreq, &vp, &inode);
+ error = xfs_vget_fsop_handlereq(mp, parinode, &hreq, &inode);
if (error)
return -error;
@@ -385,7 +371,6 @@ xfs_readlink_by_handle(
{
struct inode *inode;
xfs_fsop_handlereq_t hreq;
- bhv_vnode_t *vp;
__u32 olen;
void *link;
int error;
@@ -395,7 +380,7 @@ xfs_readlink_by_handle(
if (copy_from_user(&hreq, arg, sizeof(xfs_fsop_handlereq_t)))
return -XFS_ERROR(EFAULT);
- error = xfs_vget_fsop_handlereq(mp, parinode, &hreq, &vp, &inode);
+ error = xfs_vget_fsop_handlereq(mp, parinode, &hreq, &inode);
if (error)
return -error;
@@ -438,34 +423,32 @@ xfs_fssetdm_by_handle(
struct fsdmidata fsd;
xfs_fsop_setdm_handlereq_t dmhreq;
struct inode *inode;
- bhv_vnode_t *vp;
if (!capable(CAP_MKNOD))
return -XFS_ERROR(EPERM);
if (copy_from_user(&dmhreq, arg, sizeof(xfs_fsop_setdm_handlereq_t)))
return -XFS_ERROR(EFAULT);
- error = xfs_vget_fsop_handlereq(mp, parinode, &dmhreq.hreq, &vp, &inode);
+ error = xfs_vget_fsop_handlereq(mp, parinode, &dmhreq.hreq, &inode);
if (error)
return -error;
if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) {
- VN_RELE(vp);
- return -XFS_ERROR(EPERM);
+ error = -XFS_ERROR(EPERM);
+ goto out;
}
if (copy_from_user(&fsd, dmhreq.data, sizeof(fsd))) {
- VN_RELE(vp);
- return -XFS_ERROR(EFAULT);
+ error = -XFS_ERROR(EFAULT);
+ goto out;
}
- error = xfs_set_dmattrs(xfs_vtoi(vp),
- fsd.fsd_dmevmask, fsd.fsd_dmstate);
+ error = -xfs_set_dmattrs(XFS_I(inode), fsd.fsd_dmevmask,
+ fsd.fsd_dmstate);
- VN_RELE(vp);
- if (error)
- return -error;
- return 0;
+ out:
+ iput(inode);
+ return error;
}
STATIC int
@@ -478,7 +461,6 @@ xfs_attrlist_by_handle(
attrlist_cursor_kern_t *cursor;
xfs_fsop_attrlist_handlereq_t al_hreq;
struct inode *inode;
- bhv_vnode_t *vp;
char *kbuf;
if (!capable(CAP_SYS_ADMIN))
@@ -488,8 +470,7 @@ xfs_attrlist_by_handle(
if (al_hreq.buflen > XATTR_LIST_MAX)
return -XFS_ERROR(EINVAL);
- error = xfs_vget_fsop_handlereq(mp, parinode, &al_hreq.hreq,

This diff is incomplete. Download the complete patch.

fs/xfs/linux-2.6/xfs_ioctl32.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/linux-2.6/xfs_iops.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/linux-2.6/xfs_linux.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/linux-2.6/xfs_lrw.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/linux-2.6/xfs_lrw.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/linux-2.6/xfs_super.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/linux-2.6/xfs_vnode.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/linux-2.6/xfs_vnode.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/quota/xfs_dquot.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/quota/xfs_dquot.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/quota/xfs_dquot_item.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/quota/xfs_qm.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/quota/xfs_qm.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/quota/xfs_qm_syscalls.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/support/debug.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/support/ktrace.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/support/ktrace.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/support/uuid.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_acl.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_acl.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_ag.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_alloc.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_attr.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_attr_leaf.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_bit.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_bit.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_bmap.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_bmap.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_bmap_btree.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_btree.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_buf_item.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_buf_item.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_da_btree.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_da_btree.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_dfrag.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_dinode.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_dir2.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_error.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_error.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_extfree_item.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_filestream.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_fs.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_fsops.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_ialloc_btree.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_iget.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_inode.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_inode.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_inode_item.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_iocore.c

View before deletion

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_iomap.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_iomap.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_itable.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_log.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_log.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_log_priv.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_log_recover.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_mount.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_mount.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_mru_cache.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_qmops.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_rename.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_rtalloc.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_rtalloc.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_rw.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_trans.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_trans.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_trans_ail.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_trans_item.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_trans_priv.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_utils.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_utils.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_vfsops.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_vfsops.h

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_vnodeops.c

View file

This diff is incomplete. Download the complete patch.

fs/xfs/xfs_vnodeops.h

View file

This diff is incomplete. Download the complete patch.