X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=fs%2Fufs%2Fnamei.c;h=8eca4eda8450a1bec00f80ea30964ea5c51f8286;hb=3873691e5ab34fa26948643d038a2b98c4437298;hp=a1559f762805390fbc9854859040d397aa42c208;hpb=89a82a9218fabd753979847f494565f1fa91d7a8;p=cascardo%2Flinux.git diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c index a1559f762805..8eca4eda8450 100644 --- a/fs/ufs/namei.c +++ b/fs/ufs/namei.c @@ -153,7 +153,7 @@ static int ufs_link (struct dentry * old_dentry, struct inode * dir, struct inode *inode = d_inode(old_dentry); int error; - inode->i_ctime = CURRENT_TIME_SEC; + inode->i_ctime = current_time(inode); inode_inc_link_count(inode); ihold(inode); @@ -245,7 +245,8 @@ static int ufs_rmdir (struct inode * dir, struct dentry *dentry) } static int ufs_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) { struct inode *old_inode = d_inode(old_dentry); struct inode *new_inode = d_inode(new_dentry); @@ -255,6 +256,9 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry, struct ufs_dir_entry *old_de; int err = -ENOENT; + if (flags & ~RENAME_NOREPLACE) + return -EINVAL; + old_de = ufs_find_entry(old_dir, &old_dentry->d_name, &old_page); if (!old_de) goto out; @@ -279,7 +283,7 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry, if (!new_de) goto out_dir; ufs_set_link(new_dir, new_de, new_page, old_inode, 1); - new_inode->i_ctime = CURRENT_TIME_SEC; + new_inode->i_ctime = current_time(new_inode); if (dir_de) drop_nlink(new_inode); inode_dec_link_count(new_inode); @@ -295,7 +299,7 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry, * Like most other Unix systems, set the ctime for inodes on a * rename. */ - old_inode->i_ctime = CURRENT_TIME_SEC; + old_inode->i_ctime = current_time(old_inode); ufs_delete_entry(old_dir, old_de, old_page); mark_inode_dirty(old_inode);