]> git.proxmox.com Git - mirror_zfs.git/blobdiff - module/zfs/zpl_ctldir.c
Fix typo/etc in module/zfs/zfs_ctldir.c
[mirror_zfs.git] / module / zfs / zpl_ctldir.c
index bd8af3928835ac4f07f310e617049d22a6a0f4cd..6df367b8176a77b7a1f7ff39feaabb2c053e9e39 100644 (file)
@@ -50,27 +50,27 @@ zpl_common_open(struct inode *ip, struct file *filp)
  * Get root directory contents.
  */
 static int
-zpl_root_iterate(struct file *filp, struct dir_context *ctx)
+zpl_root_iterate(struct file *filp, zpl_dir_context_t *ctx)
 {
        zfsvfs_t *zfsvfs = ITOZSB(file_inode(filp));
        int error = 0;
 
        ZFS_ENTER(zfsvfs);
 
-       if (!dir_emit_dots(filp, ctx))
+       if (!zpl_dir_emit_dots(filp, ctx))
                goto out;
 
        if (ctx->pos == 2) {
-               if (!dir_emit(ctx, ZFS_SNAPDIR_NAME, strlen(ZFS_SNAPDIR_NAME),
-                   ZFSCTL_INO_SNAPDIR, DT_DIR))
+               if (!zpl_dir_emit(ctx, ZFS_SNAPDIR_NAME,
+                   strlen(ZFS_SNAPDIR_NAME), ZFSCTL_INO_SNAPDIR, DT_DIR))
                        goto out;
 
                ctx->pos++;
        }
 
        if (ctx->pos == 3) {
-               if (!dir_emit(ctx, ZFS_SHAREDIR_NAME, strlen(ZFS_SHAREDIR_NAME),
-                   ZFSCTL_INO_SHARES, DT_DIR))
+               if (!zpl_dir_emit(ctx, ZFS_SHAREDIR_NAME,
+                   strlen(ZFS_SHAREDIR_NAME), ZFSCTL_INO_SHARES, DT_DIR))
                        goto out;
 
                ctx->pos++;
@@ -85,7 +85,8 @@ out:
 static int
 zpl_root_readdir(struct file *filp, void *dirent, filldir_t filldir)
 {
-       struct dir_context ctx = DIR_CONTEXT_INIT(dirent, filldir, filp->f_pos);
+       zpl_dir_context_t ctx =
+           ZPL_DIR_CONTEXT_INIT(dirent, filldir, filp->f_pos);
        int error;
 
        error = zpl_root_iterate(filp, &ctx);
@@ -93,7 +94,7 @@ zpl_root_readdir(struct file *filp, void *dirent, filldir_t filldir)
 
        return (error);
 }
-#endif /* HAVE_VFS_ITERATE */
+#endif /* !HAVE_VFS_ITERATE && !HAVE_VFS_ITERATE_SHARED */
 
 /*
  * Get root directory attributes.
@@ -103,8 +104,10 @@ static int
 zpl_root_getattr_impl(const struct path *path, struct kstat *stat,
     u32 request_mask, unsigned int query_flags)
 {
-       generic_fillattr(path->dentry->d_inode, stat);
-       stat->atime = CURRENT_TIME;
+       struct inode *ip = path->dentry->d_inode;
+
+       generic_fillattr(ip, stat);
+       stat->atime = current_time(ip);
 
        return (0);
 }
@@ -246,7 +249,7 @@ zpl_snapdir_lookup(struct inode *dip, struct dentry *dentry,
 }
 
 static int
-zpl_snapdir_iterate(struct file *filp, struct dir_context *ctx)
+zpl_snapdir_iterate(struct file *filp, zpl_dir_context_t *ctx)
 {
        zfsvfs_t *zfsvfs = ITOZSB(file_inode(filp));
        fstrans_cookie_t cookie;
@@ -258,7 +261,7 @@ zpl_snapdir_iterate(struct file *filp, struct dir_context *ctx)
        ZFS_ENTER(zfsvfs);
        cookie = spl_fstrans_mark();
 
-       if (!dir_emit_dots(filp, ctx))
+       if (!zpl_dir_emit_dots(filp, ctx))
                goto out;
 
        pos = ctx->pos;
@@ -270,7 +273,7 @@ zpl_snapdir_iterate(struct file *filp, struct dir_context *ctx)
                if (error)
                        goto out;
 
-               if (!dir_emit(ctx, snapname, strlen(snapname),
+               if (!zpl_dir_emit(ctx, snapname, strlen(snapname),
                    ZFSCTL_INO_SHARES - id, DT_DIR))
                        goto out;
 
@@ -290,7 +293,8 @@ out:
 static int
 zpl_snapdir_readdir(struct file *filp, void *dirent, filldir_t filldir)
 {
-       struct dir_context ctx = DIR_CONTEXT_INIT(dirent, filldir, filp->f_pos);
+       zpl_dir_context_t ctx =
+           ZPL_DIR_CONTEXT_INIT(dirent, filldir, filp->f_pos);
        int error;
 
        error = zpl_snapdir_iterate(filp, &ctx);
@@ -298,7 +302,7 @@ zpl_snapdir_readdir(struct file *filp, void *dirent, filldir_t filldir)
 
        return (error);
 }
-#endif /* HAVE_VFS_ITERATE */
+#endif /* !HAVE_VFS_ITERATE && !HAVE_VFS_ITERATE_SHARED */
 
 static int
 zpl_snapdir_rename2(struct inode *sdip, struct dentry *sdentry,
@@ -377,14 +381,15 @@ static int
 zpl_snapdir_getattr_impl(const struct path *path, struct kstat *stat,
     u32 request_mask, unsigned int query_flags)
 {
-       zfsvfs_t *zfsvfs = ITOZSB(path->dentry->d_inode);
+       struct inode *ip = path->dentry->d_inode;
+       zfsvfs_t *zfsvfs = ITOZSB(ip);
 
        ZFS_ENTER(zfsvfs);
-       generic_fillattr(path->dentry->d_inode, stat);
+       generic_fillattr(ip, stat);
 
        stat->nlink = stat->size = 2;
        stat->ctime = stat->mtime = dmu_objset_snap_cmtime(zfsvfs->z_os);
-       stat->atime = CURRENT_TIME;
+       stat->atime = current_time(ip);
        ZFS_EXIT(zfsvfs);
 
        return (0);
@@ -460,7 +465,7 @@ zpl_shares_lookup(struct inode *dip, struct dentry *dentry,
 }
 
 static int
-zpl_shares_iterate(struct file *filp, struct dir_context *ctx)
+zpl_shares_iterate(struct file *filp, zpl_dir_context_t *ctx)
 {
        fstrans_cookie_t cookie;
        cred_t *cr = CRED();
@@ -472,7 +477,7 @@ zpl_shares_iterate(struct file *filp, struct dir_context *ctx)
        cookie = spl_fstrans_mark();
 
        if (zfsvfs->z_shares_dir == 0) {
-               dir_emit_dots(filp, ctx);
+               zpl_dir_emit_dots(filp, ctx);
                goto out;
        }
 
@@ -497,7 +502,8 @@ out:
 static int
 zpl_shares_readdir(struct file *filp, void *dirent, filldir_t filldir)
 {
-       struct dir_context ctx = DIR_CONTEXT_INIT(dirent, filldir, filp->f_pos);
+       zpl_dir_context_t ctx =
+           ZPL_DIR_CONTEXT_INIT(dirent, filldir, filp->f_pos);
        int error;
 
        error = zpl_shares_iterate(filp, &ctx);
@@ -505,7 +511,7 @@ zpl_shares_readdir(struct file *filp, void *dirent, filldir_t filldir)
 
        return (error);
 }
-#endif /* HAVE_VFS_ITERATE */
+#endif /* !HAVE_VFS_ITERATE && !HAVE_VFS_ITERATE_SHARED */
 
 /* ARGSUSED */
 static int
@@ -522,7 +528,7 @@ zpl_shares_getattr_impl(const struct path *path, struct kstat *stat,
        if (zfsvfs->z_shares_dir == 0) {
                generic_fillattr(path->dentry->d_inode, stat);
                stat->nlink = stat->size = 2;
-               stat->atime = CURRENT_TIME;
+               stat->atime = current_time(ip);
                ZFS_EXIT(zfsvfs);
                return (0);
        }