瀏覽代碼

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6:
  JFS: Fix race waking up jfsIO kernel thread
  JFS: use __set_current_state()
  Copy i_flags to jfs inode flags on write
  JFS: document uid, gid, and umask mount options in jfs.txt
Linus Torvalds 18 年之前
父節點
當前提交
18062a91d2
共有 9 個文件被更改,包括 38 次插入9 次删除
  1. 7 1
      Documentation/filesystems/jfs.txt
  2. 0 1
      fs/jfs/inode.c
  3. 2 0
      fs/jfs/ioctl.c
  4. 2 0
      fs/jfs/jfs_imap.c
  5. 18 0
      fs/jfs/jfs_inode.c
  6. 1 0
      fs/jfs/jfs_inode.h
  7. 1 1
      fs/jfs/jfs_lock.h
  8. 4 3
      fs/jfs/jfs_logmgr.c
  9. 3 3
      fs/jfs/jfs_txnmgr.c

+ 7 - 1
Documentation/filesystems/jfs.txt

@@ -29,7 +29,13 @@ errors=continue		Keep going on a filesystem error.
 errors=remount-ro	Default. Remount the filesystem read-only on an error.
 errors=remount-ro	Default. Remount the filesystem read-only on an error.
 errors=panic		Panic and halt the machine if an error occurs.
 errors=panic		Panic and halt the machine if an error occurs.
 
 
-Please send bugs, comments, cards and letters to shaggy@austin.ibm.com.
+uid=value	Override on-disk uid with specified value
+gid=value	Override on-disk gid with specified value
+umask=value	Override on-disk umask with specified octal value.  For
+		directories, the execute bit will be set if the corresponding
+		read bit is set.
+
+Please send bugs, comments, cards and letters to shaggy@linux.vnet.ibm.com.
 
 
 The JFS mailing list can be subscribed to by using the link labeled
 The JFS mailing list can be subscribed to by using the link labeled
 "Mail list Subscribe" at our web page http://jfs.sourceforge.net/
 "Mail list Subscribe" at our web page http://jfs.sourceforge.net/

+ 0 - 1
fs/jfs/inode.c

@@ -55,7 +55,6 @@ void jfs_read_inode(struct inode *inode)
 		inode->i_op = &jfs_file_inode_operations;
 		inode->i_op = &jfs_file_inode_operations;
 		init_special_inode(inode, inode->i_mode, inode->i_rdev);
 		init_special_inode(inode, inode->i_mode, inode->i_rdev);
 	}
 	}
-	jfs_set_inode_flags(inode);
 }
 }
 
 
 /*
 /*

+ 2 - 0
fs/jfs/ioctl.c

@@ -59,6 +59,7 @@ int jfs_ioctl(struct inode * inode, struct file * filp, unsigned int cmd,
 
 
 	switch (cmd) {
 	switch (cmd) {
 	case JFS_IOC_GETFLAGS:
 	case JFS_IOC_GETFLAGS:
+		jfs_get_inode_flags(jfs_inode);
 		flags = jfs_inode->mode2 & JFS_FL_USER_VISIBLE;
 		flags = jfs_inode->mode2 & JFS_FL_USER_VISIBLE;
 		flags = jfs_map_ext2(flags, 0);
 		flags = jfs_map_ext2(flags, 0);
 		return put_user(flags, (int __user *) arg);
 		return put_user(flags, (int __user *) arg);
@@ -78,6 +79,7 @@ int jfs_ioctl(struct inode * inode, struct file * filp, unsigned int cmd,
 		if (!S_ISDIR(inode->i_mode))
 		if (!S_ISDIR(inode->i_mode))
 			flags &= ~JFS_DIRSYNC_FL;
 			flags &= ~JFS_DIRSYNC_FL;
 
 
+		jfs_get_inode_flags(jfs_inode);
 		oldflags = jfs_inode->mode2;
 		oldflags = jfs_inode->mode2;
 
 
 		/*
 		/*

+ 2 - 0
fs/jfs/jfs_imap.c

@@ -3078,6 +3078,7 @@ static int copy_from_dinode(struct dinode * dip, struct inode *ip)
 
 
 	jfs_ip->fileset = le32_to_cpu(dip->di_fileset);
 	jfs_ip->fileset = le32_to_cpu(dip->di_fileset);
 	jfs_ip->mode2 = le32_to_cpu(dip->di_mode);
 	jfs_ip->mode2 = le32_to_cpu(dip->di_mode);
+	jfs_set_inode_flags(ip);
 
 
 	ip->i_mode = le32_to_cpu(dip->di_mode) & 0xffff;
 	ip->i_mode = le32_to_cpu(dip->di_mode) & 0xffff;
 	if (sbi->umask != -1) {
 	if (sbi->umask != -1) {
@@ -3174,6 +3175,7 @@ static void copy_to_dinode(struct dinode * dip, struct inode *ip)
 		dip->di_gid = cpu_to_le32(ip->i_gid);
 		dip->di_gid = cpu_to_le32(ip->i_gid);
 	else
 	else
 		dip->di_gid = cpu_to_le32(jfs_ip->saved_gid);
 		dip->di_gid = cpu_to_le32(jfs_ip->saved_gid);
+	jfs_get_inode_flags(jfs_ip);
 	/*
 	/*
 	 * mode2 is only needed for storing the higher order bits.
 	 * mode2 is only needed for storing the higher order bits.
 	 * Trust i_mode for the lower order ones
 	 * Trust i_mode for the lower order ones

+ 18 - 0
fs/jfs/jfs_inode.c

@@ -45,6 +45,24 @@ void jfs_set_inode_flags(struct inode *inode)
 		inode->i_flags |= S_SYNC;
 		inode->i_flags |= S_SYNC;
 }
 }
 
 
+void jfs_get_inode_flags(struct jfs_inode_info *jfs_ip)
+{
+	unsigned int flags = jfs_ip->vfs_inode.i_flags;
+
+	jfs_ip->mode2 &= ~(JFS_IMMUTABLE_FL | JFS_APPEND_FL | JFS_NOATIME_FL |
+			   JFS_DIRSYNC_FL | JFS_SYNC_FL);
+	if (flags & S_IMMUTABLE)
+		jfs_ip->mode2 |= JFS_IMMUTABLE_FL;
+	if (flags & S_APPEND)
+		jfs_ip->mode2 |= JFS_APPEND_FL;
+	if (flags & S_NOATIME)
+		jfs_ip->mode2 |= JFS_NOATIME_FL;
+	if (flags & S_DIRSYNC)
+		jfs_ip->mode2 |= JFS_DIRSYNC_FL;
+	if (flags & S_SYNC)
+		jfs_ip->mode2 |= JFS_SYNC_FL;
+}
+
 /*
 /*
  * NAME:	ialloc()
  * NAME:	ialloc()
  *
  *

+ 1 - 0
fs/jfs/jfs_inode.h

@@ -31,6 +31,7 @@ extern void jfs_truncate(struct inode *);
 extern void jfs_truncate_nolock(struct inode *, loff_t);
 extern void jfs_truncate_nolock(struct inode *, loff_t);
 extern void jfs_free_zero_link(struct inode *);
 extern void jfs_free_zero_link(struct inode *);
 extern struct dentry *jfs_get_parent(struct dentry *dentry);
 extern struct dentry *jfs_get_parent(struct dentry *dentry);
+extern void jfs_get_inode_flags(struct jfs_inode_info *);
 extern void jfs_set_inode_flags(struct inode *);
 extern void jfs_set_inode_flags(struct inode *);
 extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
 extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
 
 

+ 1 - 1
fs/jfs/jfs_lock.h

@@ -45,7 +45,7 @@ do {							\
 		io_schedule();				\
 		io_schedule();				\
 		lock_cmd;				\
 		lock_cmd;				\
 	}						\
 	}						\
-	current->state = TASK_RUNNING;			\
+	__set_current_state(TASK_RUNNING);			\
 	remove_wait_queue(&wq, &__wait);		\
 	remove_wait_queue(&wq, &__wait);		\
 } while (0)
 } while (0)
 
 

+ 4 - 3
fs/jfs/jfs_logmgr.c

@@ -1589,7 +1589,7 @@ void jfs_flush_journal(struct jfs_log *log, int wait)
 		set_current_state(TASK_UNINTERRUPTIBLE);
 		set_current_state(TASK_UNINTERRUPTIBLE);
 		LOGGC_UNLOCK(log);
 		LOGGC_UNLOCK(log);
 		schedule();
 		schedule();
-		current->state = TASK_RUNNING;
+		__set_current_state(TASK_RUNNING);
 		LOGGC_LOCK(log);
 		LOGGC_LOCK(log);
 		remove_wait_queue(&target->gcwait, &__wait);
 		remove_wait_queue(&target->gcwait, &__wait);
 	}
 	}
@@ -2353,14 +2353,15 @@ int jfsIOWait(void *arg)
 			lbmStartIO(bp);
 			lbmStartIO(bp);
 			spin_lock_irq(&log_redrive_lock);
 			spin_lock_irq(&log_redrive_lock);
 		}
 		}
-		spin_unlock_irq(&log_redrive_lock);
 
 
 		if (freezing(current)) {
 		if (freezing(current)) {
+			spin_unlock_irq(&log_redrive_lock);
 			refrigerator();
 			refrigerator();
 		} else {
 		} else {
 			set_current_state(TASK_INTERRUPTIBLE);
 			set_current_state(TASK_INTERRUPTIBLE);
+			spin_unlock_irq(&log_redrive_lock);
 			schedule();
 			schedule();
-			current->state = TASK_RUNNING;
+			__set_current_state(TASK_RUNNING);
 		}
 		}
 	} while (!kthread_should_stop());
 	} while (!kthread_should_stop());
 
 

+ 3 - 3
fs/jfs/jfs_txnmgr.c

@@ -135,7 +135,7 @@ static inline void TXN_SLEEP_DROP_LOCK(wait_queue_head_t * event)
 	set_current_state(TASK_UNINTERRUPTIBLE);
 	set_current_state(TASK_UNINTERRUPTIBLE);
 	TXN_UNLOCK();
 	TXN_UNLOCK();
 	io_schedule();
 	io_schedule();
-	current->state = TASK_RUNNING;
+	__set_current_state(TASK_RUNNING);
 	remove_wait_queue(event, &wait);
 	remove_wait_queue(event, &wait);
 }
 }
 
 
@@ -2797,7 +2797,7 @@ int jfs_lazycommit(void *arg)
 			set_current_state(TASK_INTERRUPTIBLE);
 			set_current_state(TASK_INTERRUPTIBLE);
 			LAZY_UNLOCK(flags);
 			LAZY_UNLOCK(flags);
 			schedule();
 			schedule();
-			current->state = TASK_RUNNING;
+			__set_current_state(TASK_RUNNING);
 			remove_wait_queue(&jfs_commit_thread_wait, &wq);
 			remove_wait_queue(&jfs_commit_thread_wait, &wq);
 		}
 		}
 	} while (!kthread_should_stop());
 	} while (!kthread_should_stop());
@@ -2989,7 +2989,7 @@ int jfs_sync(void *arg)
 			set_current_state(TASK_INTERRUPTIBLE);
 			set_current_state(TASK_INTERRUPTIBLE);
 			TXN_UNLOCK();
 			TXN_UNLOCK();
 			schedule();
 			schedule();
-			current->state = TASK_RUNNING;
+			__set_current_state(TASK_RUNNING);
 		}
 		}
 	} while (!kthread_should_stop());
 	} while (!kthread_should_stop());