aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-10-06 17:13:18 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2022-10-06 17:13:18 -0700
commit7a3353c5c441175582cf0d17f855b2ffd83fb9db (patch)
treee19ee5ba7a4062636ac765c97dbe7ba15daf1ca9 /include/linux
parentMerge tag 'pull-d_path' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs (diff)
parentdma_buf_getfile(): don't bother with ->f_flags reassignments (diff)
downloadlinux-dev-7a3353c5c441175582cf0d17f855b2ffd83fb9db.tar.xz
linux-dev-7a3353c5c441175582cf0d17f855b2ffd83fb9db.zip
Merge tag 'pull-file' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs file updates from Al Viro: "struct file-related stuff" * tag 'pull-file' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: dma_buf_getfile(): don't bother with ->f_flags reassignments Change calling conventions for filldir_t locks: fix TOCTOU race when granting write lease
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fs.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 0830486f47ef..7591d2d2dcbb 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2038,9 +2038,10 @@ umode_t mode_strip_sgid(struct user_namespace *mnt_userns,
* the kernel specify what kind of dirent layout it wants to have.
* This allows the kernel to read directories into kernel space or
* to have different dirent layouts depending on the binary type.
+ * Return 'true' to keep going and 'false' if there are no more entries.
*/
struct dir_context;
-typedef int (*filldir_t)(struct dir_context *, const char *, int, loff_t, u64,
+typedef bool (*filldir_t)(struct dir_context *, const char *, int, loff_t, u64,
unsigned);
struct dir_context {
@@ -3540,17 +3541,17 @@ static inline bool dir_emit(struct dir_context *ctx,
const char *name, int namelen,
u64 ino, unsigned type)
{
- return ctx->actor(ctx, name, namelen, ctx->pos, ino, type) == 0;
+ return ctx->actor(ctx, name, namelen, ctx->pos, ino, type);
}
static inline bool dir_emit_dot(struct file *file, struct dir_context *ctx)
{
return ctx->actor(ctx, ".", 1, ctx->pos,
- file->f_path.dentry->d_inode->i_ino, DT_DIR) == 0;
+ file->f_path.dentry->d_inode->i_ino, DT_DIR);
}
static inline bool dir_emit_dotdot(struct file *file, struct dir_context *ctx)
{
return ctx->actor(ctx, "..", 2, ctx->pos,
- parent_ino(file->f_path.dentry), DT_DIR) == 0;
+ parent_ino(file->f_path.dentry), DT_DIR);
}
static inline bool dir_emit_dots(struct file *file, struct dir_context *ctx)
{