Skip to content

Commit 149e703

Browse files
committed
Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull misc vfs updates from Al Viro: "Assorted stuff, with no common topic whatsoever..." * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: libfs: document simple_get_link() Documentation/filesystems/Locking: fix ->get_link() prototype Documentation/filesystems/vfs.txt: document how ->i_link works Documentation/filesystems/vfs.txt: remove bogus "Last updated" date fs: use timespec64 in relatime_need_update fs/block_dev.c: remove unused include
2 parents d897166 + 6ee9706 commit 149e703

File tree

5 files changed

+23
-6
lines changed

5 files changed

+23
-6
lines changed

Documentation/filesystems/Locking

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ prototypes:
5252
int (*rename) (struct inode *, struct dentry *,
5353
struct inode *, struct dentry *, unsigned int);
5454
int (*readlink) (struct dentry *, char __user *,int);
55-
const char *(*get_link) (struct dentry *, struct inode *, void **);
55+
const char *(*get_link) (struct dentry *, struct inode *, struct delayed_call *);
5656
void (*truncate) (struct inode *);
5757
int (*permission) (struct inode *, int, unsigned int);
5858
int (*get_acl)(struct inode *, int);

Documentation/filesystems/vfs.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
Original author: Richard Gooch <[email protected]>
55

6-
Last updated on June 24, 2007.
7-
86
Copyright (C) 1999 Richard Gooch
97
Copyright (C) 2005 Pekka Enberg
108

@@ -465,6 +463,12 @@ otherwise noted.
465463
argument. If request can't be handled without leaving RCU mode,
466464
have it return ERR_PTR(-ECHILD).
467465

466+
If the filesystem stores the symlink target in ->i_link, the
467+
VFS may use it directly without calling ->get_link(); however,
468+
->get_link() must still be provided. ->i_link must not be
469+
freed until after an RCU grace period. Writing to ->i_link
470+
post-iget() time requires a 'release' memory barrier.
471+
468472
readlink: this is now just an override for use by readlink(2) for the
469473
cases when ->get_link uses nd_jump_link() or object is not in
470474
fact a symlink. Normally filesystems should only implement

fs/block_dev.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include <linux/log2.h>
3131
#include <linux/cleancache.h>
3232
#include <linux/dax.h>
33-
#include <linux/badblocks.h>
3433
#include <linux/task_io_accounting_ops.h>
3534
#include <linux/falloc.h>
3635
#include <linux/uaccess.h>

fs/inode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,7 @@ EXPORT_SYMBOL(bmap);
16131613
* passed since the last atime update.
16141614
*/
16151615
static int relatime_need_update(struct vfsmount *mnt, struct inode *inode,
1616-
struct timespec now)
1616+
struct timespec64 now)
16171617
{
16181618

16191619
if (!(mnt->mnt_flags & MNT_RELATIME))
@@ -1714,7 +1714,7 @@ bool atime_needs_update(const struct path *path, struct inode *inode)
17141714

17151715
now = current_time(inode);
17161716

1717-
if (!relatime_need_update(mnt, inode, timespec64_to_timespec(now)))
1717+
if (!relatime_need_update(mnt, inode, now))
17181718
return false;
17191719

17201720
if (timespec64_equal(&inode->i_atime, &now))

fs/libfs.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,20 @@ simple_nosetlease(struct file *filp, long arg, struct file_lock **flp,
11691169
}
11701170
EXPORT_SYMBOL(simple_nosetlease);
11711171

1172+
/**
1173+
* simple_get_link - generic helper to get the target of "fast" symlinks
1174+
* @dentry: not used here
1175+
* @inode: the symlink inode
1176+
* @done: not used here
1177+
*
1178+
* Generic helper for filesystems to use for symlink inodes where a pointer to
1179+
* the symlink target is stored in ->i_link. NOTE: this isn't normally called,
1180+
* since as an optimization the path lookup code uses any non-NULL ->i_link
1181+
* directly, without calling ->get_link(). But ->get_link() still must be set,
1182+
* to mark the inode_operations as being for a symlink.
1183+
*
1184+
* Return: the symlink target
1185+
*/
11721186
const char *simple_get_link(struct dentry *dentry, struct inode *inode,
11731187
struct delayed_call *done)
11741188
{

0 commit comments

Comments
 (0)