diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /fs/ext2/ioctl.c | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'fs/ext2/ioctl.c')
-rw-r--r-- | fs/ext2/ioctl.c | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/fs/ext2/ioctl.c b/fs/ext2/ioctl.c index 2de655f5d62..f81e250ac5c 100644 --- a/fs/ext2/ioctl.c +++ b/fs/ext2/ioctl.c | |||
@@ -35,7 +35,7 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
35 | case EXT2_IOC_SETFLAGS: { | 35 | case EXT2_IOC_SETFLAGS: { |
36 | unsigned int oldflags; | 36 | unsigned int oldflags; |
37 | 37 | ||
38 | ret = mnt_want_write_file(filp); | 38 | ret = mnt_want_write(filp->f_path.mnt); |
39 | if (ret) | 39 | if (ret) |
40 | return ret; | 40 | return ret; |
41 | 41 | ||
@@ -77,41 +77,31 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
77 | flags = flags & EXT2_FL_USER_MODIFIABLE; | 77 | flags = flags & EXT2_FL_USER_MODIFIABLE; |
78 | flags |= oldflags & ~EXT2_FL_USER_MODIFIABLE; | 78 | flags |= oldflags & ~EXT2_FL_USER_MODIFIABLE; |
79 | ei->i_flags = flags; | 79 | ei->i_flags = flags; |
80 | mutex_unlock(&inode->i_mutex); | ||
80 | 81 | ||
81 | ext2_set_inode_flags(inode); | 82 | ext2_set_inode_flags(inode); |
82 | inode->i_ctime = CURRENT_TIME_SEC; | 83 | inode->i_ctime = CURRENT_TIME_SEC; |
83 | mutex_unlock(&inode->i_mutex); | ||
84 | |||
85 | mark_inode_dirty(inode); | 84 | mark_inode_dirty(inode); |
86 | setflags_out: | 85 | setflags_out: |
87 | mnt_drop_write_file(filp); | 86 | mnt_drop_write(filp->f_path.mnt); |
88 | return ret; | 87 | return ret; |
89 | } | 88 | } |
90 | case EXT2_IOC_GETVERSION: | 89 | case EXT2_IOC_GETVERSION: |
91 | return put_user(inode->i_generation, (int __user *) arg); | 90 | return put_user(inode->i_generation, (int __user *) arg); |
92 | case EXT2_IOC_SETVERSION: { | 91 | case EXT2_IOC_SETVERSION: |
93 | __u32 generation; | ||
94 | |||
95 | if (!inode_owner_or_capable(inode)) | 92 | if (!inode_owner_or_capable(inode)) |
96 | return -EPERM; | 93 | return -EPERM; |
97 | ret = mnt_want_write_file(filp); | 94 | ret = mnt_want_write(filp->f_path.mnt); |
98 | if (ret) | 95 | if (ret) |
99 | return ret; | 96 | return ret; |
100 | if (get_user(generation, (int __user *) arg)) { | 97 | if (get_user(inode->i_generation, (int __user *) arg)) { |
101 | ret = -EFAULT; | 98 | ret = -EFAULT; |
102 | goto setversion_out; | 99 | } else { |
100 | inode->i_ctime = CURRENT_TIME_SEC; | ||
101 | mark_inode_dirty(inode); | ||
103 | } | 102 | } |
104 | 103 | mnt_drop_write(filp->f_path.mnt); | |
105 | mutex_lock(&inode->i_mutex); | ||
106 | inode->i_ctime = CURRENT_TIME_SEC; | ||
107 | inode->i_generation = generation; | ||
108 | mutex_unlock(&inode->i_mutex); | ||
109 | |||
110 | mark_inode_dirty(inode); | ||
111 | setversion_out: | ||
112 | mnt_drop_write_file(filp); | ||
113 | return ret; | 104 | return ret; |
114 | } | ||
115 | case EXT2_IOC_GETRSVSZ: | 105 | case EXT2_IOC_GETRSVSZ: |
116 | if (test_opt(inode->i_sb, RESERVATION) | 106 | if (test_opt(inode->i_sb, RESERVATION) |
117 | && S_ISREG(inode->i_mode) | 107 | && S_ISREG(inode->i_mode) |
@@ -131,7 +121,7 @@ setversion_out: | |||
131 | if (get_user(rsv_window_size, (int __user *)arg)) | 121 | if (get_user(rsv_window_size, (int __user *)arg)) |
132 | return -EFAULT; | 122 | return -EFAULT; |
133 | 123 | ||
134 | ret = mnt_want_write_file(filp); | 124 | ret = mnt_want_write(filp->f_path.mnt); |
135 | if (ret) | 125 | if (ret) |
136 | return ret; | 126 | return ret; |
137 | 127 | ||
@@ -155,7 +145,7 @@ setversion_out: | |||
155 | rsv->rsv_goal_size = rsv_window_size; | 145 | rsv->rsv_goal_size = rsv_window_size; |
156 | } | 146 | } |
157 | mutex_unlock(&ei->truncate_mutex); | 147 | mutex_unlock(&ei->truncate_mutex); |
158 | mnt_drop_write_file(filp); | 148 | mnt_drop_write(filp->f_path.mnt); |
159 | return 0; | 149 | return 0; |
160 | } | 150 | } |
161 | default: | 151 | default: |