Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull more vfs updates from Al Viro: ">rename2() work from Miklos + current_time() from Deepa" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fs: Replace current_fs_time() with current_time() fs: Replace CURRENT_TIME_SEC with current_time() for inode timestamps fs: Replace CURRENT_TIME with current_time() for inode timestamps fs: proc: Delete inode time initializations in proc_alloc_inode() vfs: Add current_time() api vfs: add note about i_op->rename changes to porting fs: rename "rename2" i_op to "rename" vfs: remove unused i_op->rename fs: make remaining filesystems use .rename2 libfs: support RENAME_NOREPLACE in simple_rename() fs: support RENAME_NOREPLACE for local filesystems ncpfs: fix unused variable warning
这个提交包含在:
@@ -125,7 +125,7 @@ int hfs_cat_create(u32 cnid, struct inode *dir, const struct qstr *str, struct i
|
||||
goto err1;
|
||||
|
||||
dir->i_size++;
|
||||
dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
|
||||
dir->i_mtime = dir->i_ctime = current_time(dir);
|
||||
mark_inode_dirty(dir);
|
||||
hfs_find_exit(&fd);
|
||||
return 0;
|
||||
@@ -261,7 +261,7 @@ int hfs_cat_delete(u32 cnid, struct inode *dir, const struct qstr *str)
|
||||
}
|
||||
|
||||
dir->i_size--;
|
||||
dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
|
||||
dir->i_mtime = dir->i_ctime = current_time(dir);
|
||||
mark_inode_dirty(dir);
|
||||
res = 0;
|
||||
out:
|
||||
@@ -321,7 +321,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, const struct qstr *src_name,
|
||||
if (err)
|
||||
goto out;
|
||||
dst_dir->i_size++;
|
||||
dst_dir->i_mtime = dst_dir->i_ctime = CURRENT_TIME_SEC;
|
||||
dst_dir->i_mtime = dst_dir->i_ctime = current_time(dst_dir);
|
||||
mark_inode_dirty(dst_dir);
|
||||
|
||||
/* finally remove the old entry */
|
||||
@@ -333,7 +333,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, const struct qstr *src_name,
|
||||
if (err)
|
||||
goto out;
|
||||
src_dir->i_size--;
|
||||
src_dir->i_mtime = src_dir->i_ctime = CURRENT_TIME_SEC;
|
||||
src_dir->i_mtime = src_dir->i_ctime = current_time(src_dir);
|
||||
mark_inode_dirty(src_dir);
|
||||
|
||||
type = entry.type;
|
||||
|
@@ -268,7 +268,7 @@ static int hfs_remove(struct inode *dir, struct dentry *dentry)
|
||||
if (res)
|
||||
return res;
|
||||
clear_nlink(inode);
|
||||
inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = current_time(inode);
|
||||
hfs_delete_inode(inode);
|
||||
mark_inode_dirty(inode);
|
||||
return 0;
|
||||
@@ -286,10 +286,14 @@ static int hfs_remove(struct inode *dir, struct dentry *dentry)
|
||||
* XXX: how do you handle must_be dir?
|
||||
*/
|
||||
static int hfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry)
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
int res;
|
||||
|
||||
if (flags & ~RENAME_NOREPLACE)
|
||||
return -EINVAL;
|
||||
|
||||
/* Unlink destination if it already exists */
|
||||
if (d_really_is_positive(new_dentry)) {
|
||||
res = hfs_remove(new_dir, new_dentry);
|
||||
|
@@ -194,7 +194,7 @@ struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t
|
||||
inode->i_uid = current_fsuid();
|
||||
inode->i_gid = current_fsgid();
|
||||
set_nlink(inode, 1);
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
|
||||
HFS_I(inode)->flags = 0;
|
||||
HFS_I(inode)->rsrc_inode = NULL;
|
||||
HFS_I(inode)->fs_blocks = 0;
|
||||
|
在新工单中引用
屏蔽一个用户