Lines Matching +full:de +full:- +full:be
1 // SPDX-License-Identifier: GPL-2.0
35 return -EIO; in coda_return_EIO()
43 struct super_block *sb = dir->i_sb; in coda_lookup()
44 const char *name = entry->d_name.name; in coda_lookup()
45 size_t length = entry->d_name.len; in coda_lookup()
52 return ERR_PTR(-ENAMETOOLONG); in coda_lookup()
69 if (inode == ERR_PTR(-ENOENT)) in coda_lookup()
82 return -ECHILD; in coda_permission()
90 return -EACCES; in coda_permission()
95 error = venus_access(inode->i_sb, coda_i2f(inode), mask); in coda_permission()
112 * granularity of the mtime is coarse anyways so we might actually be in coda_dir_update_mtime()
114 dir->i_mtime = dir->i_ctime = current_time(dir); in coda_dir_update_mtime()
119 * trick to fool GNU find's optimizations. If we can't be sure of the link
125 if (dir->i_nlink >= 2) in coda_dir_inc_nlink()
131 if (dir->i_nlink > 2) in coda_dir_drop_nlink()
137 struct dentry *de, umode_t mode, bool excl) in coda_create() argument
140 const char *name=de->d_name.name; in coda_create()
141 int length=de->d_name.len; in coda_create()
147 return -EPERM; in coda_create()
149 error = venus_create(dir->i_sb, coda_i2f(dir), name, length, in coda_create()
154 inode = coda_iget(dir->i_sb, &newfid, &attrs); in coda_create()
162 d_instantiate(de, inode); in coda_create()
165 d_drop(de); in coda_create()
170 struct dentry *de, umode_t mode) in coda_mkdir() argument
174 const char *name = de->d_name.name; in coda_mkdir()
175 int len = de->d_name.len; in coda_mkdir()
180 return -EPERM; in coda_mkdir()
183 error = venus_mkdir(dir->i_sb, coda_i2f(dir), in coda_mkdir()
188 inode = coda_iget(dir->i_sb, &newfid, &attrs); in coda_mkdir()
197 d_instantiate(de, inode); in coda_mkdir()
200 d_drop(de); in coda_mkdir()
204 /* try to make de an entry in dir_inodde linked to source_de */
206 struct dentry *de) in coda_link() argument
209 const char * name = de->d_name.name; in coda_link()
210 int len = de->d_name.len; in coda_link()
214 return -EPERM; in coda_link()
216 error = venus_link(dir_inode->i_sb, coda_i2f(inode), in coda_link()
219 d_drop(de); in coda_link()
225 d_instantiate(de, inode); in coda_link()
232 struct inode *dir_inode, struct dentry *de, in coda_symlink() argument
235 const char *name = de->d_name.name; in coda_symlink()
236 int len = de->d_name.len; in coda_symlink()
241 return -EPERM; in coda_symlink()
245 return -ENAMETOOLONG; in coda_symlink()
251 d_drop(de); in coda_symlink()
252 error = venus_symlink(dir_inode->i_sb, coda_i2f(dir_inode), name, len, in coda_symlink()
263 static int coda_unlink(struct inode *dir, struct dentry *de) in coda_unlink() argument
266 const char *name = de->d_name.name; in coda_unlink()
267 int len = de->d_name.len; in coda_unlink()
269 error = venus_remove(dir->i_sb, coda_i2f(dir), name, len); in coda_unlink()
274 drop_nlink(d_inode(de)); in coda_unlink()
278 static int coda_rmdir(struct inode *dir, struct dentry *de) in coda_rmdir() argument
280 const char *name = de->d_name.name; in coda_rmdir()
281 int len = de->d_name.len; in coda_rmdir()
284 error = venus_rmdir(dir->i_sb, coda_i2f(dir), name, len); in coda_rmdir()
287 if (d_really_is_positive(de)) in coda_rmdir()
288 clear_nlink(d_inode(de)); in coda_rmdir()
302 const char *old_name = old_dentry->d_name.name; in coda_rename()
303 const char *new_name = new_dentry->d_name.name; in coda_rename()
304 int old_length = old_dentry->d_name.len; in coda_rename()
305 int new_length = new_dentry->d_name.len; in coda_rename()
309 return -EINVAL; in coda_rename()
311 error = venus_rename(old_dir->i_sb, coda_i2f(old_dir), in coda_rename()
361 host_file = cfi->cfi_container; in coda_venus_readdir()
366 if (!vdir) return -ENOMEM; in coda_venus_readdir()
372 loff_t pos = ctx->pos - 2; in coda_venus_readdir()
378 __func__, coda_f2s(&cii->c_fid), ret); in coda_venus_readdir()
384 if (ret < vdir_size || ret < vdir_size + vdir->d_namlen) { in coda_venus_readdir()
386 __func__, coda_f2s(&cii->c_fid)); in coda_venus_readdir()
387 ret = -EBADF; in coda_venus_readdir()
391 if (vdir->d_reclen < vdir_size + vdir->d_namlen) { in coda_venus_readdir()
393 __func__, coda_f2s(&cii->c_fid)); in coda_venus_readdir()
394 ret = -EBADF; in coda_venus_readdir()
398 name.len = vdir->d_namlen; in coda_venus_readdir()
399 name.name = vdir->d_name; in coda_venus_readdir()
404 vdir->d_fileno = name.len = 0; in coda_venus_readdir()
407 if (vdir->d_fileno && name.len) { in coda_venus_readdir()
408 ino = vdir->d_fileno; in coda_venus_readdir()
409 type = CDT2DT(vdir->d_type); in coda_venus_readdir()
414 * we've already established it is non-zero. */ in coda_venus_readdir()
415 ctx->pos += vdir->d_reclen; in coda_venus_readdir()
430 host_file = cfi->cfi_container; in coda_readdir()
432 if (host_file->f_op->iterate || host_file->f_op->iterate_shared) { in coda_readdir()
434 ret = -ENOENT; in coda_readdir()
436 if (host_file->f_op->iterate_shared) { in coda_readdir()
438 ret = host_file->f_op->iterate_shared(host_file, ctx); in coda_readdir()
443 ret = host_file->f_op->iterate(host_file, ctx); in coda_readdir()
455 static int coda_dentry_revalidate(struct dentry *de, unsigned int flags) in coda_dentry_revalidate() argument
461 return -ECHILD; in coda_dentry_revalidate()
463 inode = d_inode(de); in coda_dentry_revalidate()
469 cii = ITOC(d_inode(de)); in coda_dentry_revalidate()
470 if (!(cii->c_flags & (C_PURGE | C_FLUSH))) in coda_dentry_revalidate()
473 shrink_dcache_parent(de); in coda_dentry_revalidate()
476 if (cii->c_flags & C_FLUSH) in coda_dentry_revalidate()
479 if (d_count(de) > 1) in coda_dentry_revalidate()
484 spin_lock(&cii->c_lock); in coda_dentry_revalidate()
485 cii->c_flags &= ~(C_VATTR | C_PURGE | C_FLUSH); in coda_dentry_revalidate()
486 spin_unlock(&cii->c_lock); in coda_dentry_revalidate()
510 if (cii->c_flags & C_PURGE) in coda_dentry_delete()
532 if (!cii->c_flags) in coda_revalidate_inode()
535 if (cii->c_flags & (C_VATTR | C_PURGE | C_FLUSH)) { in coda_revalidate_inode()
536 error = venus_getattr(inode->i_sb, &(cii->c_fid), &attr); in coda_revalidate_inode()
538 return -EIO; in coda_revalidate_inode()
540 /* this inode may be lost if: in coda_revalidate_inode()
541 - it's ino changed in coda_revalidate_inode()
542 - type changes must be permitted for repair and in coda_revalidate_inode()
545 old_mode = inode->i_mode; in coda_revalidate_inode()
546 old_ino = inode->i_ino; in coda_revalidate_inode()
549 if ((old_mode & S_IFMT) != (inode->i_mode & S_IFMT)) { in coda_revalidate_inode()
551 inode->i_ino, coda_f2s(&(cii->c_fid))); in coda_revalidate_inode()
556 if (inode->i_ino != old_ino) in coda_revalidate_inode()
557 return -EIO; in coda_revalidate_inode()
561 spin_lock(&cii->c_lock); in coda_revalidate_inode()
562 cii->c_flags &= ~(C_VATTR | C_PURGE | C_FLUSH); in coda_revalidate_inode()
563 spin_unlock(&cii->c_lock); in coda_revalidate_inode()