diff options
Diffstat (limited to 'fs/qnx4/namei.c')
-rw-r--r-- | fs/qnx4/namei.c | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/fs/qnx4/namei.c b/fs/qnx4/namei.c index 5972ed214937..ae1e7edbacd6 100644 --- a/fs/qnx4/namei.c +++ b/fs/qnx4/namei.c | |||
@@ -134,108 +134,3 @@ out: | |||
134 | 134 | ||
135 | return NULL; | 135 | return NULL; |
136 | } | 136 | } |
137 | |||
138 | #ifdef CONFIG_QNX4FS_RW | ||
139 | int qnx4_create(struct inode *dir, struct dentry *dentry, int mode, | ||
140 | struct nameidata *nd) | ||
141 | { | ||
142 | QNX4DEBUG(("qnx4: qnx4_create\n")); | ||
143 | if (dir == NULL) { | ||
144 | return -ENOENT; | ||
145 | } | ||
146 | return -ENOSPC; | ||
147 | } | ||
148 | |||
149 | int qnx4_rmdir(struct inode *dir, struct dentry *dentry) | ||
150 | { | ||
151 | struct buffer_head *bh; | ||
152 | struct qnx4_inode_entry *de; | ||
153 | struct inode *inode; | ||
154 | int retval; | ||
155 | int ino; | ||
156 | |||
157 | QNX4DEBUG(("qnx4: qnx4_rmdir [%s]\n", dentry->d_name.name)); | ||
158 | lock_kernel(); | ||
159 | bh = qnx4_find_entry(dentry->d_name.len, dir, dentry->d_name.name, | ||
160 | &de, &ino); | ||
161 | if (bh == NULL) { | ||
162 | unlock_kernel(); | ||
163 | return -ENOENT; | ||
164 | } | ||
165 | inode = dentry->d_inode; | ||
166 | if (inode->i_ino != ino) { | ||
167 | retval = -EIO; | ||
168 | goto end_rmdir; | ||
169 | } | ||
170 | #if 0 | ||
171 | if (!empty_dir(inode)) { | ||
172 | retval = -ENOTEMPTY; | ||
173 | goto end_rmdir; | ||
174 | } | ||
175 | #endif | ||
176 | if (inode->i_nlink != 2) { | ||
177 | QNX4DEBUG(("empty directory has nlink!=2 (%d)\n", inode->i_nlink)); | ||
178 | } | ||
179 | QNX4DEBUG(("qnx4: deleting directory\n")); | ||
180 | de->di_status = 0; | ||
181 | memset(de->di_fname, 0, sizeof de->di_fname); | ||
182 | de->di_mode = 0; | ||
183 | mark_buffer_dirty_inode(bh, dir); | ||
184 | clear_nlink(inode); | ||
185 | mark_inode_dirty(inode); | ||
186 | inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; | ||
187 | inode_dec_link_count(dir); | ||
188 | retval = 0; | ||
189 | |||
190 | end_rmdir: | ||
191 | brelse(bh); | ||
192 | |||
193 | unlock_kernel(); | ||
194 | return retval; | ||
195 | } | ||
196 | |||
197 | int qnx4_unlink(struct inode *dir, struct dentry *dentry) | ||
198 | { | ||
199 | struct buffer_head *bh; | ||
200 | struct qnx4_inode_entry *de; | ||
201 | struct inode *inode; | ||
202 | int retval; | ||
203 | int ino; | ||
204 | |||
205 | QNX4DEBUG(("qnx4: qnx4_unlink [%s]\n", dentry->d_name.name)); | ||
206 | lock_kernel(); | ||
207 | bh = qnx4_find_entry(dentry->d_name.len, dir, dentry->d_name.name, | ||
208 | &de, &ino); | ||
209 | if (bh == NULL) { | ||
210 | unlock_kernel(); | ||
211 | return -ENOENT; | ||
212 | } | ||
213 | inode = dentry->d_inode; | ||
214 | if (inode->i_ino != ino) { | ||
215 | retval = -EIO; | ||
216 | goto end_unlink; | ||
217 | } | ||
218 | retval = -EPERM; | ||
219 | if (!inode->i_nlink) { | ||
220 | QNX4DEBUG(("Deleting nonexistent file (%s:%lu), %d\n", | ||
221 | inode->i_sb->s_id, | ||
222 | inode->i_ino, inode->i_nlink)); | ||
223 | inode->i_nlink = 1; | ||
224 | } | ||
225 | de->di_status = 0; | ||
226 | memset(de->di_fname, 0, sizeof de->di_fname); | ||
227 | de->di_mode = 0; | ||
228 | mark_buffer_dirty_inode(bh, dir); | ||
229 | dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; | ||
230 | mark_inode_dirty(dir); | ||
231 | inode->i_ctime = dir->i_ctime; | ||
232 | inode_dec_link_count(inode); | ||
233 | retval = 0; | ||
234 | |||
235 | end_unlink: | ||
236 | unlock_kernel(); | ||
237 | brelse(bh); | ||
238 | |||
239 | return retval; | ||
240 | } | ||
241 | #endif | ||