You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge git://oss.sgi.com:8090/xfs/xfs-2.6
* git://oss.sgi.com:8090/xfs/xfs-2.6: (33 commits) [XFS] Don't use kmap in xfs_iozero. [XFS] Remove a bunch of unused functions from XFS. [XFS] Remove unused arguments from the XFS_BTREE_*_ADDR macros. [XFS] Remove unused header files for MAC and CAP checking functionality. [XFS] Make freeze code a little cleaner. [XFS] Remove unused argument to xfs_bmap_finish [XFS] Clean up use of VFS attr flags [XFS] Remove useless memory barrier [XFS] XFS sysctl cleanups [XFS] Fix assertion in xfs_attr_shortform_remove(). [XFS] Fix callers of xfs_iozero() to zero the correct range. [XFS] Ensure a frozen filesystem has a clean log before writing the dummy [XFS] Fix sub-block zeroing for buffered writes into unwritten extents. [XFS] Re-initialize the per-cpu superblock counters after recovery. [XFS] Fix block reservation changes for non-SMP systems. [XFS] Fix block reservation mechanism. [XFS] Make growfs work for amounts greater than 2TB [XFS] Fix inode log item use-after-free on forced shutdown [XFS] Fix attr2 corruption with btree data extents [XFS] Workaround log space issue by increasing XFS_TRANS_PUSH_AIL_RESTARTS ...
This commit is contained in:
@@ -31,15 +31,13 @@ typedef struct {
|
||||
do { (mrp)->mr_writer = 0; init_rwsem(&(mrp)->mr_lock); } while (0)
|
||||
#define mrlock_init(mrp, t,n,s) mrinit(mrp, n)
|
||||
#define mrfree(mrp) do { } while (0)
|
||||
#define mraccess(mrp) mraccessf(mrp, 0)
|
||||
#define mrupdate(mrp) mrupdatef(mrp, 0)
|
||||
|
||||
static inline void mraccessf(mrlock_t *mrp, int flags)
|
||||
static inline void mraccess(mrlock_t *mrp)
|
||||
{
|
||||
down_read(&mrp->mr_lock);
|
||||
}
|
||||
|
||||
static inline void mrupdatef(mrlock_t *mrp, int flags)
|
||||
static inline void mrupdate(mrlock_t *mrp)
|
||||
{
|
||||
down_write(&mrp->mr_lock);
|
||||
mrp->mr_writer = 1;
|
||||
|
||||
@@ -249,7 +249,7 @@ xfs_map_blocks(
|
||||
return -error;
|
||||
}
|
||||
|
||||
STATIC inline int
|
||||
STATIC_INLINE int
|
||||
xfs_iomap_valid(
|
||||
xfs_iomap_t *iomapp,
|
||||
loff_t offset)
|
||||
@@ -1283,13 +1283,18 @@ __xfs_get_blocks(
|
||||
bh_result->b_bdev = iomap.iomap_target->bt_bdev;
|
||||
|
||||
/*
|
||||
* If we previously allocated a block out beyond eof and we are
|
||||
* now coming back to use it then we will need to flag it as new
|
||||
* even if it has a disk address.
|
||||
* If we previously allocated a block out beyond eof and we are now
|
||||
* coming back to use it then we will need to flag it as new even if it
|
||||
* has a disk address.
|
||||
*
|
||||
* With sub-block writes into unwritten extents we also need to mark
|
||||
* the buffer as new so that the unwritten parts of the buffer gets
|
||||
* correctly zeroed.
|
||||
*/
|
||||
if (create &&
|
||||
((!buffer_mapped(bh_result) && !buffer_uptodate(bh_result)) ||
|
||||
(offset >= i_size_read(inode)) || (iomap.iomap_flags & IOMAP_NEW)))
|
||||
(offset >= i_size_read(inode)) ||
|
||||
(iomap.iomap_flags & (IOMAP_NEW|IOMAP_UNWRITTEN))))
|
||||
set_buffer_new(bh_result);
|
||||
|
||||
if (iomap.iomap_flags & IOMAP_DELAY) {
|
||||
|
||||
+72
-70
@@ -34,13 +34,13 @@
|
||||
#include <linux/backing-dev.h>
|
||||
#include <linux/freezer.h>
|
||||
|
||||
STATIC kmem_zone_t *xfs_buf_zone;
|
||||
STATIC kmem_shaker_t xfs_buf_shake;
|
||||
static kmem_zone_t *xfs_buf_zone;
|
||||
static kmem_shaker_t xfs_buf_shake;
|
||||
STATIC int xfsbufd(void *);
|
||||
STATIC int xfsbufd_wakeup(int, gfp_t);
|
||||
STATIC void xfs_buf_delwri_queue(xfs_buf_t *, int);
|
||||
|
||||
STATIC struct workqueue_struct *xfslogd_workqueue;
|
||||
static struct workqueue_struct *xfslogd_workqueue;
|
||||
struct workqueue_struct *xfsdatad_workqueue;
|
||||
|
||||
#ifdef XFS_BUF_TRACE
|
||||
@@ -139,7 +139,7 @@ page_region_mask(
|
||||
return mask;
|
||||
}
|
||||
|
||||
STATIC inline void
|
||||
STATIC_INLINE void
|
||||
set_page_region(
|
||||
struct page *page,
|
||||
size_t offset,
|
||||
@@ -151,7 +151,7 @@ set_page_region(
|
||||
SetPageUptodate(page);
|
||||
}
|
||||
|
||||
STATIC inline int
|
||||
STATIC_INLINE int
|
||||
test_page_region(
|
||||
struct page *page,
|
||||
size_t offset,
|
||||
@@ -171,9 +171,9 @@ typedef struct a_list {
|
||||
struct a_list *next;
|
||||
} a_list_t;
|
||||
|
||||
STATIC a_list_t *as_free_head;
|
||||
STATIC int as_list_len;
|
||||
STATIC DEFINE_SPINLOCK(as_lock);
|
||||
static a_list_t *as_free_head;
|
||||
static int as_list_len;
|
||||
static DEFINE_SPINLOCK(as_lock);
|
||||
|
||||
/*
|
||||
* Try to batch vunmaps because they are costly.
|
||||
@@ -1085,7 +1085,7 @@ xfs_buf_iostart(
|
||||
return status;
|
||||
}
|
||||
|
||||
STATIC __inline__ int
|
||||
STATIC_INLINE int
|
||||
_xfs_buf_iolocked(
|
||||
xfs_buf_t *bp)
|
||||
{
|
||||
@@ -1095,7 +1095,7 @@ _xfs_buf_iolocked(
|
||||
return 0;
|
||||
}
|
||||
|
||||
STATIC __inline__ void
|
||||
STATIC_INLINE void
|
||||
_xfs_buf_ioend(
|
||||
xfs_buf_t *bp,
|
||||
int schedule)
|
||||
@@ -1426,8 +1426,8 @@ xfs_free_bufhash(
|
||||
/*
|
||||
* buftarg list for delwrite queue processing
|
||||
*/
|
||||
STATIC LIST_HEAD(xfs_buftarg_list);
|
||||
STATIC DEFINE_SPINLOCK(xfs_buftarg_lock);
|
||||
LIST_HEAD(xfs_buftarg_list);
|
||||
static DEFINE_SPINLOCK(xfs_buftarg_lock);
|
||||
|
||||
STATIC void
|
||||
xfs_register_buftarg(
|
||||
@@ -1679,21 +1679,60 @@ xfsbufd_wakeup(
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Move as many buffers as specified to the supplied list
|
||||
* idicating if we skipped any buffers to prevent deadlocks.
|
||||
*/
|
||||
STATIC int
|
||||
xfs_buf_delwri_split(
|
||||
xfs_buftarg_t *target,
|
||||
struct list_head *list,
|
||||
unsigned long age)
|
||||
{
|
||||
xfs_buf_t *bp, *n;
|
||||
struct list_head *dwq = &target->bt_delwrite_queue;
|
||||
spinlock_t *dwlk = &target->bt_delwrite_lock;
|
||||
int skipped = 0;
|
||||
int force;
|
||||
|
||||
force = test_and_clear_bit(XBT_FORCE_FLUSH, &target->bt_flags);
|
||||
INIT_LIST_HEAD(list);
|
||||
spin_lock(dwlk);
|
||||
list_for_each_entry_safe(bp, n, dwq, b_list) {
|
||||
XB_TRACE(bp, "walkq1", (long)xfs_buf_ispin(bp));
|
||||
ASSERT(bp->b_flags & XBF_DELWRI);
|
||||
|
||||
if (!xfs_buf_ispin(bp) && !xfs_buf_cond_lock(bp)) {
|
||||
if (!force &&
|
||||
time_before(jiffies, bp->b_queuetime + age)) {
|
||||
xfs_buf_unlock(bp);
|
||||
break;
|
||||
}
|
||||
|
||||
bp->b_flags &= ~(XBF_DELWRI|_XBF_DELWRI_Q|
|
||||
_XBF_RUN_QUEUES);
|
||||
bp->b_flags |= XBF_WRITE;
|
||||
list_move_tail(&bp->b_list, list);
|
||||
} else
|
||||
skipped++;
|
||||
}
|
||||
spin_unlock(dwlk);
|
||||
|
||||
return skipped;
|
||||
|
||||
}
|
||||
|
||||
STATIC int
|
||||
xfsbufd(
|
||||
void *data)
|
||||
void *data)
|
||||
{
|
||||
struct list_head tmp;
|
||||
unsigned long age;
|
||||
xfs_buftarg_t *target = (xfs_buftarg_t *)data;
|
||||
xfs_buf_t *bp, *n;
|
||||
struct list_head *dwq = &target->bt_delwrite_queue;
|
||||
spinlock_t *dwlk = &target->bt_delwrite_lock;
|
||||
int count;
|
||||
struct list_head tmp;
|
||||
xfs_buftarg_t *target = (xfs_buftarg_t *)data;
|
||||
int count;
|
||||
xfs_buf_t *bp;
|
||||
|
||||
current->flags |= PF_MEMALLOC;
|
||||
|
||||
INIT_LIST_HEAD(&tmp);
|
||||
do {
|
||||
if (unlikely(freezing(current))) {
|
||||
set_bit(XBT_FORCE_SLEEP, &target->bt_flags);
|
||||
@@ -1705,37 +1744,17 @@ xfsbufd(
|
||||
schedule_timeout_interruptible(
|
||||
xfs_buf_timer_centisecs * msecs_to_jiffies(10));
|
||||
|
||||
xfs_buf_delwri_split(target, &tmp,
|
||||
xfs_buf_age_centisecs * msecs_to_jiffies(10));
|
||||
|
||||
count = 0;
|
||||
age = xfs_buf_age_centisecs * msecs_to_jiffies(10);
|
||||
spin_lock(dwlk);
|
||||
list_for_each_entry_safe(bp, n, dwq, b_list) {
|
||||
XB_TRACE(bp, "walkq1", (long)xfs_buf_ispin(bp));
|
||||
ASSERT(bp->b_flags & XBF_DELWRI);
|
||||
|
||||
if (!xfs_buf_ispin(bp) && !xfs_buf_cond_lock(bp)) {
|
||||
if (!test_bit(XBT_FORCE_FLUSH,
|
||||
&target->bt_flags) &&
|
||||
time_before(jiffies,
|
||||
bp->b_queuetime + age)) {
|
||||
xfs_buf_unlock(bp);
|
||||
break;
|
||||
}
|
||||
|
||||
bp->b_flags &= ~(XBF_DELWRI|_XBF_DELWRI_Q|
|
||||
_XBF_RUN_QUEUES);
|
||||
bp->b_flags |= XBF_WRITE;
|
||||
list_move_tail(&bp->b_list, &tmp);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
spin_unlock(dwlk);
|
||||
|
||||
while (!list_empty(&tmp)) {
|
||||
bp = list_entry(tmp.next, xfs_buf_t, b_list);
|
||||
ASSERT(target == bp->b_target);
|
||||
|
||||
list_del_init(&bp->b_list);
|
||||
xfs_buf_iostrategy(bp);
|
||||
count++;
|
||||
}
|
||||
|
||||
if (as_list_len > 0)
|
||||
@@ -1743,7 +1762,6 @@ xfsbufd(
|
||||
if (count)
|
||||
blk_run_address_space(target->bt_mapping);
|
||||
|
||||
clear_bit(XBT_FORCE_FLUSH, &target->bt_flags);
|
||||
} while (!kthread_should_stop());
|
||||
|
||||
return 0;
|
||||
@@ -1756,40 +1774,24 @@ xfsbufd(
|
||||
*/
|
||||
int
|
||||
xfs_flush_buftarg(
|
||||
xfs_buftarg_t *target,
|
||||
int wait)
|
||||
xfs_buftarg_t *target,
|
||||
int wait)
|
||||
{
|
||||
struct list_head tmp;
|
||||
xfs_buf_t *bp, *n;
|
||||
int pincount = 0;
|
||||
struct list_head *dwq = &target->bt_delwrite_queue;
|
||||
spinlock_t *dwlk = &target->bt_delwrite_lock;
|
||||
struct list_head tmp;
|
||||
xfs_buf_t *bp, *n;
|
||||
int pincount = 0;
|
||||
|
||||
xfs_buf_runall_queues(xfsdatad_workqueue);
|
||||
xfs_buf_runall_queues(xfslogd_workqueue);
|
||||
|
||||
INIT_LIST_HEAD(&tmp);
|
||||
spin_lock(dwlk);
|
||||
list_for_each_entry_safe(bp, n, dwq, b_list) {
|
||||
ASSERT(bp->b_target == target);
|
||||
ASSERT(bp->b_flags & (XBF_DELWRI | _XBF_DELWRI_Q));
|
||||
XB_TRACE(bp, "walkq2", (long)xfs_buf_ispin(bp));
|
||||
if (xfs_buf_ispin(bp)) {
|
||||
pincount++;
|
||||
continue;
|
||||
}
|
||||
|
||||
list_move_tail(&bp->b_list, &tmp);
|
||||
}
|
||||
spin_unlock(dwlk);
|
||||
set_bit(XBT_FORCE_FLUSH, &target->bt_flags);
|
||||
pincount = xfs_buf_delwri_split(target, &tmp, 0);
|
||||
|
||||
/*
|
||||
* Dropped the delayed write list lock, now walk the temporary list
|
||||
*/
|
||||
list_for_each_entry_safe(bp, n, &tmp, b_list) {
|
||||
xfs_buf_lock(bp);
|
||||
bp->b_flags &= ~(XBF_DELWRI|_XBF_DELWRI_Q|_XBF_RUN_QUEUES);
|
||||
bp->b_flags |= XBF_WRITE;
|
||||
ASSERT(target == bp->b_target);
|
||||
if (wait)
|
||||
bp->b_flags &= ~XBF_ASYNC;
|
||||
else
|
||||
|
||||
@@ -69,8 +69,8 @@ typedef enum {
|
||||
} xfs_buf_flags_t;
|
||||
|
||||
typedef enum {
|
||||
XBT_FORCE_SLEEP = (0 << 1),
|
||||
XBT_FORCE_FLUSH = (1 << 1),
|
||||
XBT_FORCE_SLEEP = 0,
|
||||
XBT_FORCE_FLUSH = 1,
|
||||
} xfs_buftarg_flags_t;
|
||||
|
||||
typedef struct xfs_bufhash {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "xfs_mount.h"
|
||||
#include "xfs_export.h"
|
||||
|
||||
STATIC struct dentry dotdot = { .d_name.name = "..", .d_name.len = 2, };
|
||||
static struct dentry dotdot = { .d_name.name = "..", .d_name.len = 2, };
|
||||
|
||||
/*
|
||||
* XFS encodes and decodes the fileid portion of NFS filehandles
|
||||
|
||||
@@ -46,7 +46,7 @@ static struct vm_operations_struct xfs_file_vm_ops;
|
||||
static struct vm_operations_struct xfs_dmapi_file_vm_ops;
|
||||
#endif
|
||||
|
||||
STATIC inline ssize_t
|
||||
STATIC_INLINE ssize_t
|
||||
__xfs_file_read(
|
||||
struct kiocb *iocb,
|
||||
const struct iovec *iov,
|
||||
@@ -84,7 +84,7 @@ xfs_file_aio_read_invis(
|
||||
return __xfs_file_read(iocb, iov, nr_segs, IO_ISAIO|IO_INVIS, pos);
|
||||
}
|
||||
|
||||
STATIC inline ssize_t
|
||||
STATIC_INLINE ssize_t
|
||||
__xfs_file_write(
|
||||
struct kiocb *iocb,
|
||||
const struct iovec *iov,
|
||||
|
||||
@@ -41,8 +41,6 @@
|
||||
#include "xfs_error.h"
|
||||
#include "xfs_rw.h"
|
||||
#include "xfs_acl.h"
|
||||
#include "xfs_cap.h"
|
||||
#include "xfs_mac.h"
|
||||
#include "xfs_attr.h"
|
||||
#include "xfs_bmap.h"
|
||||
#include "xfs_buf_item.h"
|
||||
@@ -355,7 +353,6 @@ STATIC int
|
||||
xfs_readlink_by_handle(
|
||||
xfs_mount_t *mp,
|
||||
void __user *arg,
|
||||
struct file *parfilp,
|
||||
struct inode *parinode)
|
||||
{
|
||||
int error;
|
||||
@@ -388,7 +385,7 @@ xfs_readlink_by_handle(
|
||||
aiov.iov_len = olen;
|
||||
aiov.iov_base = hreq.ohandle;
|
||||
|
||||
auio.uio_iov = &aiov;
|
||||
auio.uio_iov = (struct kvec *)&aiov;
|
||||
auio.uio_iovcnt = 1;
|
||||
auio.uio_offset = 0;
|
||||
auio.uio_segflg = UIO_USERSPACE;
|
||||
@@ -406,7 +403,6 @@ STATIC int
|
||||
xfs_fssetdm_by_handle(
|
||||
xfs_mount_t *mp,
|
||||
void __user *arg,
|
||||
struct file *parfilp,
|
||||
struct inode *parinode)
|
||||
{
|
||||
int error;
|
||||
@@ -448,7 +444,6 @@ STATIC int
|
||||
xfs_attrlist_by_handle(
|
||||
xfs_mount_t *mp,
|
||||
void __user *arg,
|
||||
struct file *parfilp,
|
||||
struct inode *parinode)
|
||||
{
|
||||
int error;
|
||||
@@ -569,7 +564,6 @@ STATIC int
|
||||
xfs_attrmulti_by_handle(
|
||||
xfs_mount_t *mp,
|
||||
void __user *arg,
|
||||
struct file *parfilp,
|
||||
struct inode *parinode)
|
||||
{
|
||||
int error;
|
||||
@@ -689,7 +683,6 @@ xfs_ioc_xattr(
|
||||
STATIC int
|
||||
xfs_ioc_getbmap(
|
||||
bhv_desc_t *bdp,
|
||||
struct file *filp,
|
||||
int flags,
|
||||
unsigned int cmd,
|
||||
void __user *arg);
|
||||
@@ -788,7 +781,7 @@ xfs_ioctl(
|
||||
|
||||
case XFS_IOC_GETBMAP:
|
||||
case XFS_IOC_GETBMAPA:
|
||||
return xfs_ioc_getbmap(bdp, filp, ioflags, cmd, arg);
|
||||
return xfs_ioc_getbmap(bdp, ioflags, cmd, arg);
|
||||
|
||||
case XFS_IOC_GETBMAPX:
|
||||
return xfs_ioc_getbmapx(bdp, arg);
|
||||
@@ -802,16 +795,16 @@ xfs_ioctl(
|
||||
return xfs_open_by_handle(mp, arg, filp, inode);
|
||||
|
||||
case XFS_IOC_FSSETDM_BY_HANDLE:
|
||||
return xfs_fssetdm_by_handle(mp, arg, filp, inode);
|
||||
return xfs_fssetdm_by_handle(mp, arg, inode);
|
||||
|
||||
case XFS_IOC_READLINK_BY_HANDLE:
|
||||
return xfs_readlink_by_handle(mp, arg, filp, inode);
|
||||
return xfs_readlink_by_handle(mp, arg, inode);
|
||||
|
||||
case XFS_IOC_ATTRLIST_BY_HANDLE:
|
||||
return xfs_attrlist_by_handle(mp, arg, filp, inode);
|
||||
return xfs_attrlist_by_handle(mp, arg, inode);
|
||||
|
||||
case XFS_IOC_ATTRMULTI_BY_HANDLE:
|
||||
return xfs_attrmulti_by_handle(mp, arg, filp, inode);
|
||||
return xfs_attrmulti_by_handle(mp, arg, inode);
|
||||
|
||||
case XFS_IOC_SWAPEXT: {
|
||||
error = xfs_swapext((struct xfs_swapext __user *)arg);
|
||||
@@ -1095,11 +1088,6 @@ xfs_ioc_fsgeometry(
|
||||
/*
|
||||
* Linux extended inode flags interface.
|
||||
*/
|
||||
#define LINUX_XFLAG_SYNC 0x00000008 /* Synchronous updates */
|
||||
#define LINUX_XFLAG_IMMUTABLE 0x00000010 /* Immutable file */
|
||||
#define LINUX_XFLAG_APPEND 0x00000020 /* writes to file may only append */
|
||||
#define LINUX_XFLAG_NODUMP 0x00000040 /* do not dump file */
|
||||
#define LINUX_XFLAG_NOATIME 0x00000080 /* do not update atime */
|
||||
|
||||
STATIC unsigned int
|
||||
xfs_merge_ioc_xflags(
|
||||
@@ -1108,23 +1096,23 @@ xfs_merge_ioc_xflags(
|
||||
{
|
||||
unsigned int xflags = start;
|
||||
|
||||
if (flags & LINUX_XFLAG_IMMUTABLE)
|
||||
if (flags & FS_IMMUTABLE_FL)
|
||||
xflags |= XFS_XFLAG_IMMUTABLE;
|
||||
else
|
||||
xflags &= ~XFS_XFLAG_IMMUTABLE;
|
||||
if (flags & LINUX_XFLAG_APPEND)
|
||||
if (flags & FS_APPEND_FL)
|
||||
xflags |= XFS_XFLAG_APPEND;
|
||||
else
|
||||
xflags &= ~XFS_XFLAG_APPEND;
|
||||
if (flags & LINUX_XFLAG_SYNC)
|
||||
if (flags & FS_SYNC_FL)
|
||||
xflags |= XFS_XFLAG_SYNC;
|
||||
else
|
||||
xflags &= ~XFS_XFLAG_SYNC;
|
||||
if (flags & LINUX_XFLAG_NOATIME)
|
||||
if (flags & FS_NOATIME_FL)
|
||||
xflags |= XFS_XFLAG_NOATIME;
|
||||
else
|
||||
xflags &= ~XFS_XFLAG_NOATIME;
|
||||
if (flags & LINUX_XFLAG_NODUMP)
|
||||
if (flags & FS_NODUMP_FL)
|
||||
xflags |= XFS_XFLAG_NODUMP;
|
||||
else
|
||||
xflags &= ~XFS_XFLAG_NODUMP;
|
||||
@@ -1139,15 +1127,15 @@ xfs_di2lxflags(
|
||||
unsigned int flags = 0;
|
||||
|
||||
if (di_flags & XFS_DIFLAG_IMMUTABLE)
|
||||
flags |= LINUX_XFLAG_IMMUTABLE;
|
||||
flags |= FS_IMMUTABLE_FL;
|
||||
if (di_flags & XFS_DIFLAG_APPEND)
|
||||
flags |= LINUX_XFLAG_APPEND;
|
||||
flags |= FS_APPEND_FL;
|
||||
if (di_flags & XFS_DIFLAG_SYNC)
|
||||
flags |= LINUX_XFLAG_SYNC;
|
||||
flags |= FS_SYNC_FL;
|
||||
if (di_flags & XFS_DIFLAG_NOATIME)
|
||||
flags |= LINUX_XFLAG_NOATIME;
|
||||
flags |= FS_NOATIME_FL;
|
||||
if (di_flags & XFS_DIFLAG_NODUMP)
|
||||
flags |= LINUX_XFLAG_NODUMP;
|
||||
flags |= FS_NODUMP_FL;
|
||||
return flags;
|
||||
}
|
||||
|
||||
@@ -1247,9 +1235,9 @@ xfs_ioc_xattr(
|
||||
break;
|
||||
}
|
||||
|
||||
if (flags & ~(LINUX_XFLAG_IMMUTABLE | LINUX_XFLAG_APPEND | \
|
||||
LINUX_XFLAG_NOATIME | LINUX_XFLAG_NODUMP | \
|
||||
LINUX_XFLAG_SYNC)) {
|
||||
if (flags & ~(FS_IMMUTABLE_FL | FS_APPEND_FL | \
|
||||
FS_NOATIME_FL | FS_NODUMP_FL | \
|
||||
FS_SYNC_FL)) {
|
||||
error = -EOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
@@ -1281,7 +1269,6 @@ xfs_ioc_xattr(
|
||||
STATIC int
|
||||
xfs_ioc_getbmap(
|
||||
bhv_desc_t *bdp,
|
||||
struct file *filp,
|
||||
int ioflags,
|
||||
unsigned int cmd,
|
||||
void __user *arg)
|
||||
|
||||
@@ -43,8 +43,6 @@
|
||||
#include "xfs_itable.h"
|
||||
#include "xfs_rw.h"
|
||||
#include "xfs_acl.h"
|
||||
#include "xfs_cap.h"
|
||||
#include "xfs_mac.h"
|
||||
#include "xfs_attr.h"
|
||||
#include "xfs_buf_item.h"
|
||||
#include "xfs_utils.h"
|
||||
@@ -250,13 +248,13 @@ xfs_init_security(
|
||||
*
|
||||
* XXX(hch): nfsd is broken, better fix it instead.
|
||||
*/
|
||||
STATIC inline int
|
||||
STATIC_INLINE int
|
||||
xfs_has_fs_struct(struct task_struct *task)
|
||||
{
|
||||
return (task->fs != init_task.fs);
|
||||
}
|
||||
|
||||
STATIC inline void
|
||||
STATIC void
|
||||
xfs_cleanup_inode(
|
||||
bhv_vnode_t *dvp,
|
||||
bhv_vnode_t *vp,
|
||||
|
||||
+21
-27
@@ -43,8 +43,6 @@
|
||||
#include "xfs_itable.h"
|
||||
#include "xfs_rw.h"
|
||||
#include "xfs_acl.h"
|
||||
#include "xfs_cap.h"
|
||||
#include "xfs_mac.h"
|
||||
#include "xfs_attr.h"
|
||||
#include "xfs_inode_item.h"
|
||||
#include "xfs_buf_item.h"
|
||||
@@ -134,13 +132,11 @@ STATIC int
|
||||
xfs_iozero(
|
||||
struct inode *ip, /* inode */
|
||||
loff_t pos, /* offset in file */
|
||||
size_t count, /* size of data to zero */
|
||||
loff_t end_size) /* max file size to set */
|
||||
size_t count) /* size of data to zero */
|
||||
{
|
||||
unsigned bytes;
|
||||
struct page *page;
|
||||
struct address_space *mapping;
|
||||
char *kaddr;
|
||||
int status;
|
||||
|
||||
mapping = ip->i_mapping;
|
||||
@@ -158,26 +154,21 @@ xfs_iozero(
|
||||
if (!page)
|
||||
break;
|
||||
|
||||
kaddr = kmap(page);
|
||||
status = mapping->a_ops->prepare_write(NULL, page, offset,
|
||||
offset + bytes);
|
||||
if (status) {
|
||||
if (status)
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
memset((void *) (kaddr + offset), 0, bytes);
|
||||
flush_dcache_page(page);
|
||||
memclear_highpage_flush(page, offset, bytes);
|
||||
|
||||
status = mapping->a_ops->commit_write(NULL, page, offset,
|
||||
offset + bytes);
|
||||
if (!status) {
|
||||
pos += bytes;
|
||||
count -= bytes;
|
||||
if (pos > i_size_read(ip))
|
||||
i_size_write(ip, pos < end_size ? pos : end_size);
|
||||
}
|
||||
|
||||
unlock:
|
||||
kunmap(page);
|
||||
unlock_page(page);
|
||||
page_cache_release(page);
|
||||
if (status)
|
||||
@@ -449,8 +440,8 @@ STATIC int /* error (positive) */
|
||||
xfs_zero_last_block(
|
||||
struct inode *ip,
|
||||
xfs_iocore_t *io,
|
||||
xfs_fsize_t isize,
|
||||
xfs_fsize_t end_size)
|
||||
xfs_fsize_t offset,
|
||||
xfs_fsize_t isize)
|
||||
{
|
||||
xfs_fileoff_t last_fsb;
|
||||
xfs_mount_t *mp = io->io_mount;
|
||||
@@ -459,7 +450,6 @@ xfs_zero_last_block(
|
||||
int zero_len;
|
||||
int error = 0;
|
||||
xfs_bmbt_irec_t imap;
|
||||
loff_t loff;
|
||||
|
||||
ASSERT(ismrlocked(io->io_lock, MR_UPDATE) != 0);
|
||||
|
||||
@@ -494,9 +484,10 @@ xfs_zero_last_block(
|
||||
*/
|
||||
XFS_IUNLOCK(mp, io, XFS_ILOCK_EXCL| XFS_EXTSIZE_RD);
|
||||
|
||||
loff = XFS_FSB_TO_B(mp, last_fsb);
|
||||
zero_len = mp->m_sb.sb_blocksize - zero_offset;
|
||||
error = xfs_iozero(ip, loff + zero_offset, zero_len, end_size);
|
||||
if (isize + zero_len > offset)
|
||||
zero_len = offset - isize;
|
||||
error = xfs_iozero(ip, isize, zero_len);
|
||||
|
||||
XFS_ILOCK(mp, io, XFS_ILOCK_EXCL|XFS_EXTSIZE_RD);
|
||||
ASSERT(error >= 0);
|
||||
@@ -519,14 +510,15 @@ xfs_zero_eof(
|
||||
bhv_vnode_t *vp,
|
||||
xfs_iocore_t *io,
|
||||
xfs_off_t offset, /* starting I/O offset */
|
||||
xfs_fsize_t isize, /* current inode size */
|
||||
xfs_fsize_t end_size) /* terminal inode size */
|
||||
xfs_fsize_t isize) /* current inode size */
|
||||
{
|
||||
struct inode *ip = vn_to_inode(vp);
|
||||
xfs_fileoff_t start_zero_fsb;
|
||||
xfs_fileoff_t end_zero_fsb;
|
||||
xfs_fileoff_t zero_count_fsb;
|
||||
xfs_fileoff_t last_fsb;
|
||||
xfs_fileoff_t zero_off;
|
||||
xfs_fsize_t zero_len;
|
||||
xfs_mount_t *mp = io->io_mount;
|
||||
int nimaps;
|
||||
int error = 0;
|
||||
@@ -540,7 +532,7 @@ xfs_zero_eof(
|
||||
* First handle zeroing the block on which isize resides.
|
||||
* We only zero a part of that block so it is handled specially.
|
||||
*/
|
||||
error = xfs_zero_last_block(ip, io, isize, end_size);
|
||||
error = xfs_zero_last_block(ip, io, offset, isize);
|
||||
if (error) {
|
||||
ASSERT(ismrlocked(io->io_lock, MR_UPDATE));
|
||||
ASSERT(ismrlocked(io->io_iolock, MR_UPDATE));
|
||||
@@ -601,10 +593,13 @@ xfs_zero_eof(
|
||||
*/
|
||||
XFS_IUNLOCK(mp, io, XFS_ILOCK_EXCL|XFS_EXTSIZE_RD);
|
||||
|
||||
error = xfs_iozero(ip,
|
||||
XFS_FSB_TO_B(mp, start_zero_fsb),
|
||||
XFS_FSB_TO_B(mp, imap.br_blockcount),
|
||||
end_size);
|
||||
zero_off = XFS_FSB_TO_B(mp, start_zero_fsb);
|
||||
zero_len = XFS_FSB_TO_B(mp, imap.br_blockcount);
|
||||
|
||||
if ((zero_off + zero_len) > offset)
|
||||
zero_len = offset - zero_off;
|
||||
|
||||
error = xfs_iozero(ip, zero_off, zero_len);
|
||||
if (error) {
|
||||
goto out_lock;
|
||||
}
|
||||
@@ -783,8 +778,7 @@ start:
|
||||
*/
|
||||
|
||||
if (pos > isize) {
|
||||
error = xfs_zero_eof(BHV_TO_VNODE(bdp), io, pos,
|
||||
isize, pos + count);
|
||||
error = xfs_zero_eof(BHV_TO_VNODE(bdp), io, pos, isize);
|
||||
if (error) {
|
||||
xfs_iunlock(xip, XFS_ILOCK_EXCL|iolock);
|
||||
goto out_unlock_mutex;
|
||||
|
||||
@@ -83,7 +83,7 @@ extern int xfs_bdstrat_cb(struct xfs_buf *);
|
||||
extern int xfs_dev_is_read_only(struct xfs_mount *, char *);
|
||||
|
||||
extern int xfs_zero_eof(struct bhv_vnode *, struct xfs_iocore *, xfs_off_t,
|
||||
xfs_fsize_t, xfs_fsize_t);
|
||||
xfs_fsize_t);
|
||||
extern ssize_t xfs_read(struct bhv_desc *, struct kiocb *,
|
||||
const struct iovec *, unsigned int,
|
||||
loff_t *, int, struct cred *);
|
||||
|
||||
@@ -43,8 +43,6 @@
|
||||
#include "xfs_itable.h"
|
||||
#include "xfs_rw.h"
|
||||
#include "xfs_acl.h"
|
||||
#include "xfs_cap.h"
|
||||
#include "xfs_mac.h"
|
||||
#include "xfs_attr.h"
|
||||
#include "xfs_buf_item.h"
|
||||
#include "xfs_utils.h"
|
||||
@@ -58,10 +56,10 @@
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/freezer.h>
|
||||
|
||||
STATIC struct quotactl_ops xfs_quotactl_operations;
|
||||
STATIC struct super_operations xfs_super_operations;
|
||||
STATIC kmem_zone_t *xfs_vnode_zone;
|
||||
STATIC kmem_zone_t *xfs_ioend_zone;
|
||||
static struct quotactl_ops xfs_quotactl_operations;
|
||||
static struct super_operations xfs_super_operations;
|
||||
static kmem_zone_t *xfs_vnode_zone;
|
||||
static kmem_zone_t *xfs_ioend_zone;
|
||||
mempool_t *xfs_ioend_pool;
|
||||
|
||||
STATIC struct xfs_mount_args *
|
||||
@@ -121,7 +119,7 @@ xfs_max_file_offset(
|
||||
return (((__uint64_t)pagefactor) << bitshift) - 1;
|
||||
}
|
||||
|
||||
STATIC __inline__ void
|
||||
STATIC_INLINE void
|
||||
xfs_set_inodeops(
|
||||
struct inode *inode)
|
||||
{
|
||||
@@ -147,7 +145,7 @@ xfs_set_inodeops(
|
||||
}
|
||||
}
|
||||
|
||||
STATIC __inline__ void
|
||||
STATIC_INLINE void
|
||||
xfs_revalidate_inode(
|
||||
xfs_mount_t *mp,
|
||||
bhv_vnode_t *vp,
|
||||
@@ -553,7 +551,6 @@ vfs_sync_worker(
|
||||
error = bhv_vfs_sync(vfsp, SYNC_FSDATA | SYNC_BDFLUSH | \
|
||||
SYNC_ATTR | SYNC_REFCACHE, NULL);
|
||||
vfsp->vfs_sync_seq++;
|
||||
wmb();
|
||||
wake_up(&vfsp->vfs_wait_single_sync_task);
|
||||
}
|
||||
|
||||
@@ -659,9 +656,17 @@ xfs_fs_sync_super(
|
||||
int error;
|
||||
int flags;
|
||||
|
||||
if (unlikely(sb->s_frozen == SB_FREEZE_WRITE))
|
||||
flags = SYNC_QUIESCE;
|
||||
else
|
||||
if (unlikely(sb->s_frozen == SB_FREEZE_WRITE)) {
|
||||
/*
|
||||
* First stage of freeze - no more writers will make progress
|
||||
* now we are here, so we flush delwri and delalloc buffers
|
||||
* here, then wait for all I/O to complete. Data is frozen at
|
||||
* that point. Metadata is not frozen, transactions can still
|
||||
* occur here so don't bother flushing the buftarg (i.e
|
||||
* SYNC_QUIESCE) because it'll just get dirty again.
|
||||
*/
|
||||
flags = SYNC_FSDATA | SYNC_DELWRI | SYNC_WAIT | SYNC_IOWAIT;
|
||||
} else
|
||||
flags = SYNC_FSDATA | (wait ? SYNC_WAIT : 0);
|
||||
|
||||
error = bhv_vfs_sync(vfsp, flags, NULL);
|
||||
@@ -873,7 +878,7 @@ xfs_fs_get_sb(
|
||||
mnt);
|
||||
}
|
||||
|
||||
STATIC struct super_operations xfs_super_operations = {
|
||||
static struct super_operations xfs_super_operations = {
|
||||
.alloc_inode = xfs_fs_alloc_inode,
|
||||
.destroy_inode = xfs_fs_destroy_inode,
|
||||
.write_inode = xfs_fs_write_inode,
|
||||
@@ -887,7 +892,7 @@ STATIC struct super_operations xfs_super_operations = {
|
||||
.show_options = xfs_fs_show_options,
|
||||
};
|
||||
|
||||
STATIC struct quotactl_ops xfs_quotactl_operations = {
|
||||
static struct quotactl_ops xfs_quotactl_operations = {
|
||||
.quota_sync = xfs_fs_quotasync,
|
||||
.get_xstate = xfs_fs_getxstate,
|
||||
.set_xstate = xfs_fs_setxstate,
|
||||
|
||||
+184
-82
@@ -54,102 +54,204 @@ xfs_stats_clear_proc_handler(
|
||||
}
|
||||
#endif /* CONFIG_PROC_FS */
|
||||
|
||||
STATIC ctl_table xfs_table[] = {
|
||||
{XFS_RESTRICT_CHOWN, "restrict_chown", &xfs_params.restrict_chown.val,
|
||||
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
|
||||
&sysctl_intvec, NULL,
|
||||
&xfs_params.restrict_chown.min, &xfs_params.restrict_chown.max},
|
||||
|
||||
{XFS_SGID_INHERIT, "irix_sgid_inherit", &xfs_params.sgid_inherit.val,
|
||||
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
|
||||
&sysctl_intvec, NULL,
|
||||
&xfs_params.sgid_inherit.min, &xfs_params.sgid_inherit.max},
|
||||
|
||||
{XFS_SYMLINK_MODE, "irix_symlink_mode", &xfs_params.symlink_mode.val,
|
||||
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
|
||||
&sysctl_intvec, NULL,
|
||||
&xfs_params.symlink_mode.min, &xfs_params.symlink_mode.max},
|
||||
|
||||
{XFS_PANIC_MASK, "panic_mask", &xfs_params.panic_mask.val,
|
||||
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
|
||||
&sysctl_intvec, NULL,
|
||||
&xfs_params.panic_mask.min, &xfs_params.panic_mask.max},
|
||||
|
||||
{XFS_ERRLEVEL, "error_level", &xfs_params.error_level.val,
|
||||
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
|
||||
&sysctl_intvec, NULL,
|
||||
&xfs_params.error_level.min, &xfs_params.error_level.max},
|
||||
|
||||
{XFS_SYNCD_TIMER, "xfssyncd_centisecs", &xfs_params.syncd_timer.val,
|
||||
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
|
||||
&sysctl_intvec, NULL,
|
||||
&xfs_params.syncd_timer.min, &xfs_params.syncd_timer.max},
|
||||
|
||||
{XFS_INHERIT_SYNC, "inherit_sync", &xfs_params.inherit_sync.val,
|
||||
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
|
||||
&sysctl_intvec, NULL,
|
||||
&xfs_params.inherit_sync.min, &xfs_params.inherit_sync.max},
|
||||
|
||||
{XFS_INHERIT_NODUMP, "inherit_nodump", &xfs_params.inherit_nodump.val,
|
||||
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
|
||||
&sysctl_intvec, NULL,
|
||||
&xfs_params.inherit_nodump.min, &xfs_params.inherit_nodump.max},
|
||||
|
||||
{XFS_INHERIT_NOATIME, "inherit_noatime", &xfs_params.inherit_noatim.val,
|
||||
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
|
||||
&sysctl_intvec, NULL,
|
||||
&xfs_params.inherit_noatim.min, &xfs_params.inherit_noatim.max},
|
||||
|
||||
{XFS_BUF_TIMER, "xfsbufd_centisecs", &xfs_params.xfs_buf_timer.val,
|
||||
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
|
||||
&sysctl_intvec, NULL,
|
||||
&xfs_params.xfs_buf_timer.min, &xfs_params.xfs_buf_timer.max},
|
||||
|
||||
{XFS_BUF_AGE, "age_buffer_centisecs", &xfs_params.xfs_buf_age.val,
|
||||
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
|
||||
&sysctl_intvec, NULL,
|
||||
&xfs_params.xfs_buf_age.min, &xfs_params.xfs_buf_age.max},
|
||||
|
||||
{XFS_INHERIT_NOSYM, "inherit_nosymlinks", &xfs_params.inherit_nosym.val,
|
||||
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
|
||||
&sysctl_intvec, NULL,
|
||||
&xfs_params.inherit_nosym.min, &xfs_params.inherit_nosym.max},
|
||||
|
||||
{XFS_ROTORSTEP, "rotorstep", &xfs_params.rotorstep.val,
|
||||
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
|
||||
&sysctl_intvec, NULL,
|
||||
&xfs_params.rotorstep.min, &xfs_params.rotorstep.max},
|
||||
|
||||
{XFS_INHERIT_NODFRG, "inherit_nodefrag", &xfs_params.inherit_nodfrg.val,
|
||||
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
|
||||
&sysctl_intvec, NULL,
|
||||
&xfs_params.inherit_nodfrg.min, &xfs_params.inherit_nodfrg.max},
|
||||
static ctl_table xfs_table[] = {
|
||||
{
|
||||
.ctl_name = XFS_RESTRICT_CHOWN,
|
||||
.procname = "restrict_chown",
|
||||
.data = &xfs_params.restrict_chown.val,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &proc_dointvec_minmax,
|
||||
.strategy = &sysctl_intvec,
|
||||
.extra1 = &xfs_params.restrict_chown.min,
|
||||
.extra2 = &xfs_params.restrict_chown.max
|
||||
},
|
||||
{
|
||||
.ctl_name = XFS_SGID_INHERIT,
|
||||
.procname = "irix_sgid_inherit",
|
||||
.data = &xfs_params.sgid_inherit.val,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &proc_dointvec_minmax,
|
||||
.strategy = &sysctl_intvec,
|
||||
.extra1 = &xfs_params.sgid_inherit.min,
|
||||
.extra2 = &xfs_params.sgid_inherit.max
|
||||
},
|
||||
{
|
||||
.ctl_name = XFS_SYMLINK_MODE,
|
||||
.procname = "irix_symlink_mode",
|
||||
.data = &xfs_params.symlink_mode.val,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &proc_dointvec_minmax,
|
||||
.strategy = &sysctl_intvec,
|
||||
.extra1 = &xfs_params.symlink_mode.min,
|
||||
.extra2 = &xfs_params.symlink_mode.max
|
||||
},
|
||||
{
|
||||
.ctl_name = XFS_PANIC_MASK,
|
||||
.procname = "panic_mask",
|
||||
.data = &xfs_params.panic_mask.val,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &proc_dointvec_minmax,
|
||||
.strategy = &sysctl_intvec,
|
||||
.extra1 = &xfs_params.panic_mask.min,
|
||||
.extra2 = &xfs_params.panic_mask.max
|
||||
},
|
||||
|
||||
{
|
||||
.ctl_name = XFS_ERRLEVEL,
|
||||
.procname = "error_level",
|
||||
.data = &xfs_params.error_level.val,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &proc_dointvec_minmax,
|
||||
.strategy = &sysctl_intvec,
|
||||
.extra1 = &xfs_params.error_level.min,
|
||||
.extra2 = &xfs_params.error_level.max
|
||||
},
|
||||
{
|
||||
.ctl_name = XFS_SYNCD_TIMER,
|
||||
.procname = "xfssyncd_centisecs",
|
||||
.data = &xfs_params.syncd_timer.val,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &proc_dointvec_minmax,
|
||||
.strategy = &sysctl_intvec,
|
||||
.extra1 = &xfs_params.syncd_timer.min,
|
||||
.extra2 = &xfs_params.syncd_timer.max
|
||||
},
|
||||
{
|
||||
.ctl_name = XFS_INHERIT_SYNC,
|
||||
.procname = "inherit_sync",
|
||||
.data = &xfs_params.inherit_sync.val,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &proc_dointvec_minmax,
|
||||
.strategy = &sysctl_intvec,
|
||||
.extra1 = &xfs_params.inherit_sync.min,
|
||||
.extra2 = &xfs_params.inherit_sync.max
|
||||
},
|
||||
{
|
||||
.ctl_name = XFS_INHERIT_NODUMP,
|
||||
.procname = "inherit_nodump",
|
||||
.data = &xfs_params.inherit_nodump.val,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &proc_dointvec_minmax,
|
||||
.strategy = &sysctl_intvec,
|
||||
.extra1 = &xfs_params.inherit_nodump.min,
|
||||
.extra2 = &xfs_params.inherit_nodump.max
|
||||
},
|
||||
{
|
||||
.ctl_name = XFS_INHERIT_NOATIME,
|
||||
.procname = "inherit_noatime",
|
||||
.data = &xfs_params.inherit_noatim.val,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &proc_dointvec_minmax,
|
||||
.strategy = &sysctl_intvec,
|
||||
.extra1 = &xfs_params.inherit_noatim.min,
|
||||
.extra2 = &xfs_params.inherit_noatim.max
|
||||
},
|
||||
{
|
||||
.ctl_name = XFS_BUF_TIMER,
|
||||
.procname = "xfsbufd_centisecs",
|
||||
.data = &xfs_params.xfs_buf_timer.val,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &proc_dointvec_minmax,
|
||||
.strategy = &sysctl_intvec,
|
||||
.extra1 = &xfs_params.xfs_buf_timer.min,
|
||||
.extra2 = &xfs_params.xfs_buf_timer.max
|
||||
},
|
||||
{
|
||||
.ctl_name = XFS_BUF_AGE,
|
||||
.procname = "age_buffer_centisecs",
|
||||
.data = &xfs_params.xfs_buf_age.val,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &proc_dointvec_minmax,
|
||||
.strategy = &sysctl_intvec,
|
||||
.extra1 = &xfs_params.xfs_buf_age.min,
|
||||
.extra2 = &xfs_params.xfs_buf_age.max
|
||||
},
|
||||
{
|
||||
.ctl_name = XFS_INHERIT_NOSYM,
|
||||
.procname = "inherit_nosymlinks",
|
||||
.data = &xfs_params.inherit_nosym.val,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &proc_dointvec_minmax,
|
||||
.strategy = &sysctl_intvec,
|
||||
.extra1 = &xfs_params.inherit_nosym.min,
|
||||
.extra2 = &xfs_params.inherit_nosym.max
|
||||
},
|
||||
{
|
||||
.ctl_name = XFS_ROTORSTEP,
|
||||
.procname = "rotorstep",
|
||||
.data = &xfs_params.rotorstep.val,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &proc_dointvec_minmax,
|
||||
.strategy = &sysctl_intvec,
|
||||
.extra1 = &xfs_params.rotorstep.min,
|
||||
.extra2 = &xfs_params.rotorstep.max
|
||||
},
|
||||
{
|
||||
.ctl_name = XFS_INHERIT_NODFRG,
|
||||
.procname = "inherit_nodefrag",
|
||||
.data = &xfs_params.inherit_nodfrg.val,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &proc_dointvec_minmax,
|
||||
.strategy = &sysctl_intvec,
|
||||
.extra1 = &xfs_params.inherit_nodfrg.min,
|
||||
.extra2 = &xfs_params.inherit_nodfrg.max
|
||||
},
|
||||
/* please keep this the last entry */
|
||||
#ifdef CONFIG_PROC_FS
|
||||
{XFS_STATS_CLEAR, "stats_clear", &xfs_params.stats_clear.val,
|
||||
sizeof(int), 0644, NULL, &xfs_stats_clear_proc_handler,
|
||||
&sysctl_intvec, NULL,
|
||||
&xfs_params.stats_clear.min, &xfs_params.stats_clear.max},
|
||||
{
|
||||
.ctl_name = XFS_STATS_CLEAR,
|
||||
.procname = "stats_clear",
|
||||
.data = &xfs_params.stats_clear.val,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &xfs_stats_clear_proc_handler,
|
||||
.strategy = &sysctl_intvec,
|
||||
.extra1 = &xfs_params.stats_clear.min,
|
||||
.extra2 = &xfs_params.stats_clear.max
|
||||
},
|
||||
#endif /* CONFIG_PROC_FS */
|
||||
|
||||
{0}
|
||||
{}
|
||||
};
|
||||
|
||||
STATIC ctl_table xfs_dir_table[] = {
|
||||
{FS_XFS, "xfs", NULL, 0, 0555, xfs_table},
|
||||
{0}
|
||||
static ctl_table xfs_dir_table[] = {
|
||||
{
|
||||
.ctl_name = FS_XFS,
|
||||
.procname = "xfs",
|
||||
.mode = 0555,
|
||||
.child = xfs_table
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
STATIC ctl_table xfs_root_table[] = {
|
||||
{CTL_FS, "fs", NULL, 0, 0555, xfs_dir_table},
|
||||
{0}
|
||||
static ctl_table xfs_root_table[] = {
|
||||
{
|
||||
.ctl_name = CTL_FS,
|
||||
.procname = "fs",
|
||||
.mode = 0555,
|
||||
.child = xfs_dir_table
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
void
|
||||
xfs_sysctl_register(void)
|
||||
{
|
||||
xfs_table_header = register_sysctl_table(xfs_root_table, 1);
|
||||
xfs_table_header = register_sysctl_table(xfs_root_table, 0);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -91,7 +91,7 @@ typedef enum {
|
||||
#define SYNC_FSDATA 0x0020 /* flush fs data (e.g. superblocks) */
|
||||
#define SYNC_REFCACHE 0x0040 /* prune some of the nfs ref cache */
|
||||
#define SYNC_REMOUNT 0x0080 /* remount readonly, no dummy LRs */
|
||||
#define SYNC_QUIESCE 0x0100 /* quiesce fileystem for a snapshot */
|
||||
#define SYNC_IOWAIT 0x0100 /* wait for all I/O to complete */
|
||||
|
||||
#define SHUTDOWN_META_IO_ERROR 0x0001 /* write attempt to metadata failed */
|
||||
#define SHUTDOWN_LOG_IO_ERROR 0x0002 /* write attempt to the log failed */
|
||||
|
||||
@@ -26,7 +26,7 @@ DEFINE_SPINLOCK(vnumber_lock);
|
||||
*/
|
||||
#define NVSYNC 37
|
||||
#define vptosync(v) (&vsync[((unsigned long)v) % NVSYNC])
|
||||
STATIC wait_queue_head_t vsync[NVSYNC];
|
||||
static wait_queue_head_t vsync[NVSYNC];
|
||||
|
||||
void
|
||||
vn_init(void)
|
||||
|
||||
@@ -489,14 +489,14 @@ static inline struct bhv_vnode *vn_grab(struct bhv_vnode *vp)
|
||||
#define VN_LOCK(vp) mutex_spinlock(&(vp)->v_lock)
|
||||
#define VN_UNLOCK(vp, s) mutex_spinunlock(&(vp)->v_lock, s)
|
||||
|
||||
static __inline__ void vn_flagset(struct bhv_vnode *vp, uint flag)
|
||||
STATIC_INLINE void vn_flagset(struct bhv_vnode *vp, uint flag)
|
||||
{
|
||||
spin_lock(&vp->v_lock);
|
||||
vp->v_flag |= flag;
|
||||
spin_unlock(&vp->v_lock);
|
||||
}
|
||||
|
||||
static __inline__ uint vn_flagclr(struct bhv_vnode *vp, uint flag)
|
||||
STATIC_INLINE uint vn_flagclr(struct bhv_vnode *vp, uint flag)
|
||||
{
|
||||
uint cleared;
|
||||
|
||||
|
||||
@@ -43,8 +43,6 @@
|
||||
#include "xfs_itable.h"
|
||||
#include "xfs_rw.h"
|
||||
#include "xfs_acl.h"
|
||||
#include "xfs_cap.h"
|
||||
#include "xfs_mac.h"
|
||||
#include "xfs_attr.h"
|
||||
#include "xfs_buf_item.h"
|
||||
#include "xfs_trans_space.h"
|
||||
@@ -484,7 +482,7 @@ xfs_qm_dqalloc(
|
||||
|
||||
xfs_trans_bhold(tp, bp);
|
||||
|
||||
if ((error = xfs_bmap_finish(tpp, &flist, firstblock, &committed))) {
|
||||
if ((error = xfs_bmap_finish(tpp, &flist, &committed))) {
|
||||
goto error1;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,8 +43,6 @@
|
||||
#include "xfs_itable.h"
|
||||
#include "xfs_rw.h"
|
||||
#include "xfs_acl.h"
|
||||
#include "xfs_cap.h"
|
||||
#include "xfs_mac.h"
|
||||
#include "xfs_attr.h"
|
||||
#include "xfs_buf_item.h"
|
||||
#include "xfs_trans_priv.h"
|
||||
@@ -399,7 +397,7 @@ xfs_qm_dquot_logitem_committing(
|
||||
/*
|
||||
* This is the ops vector for dquots
|
||||
*/
|
||||
STATIC struct xfs_item_ops xfs_dquot_item_ops = {
|
||||
static struct xfs_item_ops xfs_dquot_item_ops = {
|
||||
.iop_size = (uint(*)(xfs_log_item_t*))xfs_qm_dquot_logitem_size,
|
||||
.iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*))
|
||||
xfs_qm_dquot_logitem_format,
|
||||
@@ -606,7 +604,7 @@ xfs_qm_qoffend_logitem_committing(xfs_qoff_logitem_t *qip, xfs_lsn_t commit_lsn)
|
||||
return;
|
||||
}
|
||||
|
||||
STATIC struct xfs_item_ops xfs_qm_qoffend_logitem_ops = {
|
||||
static struct xfs_item_ops xfs_qm_qoffend_logitem_ops = {
|
||||
.iop_size = (uint(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_size,
|
||||
.iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*))
|
||||
xfs_qm_qoff_logitem_format,
|
||||
@@ -628,7 +626,7 @@ STATIC struct xfs_item_ops xfs_qm_qoffend_logitem_ops = {
|
||||
/*
|
||||
* This is the ops vector shared by all quotaoff-start log items.
|
||||
*/
|
||||
STATIC struct xfs_item_ops xfs_qm_qoff_logitem_ops = {
|
||||
static struct xfs_item_ops xfs_qm_qoff_logitem_ops = {
|
||||
.iop_size = (uint(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_size,
|
||||
.iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*))
|
||||
xfs_qm_qoff_logitem_format,
|
||||
|
||||
@@ -44,8 +44,6 @@
|
||||
#include "xfs_bmap.h"
|
||||
#include "xfs_rw.h"
|
||||
#include "xfs_acl.h"
|
||||
#include "xfs_cap.h"
|
||||
#include "xfs_mac.h"
|
||||
#include "xfs_attr.h"
|
||||
#include "xfs_buf_item.h"
|
||||
#include "xfs_trans_space.h"
|
||||
@@ -64,10 +62,10 @@ uint ndquot;
|
||||
|
||||
kmem_zone_t *qm_dqzone;
|
||||
kmem_zone_t *qm_dqtrxzone;
|
||||
STATIC kmem_shaker_t xfs_qm_shaker;
|
||||
static kmem_shaker_t xfs_qm_shaker;
|
||||
|
||||
STATIC cred_t xfs_zerocr;
|
||||
STATIC xfs_inode_t xfs_zeroino;
|
||||
static cred_t xfs_zerocr;
|
||||
static xfs_inode_t xfs_zeroino;
|
||||
|
||||
STATIC void xfs_qm_list_init(xfs_dqlist_t *, char *, int);
|
||||
STATIC void xfs_qm_list_destroy(xfs_dqlist_t *);
|
||||
|
||||
@@ -44,8 +44,6 @@
|
||||
#include "xfs_error.h"
|
||||
#include "xfs_rw.h"
|
||||
#include "xfs_acl.h"
|
||||
#include "xfs_cap.h"
|
||||
#include "xfs_mac.h"
|
||||
#include "xfs_attr.h"
|
||||
#include "xfs_buf_item.h"
|
||||
#include "xfs_qm.h"
|
||||
@@ -384,7 +382,7 @@ xfs_qm_dqrele_null(
|
||||
}
|
||||
|
||||
|
||||
STATIC struct xfs_qmops xfs_qmcore_xfs = {
|
||||
static struct xfs_qmops xfs_qmcore_xfs = {
|
||||
.xfs_qminit = xfs_qm_newmount,
|
||||
.xfs_qmdone = xfs_qm_unmount_quotadestroy,
|
||||
.xfs_qmmount = xfs_qm_endmount,
|
||||
|
||||
@@ -43,8 +43,6 @@
|
||||
#include "xfs_error.h"
|
||||
#include "xfs_rw.h"
|
||||
#include "xfs_acl.h"
|
||||
#include "xfs_cap.h"
|
||||
#include "xfs_mac.h"
|
||||
#include "xfs_attr.h"
|
||||
#include "xfs_buf_item.h"
|
||||
#include "xfs_qm.h"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user