]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/utimes.c
Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
[linux-2.6-omap-h63xx.git] / fs / utimes.c
index 8e09dbdfd7f555b00ef2612ff4f3cc8e230756f0..6929e3e91d0579d28c6cd4453554a4c559236736 100644 (file)
@@ -64,10 +64,6 @@ static int utimes_common(struct path *path, struct timespec *times)
 
        newattrs.ia_valid = ATTR_CTIME | ATTR_MTIME | ATTR_ATIME;
        if (times) {
-               error = -EPERM;
-                if (IS_APPEND(inode) || IS_IMMUTABLE(inode))
-                       goto mnt_drop_write_and_out;
-
                if (times[0].tv_nsec == UTIME_OMIT)
                        newattrs.ia_valid &= ~ATTR_ATIME;
                else if (times[0].tv_nsec != UTIME_NOW) {
@@ -100,7 +96,7 @@ static int utimes_common(struct path *path, struct timespec *times)
                        goto mnt_drop_write_and_out;
 
                if (!is_owner_or_cap(inode)) {
-                       error = permission(inode, MAY_WRITE, NULL);
+                       error = inode_permission(inode, MAY_WRITE);
                        if (error)
                                goto mnt_drop_write_and_out;
                }
@@ -156,18 +152,18 @@ long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags
                error = utimes_common(&file->f_path, times);
                fput(file);
        } else {
-               struct nameidata nd;
+               struct path path;
                int lookup_flags = 0;
 
                if (!(flags & AT_SYMLINK_NOFOLLOW))
                        lookup_flags |= LOOKUP_FOLLOW;
 
-               error = __user_walk_fd(dfd, filename, lookup_flags, &nd);
+               error = user_path_at(dfd, filename, lookup_flags, &path);
                if (error)
                        goto out;
 
-               error = utimes_common(&nd.path, times);
-               path_put(&nd.path);
+               error = utimes_common(&path, times);
+               path_put(&path);
        }
 
 out: