summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2004-10-14 15:33:33 -0400
committerJeff Garzik <jgarzik@pobox.com>2004-10-14 15:33:33 -0400
commite58d2eb090023ea4b8e1fe0af2a1bb5314ecfdcb (patch)
treebfc1440ee2d3558f78c690d807b7bc788201b301 /fs
parent5c6f34a71be8749b386e5a773fea0f4784da6a51 (diff)
parent8b5915b08dda13ffe1f70f00322dcc34ce161904 (diff)
Merge pobox.com:/spare/repo/linux-2.6
into pobox.com:/spare/repo/libata-2.6
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/array.c6
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl.c6
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c19
-rw-r--r--fs/xfs/linux-2.6/xfs_vfs.h4
-rw-r--r--fs/xfs/xfs_fsops.c5
-rw-r--r--fs/xfs/xfs_log.c2
-rw-r--r--fs/xfs/xfs_trans.c2
7 files changed, 29 insertions, 15 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index fc5c7846df32..272908775622 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -360,7 +360,11 @@ int proc_pid_stat(struct task_struct *task, char * buffer)
read_unlock(&tasklist_lock);
/* Temporary variable needed for gcc-2.96 */
- start_time = jiffies_64_to_clock_t(task->start_time - INITIAL_JIFFIES);
+ /* convert timespec -> nsec*/
+ start_time = (unsigned long long)task->start_time.tv_sec * NSEC_PER_SEC
+ + task->start_time.tv_nsec;
+ /* convert nsec -> ticks */
+ start_time = nsec_to_clock_t(start_time);
res = sprintf(buffer,"%d (%s) %c %d %d %d %d %d %lu %lu \
%lu %lu %lu %lu %lu %ld %ld %ld %ld %d %ld %llu %lu %ld %lu %lu %lu %lu %lu \
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index ef764054fcdf..a5d382cff479 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -818,13 +818,15 @@ xfs_ioctl(
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- freeze_bdev(inode->i_sb->s_bdev);
+ if (inode->i_sb->s_frozen == SB_UNFROZEN)
+ freeze_bdev(inode->i_sb->s_bdev);
return 0;
case XFS_IOC_THAW:
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- thaw_bdev(inode->i_sb->s_bdev, inode->i_sb);
+ if (inode->i_sb->s_frozen != SB_UNFROZEN)
+ thaw_bdev(inode->i_sb->s_bdev, inode->i_sb);
return 0;
case XFS_IOC_GOINGDOWN: {
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index b59d034a8d12..854b656c98bc 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -339,16 +339,16 @@ linvfs_write_inode(
int sync)
{
vnode_t *vp = LINVFS_GET_VP(inode);
- int error, flags = FLUSH_INODE;
+ int error = 0, flags = FLUSH_INODE;
- error = 0;
if (vp) {
vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
if (sync)
flags |= FLUSH_SYNC;
VOP_IFLUSH(vp, flags, error);
}
- return error;
+
+ return -error;
}
STATIC void
@@ -491,8 +491,14 @@ xfssyncd(
break;
spin_lock(&vfsp->vfs_sync_lock);
- if (!timeleft) {
- timeleft = (xfs_syncd_centisecs * HZ) / 100;
+ /*
+ * We can get woken by laptop mode, to do a sync -
+ * that's the (only!) case where the list would be
+ * empty with time remaining.
+ */
+ if (!timeleft || list_empty(&vfsp->vfs_sync_list)) {
+ if (!timeleft)
+ timeleft = (xfs_syncd_centisecs * HZ) / 100;
INIT_LIST_HEAD(&vfsp->vfs_sync_work.w_list);
list_add_tail(&vfsp->vfs_sync_work.w_list,
&vfsp->vfs_sync_list);
@@ -595,9 +601,10 @@ linvfs_sync_super(
if (unlikely(laptop_mode)) {
int prev_sync_seq = vfsp->vfs_sync_seq;
+
/*
* The disk must be active because we're syncing.
- * We schedule syncd now (now that the disk is
+ * We schedule xfssyncd now (now that the disk is
* active) instead of later (when it might not be).
*/
wake_up_process(vfsp->vfs_sync_task);
diff --git a/fs/xfs/linux-2.6/xfs_vfs.h b/fs/xfs/linux-2.6/xfs_vfs.h
index 4de833f99ee3..aab70136c4e8 100644
--- a/fs/xfs/linux-2.6/xfs_vfs.h
+++ b/fs/xfs/linux-2.6/xfs_vfs.h
@@ -216,4 +216,8 @@ extern void bhv_insert_all_vfsops(struct vfs *);
extern void bhv_remove_all_vfsops(struct vfs *, int);
extern void bhv_remove_vfsops(struct vfs *, int);
+#define fs_frozen(vfsp) ((vfsp)->vfs_super->s_frozen)
+#define fs_check_frozen(vfsp, level) \
+ vfs_check_frozen(vfsp->vfs_super, level);
+
#endif /* __XFS_VFS_H__ */
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index 4e4e966d17ac..ebc2f27ce9e1 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -590,9 +590,6 @@ xfs_fs_goingdown(
xfs_mount_t *mp,
__uint32_t inflags)
{
- if (!capable(CAP_SYS_ADMIN))
- return -EPERM;
-
switch (inflags) {
case XFS_FSOP_GOING_FLAGS_DEFAULT: {
struct vfs *vfsp = XFS_MTOVFS(mp);
@@ -602,7 +599,7 @@ xfs_fs_goingdown(
xfs_force_shutdown(mp, XFS_FORCE_UMOUNT);
thaw_bdev(sb->s_bdev, sb);
}
-
+
break;
}
case XFS_FSOP_GOING_FLAGS_LOGFLUSH:
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 58117edbbc2f..7db33af12520 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -811,7 +811,7 @@ xfs_log_need_covered(xfs_mount_t *mp)
xlog_t *log = mp->m_log;
vfs_t *vfsp = XFS_MTOVFS(mp);
- if (vfsp->vfs_super->s_frozen || XFS_FORCED_SHUTDOWN(mp) ||
+ if (fs_frozen(vfsp) || XFS_FORCED_SHUTDOWN(mp) ||
(vfsp->vfs_flag & VFS_RDONLY))
return 0;
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index c2bbc9a2c8b8..3db0e2200775 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -131,7 +131,7 @@ xfs_trans_alloc(
xfs_mount_t *mp,
uint type)
{
- vfs_check_frozen(XFS_MTOVFS(mp)->vfs_super, SB_FREEZE_TRANS);
+ fs_check_frozen(XFS_MTOVFS(mp), SB_FREEZE_TRANS);
atomic_inc(&mp->m_active_trans);
return (_xfs_trans_alloc(mp, type));