You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull more vfs updates from Al Viro:
"Assorted VFS fixes and related cleanups (IMO the most interesting in
that part are f_path-related things and Eric's descriptor-related
stuff). UFS regression fixes (it got broken last cycle). 9P fixes.
fs-cache series, DAX patches, Jan's file_remove_suid() work"
[ I'd say this is much more than "fixes and related cleanups". The
file_table locking rule change by Eric Dumazet is a rather big and
fundamental update even if the patch isn't huge. - Linus ]
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (49 commits)
9p: cope with bogus responses from server in p9_client_{read,write}
p9_client_write(): avoid double p9_free_req()
9p: forgetting to cancel request on interrupted zero-copy RPC
dax: bdev_direct_access() may sleep
block: Add support for DAX reads/writes to block devices
dax: Use copy_from_iter_nocache
dax: Add block size note to documentation
fs/file.c: __fget() and dup2() atomicity rules
fs/file.c: don't acquire files->file_lock in fd_install()
fs:super:get_anon_bdev: fix race condition could cause dev exceed its upper limitation
vfs: avoid creation of inode number 0 in get_next_ino
namei: make set_root_rcu() return void
make simple_positive() public
ufs: use dir_pages instead of ufs_dir_pages()
pagemap.h: move dir_pages() over there
remove the pointless include of lglock.h
fs: cleanup slight list_entry abuse
xfs: Correctly lock inode when removing suid and file capabilities
fs: Call security_ops->inode_killpriv on truncate
fs: Provide function telling whether file_remove_privs() will do anything
...
This commit is contained in:
@@ -676,6 +676,29 @@ FS-Cache provides some utilities that a cache backend may make use of:
|
||||
as possible.
|
||||
|
||||
|
||||
(*) Indicate that a stale object was found and discarded:
|
||||
|
||||
void fscache_object_retrying_stale(struct fscache_object *object);
|
||||
|
||||
This is called to indicate that the lookup procedure found an object in
|
||||
the cache that the netfs decided was stale. The object has been
|
||||
discarded from the cache and the lookup will be performed again.
|
||||
|
||||
|
||||
(*) Indicate that the caching backend killed an object:
|
||||
|
||||
void fscache_object_mark_killed(struct fscache_object *object,
|
||||
enum fscache_why_object_killed why);
|
||||
|
||||
This is called to indicate that the cache backend preemptively killed an
|
||||
object. The why parameter should be set to indicate the reason:
|
||||
|
||||
FSCACHE_OBJECT_IS_STALE - the object was stale and needs discarding.
|
||||
FSCACHE_OBJECT_NO_SPACE - there was insufficient cache space
|
||||
FSCACHE_OBJECT_WAS_RETIRED - the object was retired when relinquished.
|
||||
FSCACHE_OBJECT_WAS_CULLED - the object was culled to make space.
|
||||
|
||||
|
||||
(*) Get and release references on a retrieval record:
|
||||
|
||||
void fscache_get_retrieval(struct fscache_retrieval *op);
|
||||
|
||||
@@ -284,8 +284,9 @@ proc files.
|
||||
enq=N Number of times async ops queued for processing
|
||||
can=N Number of async ops cancelled
|
||||
rej=N Number of async ops rejected due to object lookup/create failure
|
||||
ini=N Number of async ops initialised
|
||||
dfr=N Number of async ops queued for deferred release
|
||||
rel=N Number of async ops released
|
||||
rel=N Number of async ops released (should equal ini=N when idle)
|
||||
gc=N Number of deferred-release async ops garbage collected
|
||||
CacheOp alo=N Number of in-progress alloc_object() cache ops
|
||||
luo=N Number of in-progress lookup_object() cache ops
|
||||
@@ -303,6 +304,10 @@ proc files.
|
||||
wrp=N Number of in-progress write_page() cache ops
|
||||
ucp=N Number of in-progress uncache_page() cache ops
|
||||
dsp=N Number of in-progress dissociate_pages() cache ops
|
||||
CacheEv nsp=N Number of object lookups/creations rejected due to lack of space
|
||||
stl=N Number of stale objects deleted
|
||||
rtr=N Number of objects retired when relinquished
|
||||
cul=N Number of objects culled
|
||||
|
||||
|
||||
(*) /proc/fs/fscache/histogram
|
||||
|
||||
@@ -18,8 +18,10 @@ Usage
|
||||
-----
|
||||
|
||||
If you have a block device which supports DAX, you can make a filesystem
|
||||
on it as usual. When mounting it, use the -o dax option manually
|
||||
or add 'dax' to the options in /etc/fstab.
|
||||
on it as usual. The DAX code currently only supports files with a block
|
||||
size equal to your kernel's PAGE_SIZE, so you may need to specify a block
|
||||
size when creating the filesystem. When mounting it, use the "-o dax"
|
||||
option on the command line or add 'dax' to the options in /etc/fstab.
|
||||
|
||||
|
||||
Implementation Tips for Block Driver Writers
|
||||
|
||||
@@ -500,3 +500,7 @@ in your dentry operations instead.
|
||||
dentry, it does not get nameidata at all and it gets called only when cookie
|
||||
is non-NULL. Note that link body isn't available anymore, so if you need it,
|
||||
store it as cookie.
|
||||
--
|
||||
[mandatory]
|
||||
__fd_install() & fd_install() can now sleep. Callers should not
|
||||
hold a spinlock or other resources that do not allow a schedule.
|
||||
|
||||
@@ -71,15 +71,12 @@ static void print_task_path_n_nm(struct task_struct *tsk, char *buf)
|
||||
mmput(mm);
|
||||
|
||||
if (exe_file) {
|
||||
path = exe_file->f_path;
|
||||
path_get(&exe_file->f_path);
|
||||
path_nm = file_path(exe_file, buf, 255);
|
||||
fput(exe_file);
|
||||
path_nm = d_path(&path, buf, 255);
|
||||
path_put(&path);
|
||||
}
|
||||
|
||||
done:
|
||||
pr_info("Path: %s\n", path_nm);
|
||||
pr_info("Path: %s\n", !IS_ERR(path_nm) ? path_nm : "?");
|
||||
}
|
||||
|
||||
static void show_faulting_vma(unsigned long address, char *buf)
|
||||
@@ -103,8 +100,7 @@ static void show_faulting_vma(unsigned long address, char *buf)
|
||||
if (vma && (vma->vm_start <= address)) {
|
||||
struct file *file = vma->vm_file;
|
||||
if (file) {
|
||||
struct path *path = &file->f_path;
|
||||
nm = d_path(path, buf, PAGE_SIZE - 1);
|
||||
nm = file_path(file, buf, PAGE_SIZE - 1);
|
||||
inode = file_inode(vma->vm_file);
|
||||
dev = inode->i_sb->s_dev;
|
||||
ino = inode->i_ino;
|
||||
|
||||
@@ -136,7 +136,7 @@ void decode_address(char *buf, unsigned long address)
|
||||
struct file *file = vma->vm_file;
|
||||
|
||||
if (file) {
|
||||
char *d_name = d_path(&file->f_path, _tmpbuf,
|
||||
char *d_name = file_path(file, _tmpbuf,
|
||||
sizeof(_tmpbuf));
|
||||
if (!IS_ERR(d_name))
|
||||
name = d_name;
|
||||
|
||||
@@ -166,7 +166,7 @@ static void spufs_prune_dir(struct dentry *dir)
|
||||
mutex_lock(&d_inode(dir)->i_mutex);
|
||||
list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_child) {
|
||||
spin_lock(&dentry->d_lock);
|
||||
if (!(d_unhashed(dentry)) && d_really_is_positive(dentry)) {
|
||||
if (simple_positive(dentry)) {
|
||||
dget_dlock(dentry);
|
||||
__d_drop(dentry);
|
||||
spin_unlock(&dentry->d_lock);
|
||||
|
||||
@@ -62,18 +62,13 @@ static void hypfs_add_dentry(struct dentry *dentry)
|
||||
hypfs_last_dentry = dentry;
|
||||
}
|
||||
|
||||
static inline int hypfs_positive(struct dentry *dentry)
|
||||
{
|
||||
return d_really_is_positive(dentry) && !d_unhashed(dentry);
|
||||
}
|
||||
|
||||
static void hypfs_remove(struct dentry *dentry)
|
||||
{
|
||||
struct dentry *parent;
|
||||
|
||||
parent = dentry->d_parent;
|
||||
mutex_lock(&d_inode(parent)->i_mutex);
|
||||
if (hypfs_positive(dentry)) {
|
||||
if (simple_positive(dentry)) {
|
||||
if (d_is_dir(dentry))
|
||||
simple_rmdir(d_inode(parent), dentry);
|
||||
else
|
||||
|
||||
@@ -332,7 +332,7 @@ static void describe_addr(struct KBacktraceIterator *kbt,
|
||||
}
|
||||
|
||||
if (vma->vm_file) {
|
||||
p = d_path(&vma->vm_file->f_path, buf, bufsize);
|
||||
p = file_path(vma->vm_file, buf, bufsize);
|
||||
if (IS_ERR(p))
|
||||
p = "?";
|
||||
name = kbasename(p);
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ static int notify_exec(struct mm_struct *mm)
|
||||
if (exe_file == NULL)
|
||||
goto done_free;
|
||||
|
||||
path = d_path(&exe_file->f_path, buf, PAGE_SIZE);
|
||||
path = file_path(exe_file, buf, PAGE_SIZE);
|
||||
if (IS_ERR(path))
|
||||
goto done_put;
|
||||
|
||||
|
||||
@@ -419,14 +419,6 @@ static int in_flight_summary_show(struct seq_file *m, void *pos)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* simple_positive(file->f_path.dentry) respectively debugfs_positive(),
|
||||
* but neither is "reachable" from here.
|
||||
* So we have our own inline version of it above. :-( */
|
||||
static inline int debugfs_positive(struct dentry *dentry)
|
||||
{
|
||||
return d_really_is_positive(dentry) && !d_unhashed(dentry);
|
||||
}
|
||||
|
||||
/* make sure at *open* time that the respective object won't go away. */
|
||||
static int drbd_single_open(struct file *file, int (*show)(struct seq_file *, void *),
|
||||
void *data, struct kref *kref,
|
||||
@@ -444,7 +436,7 @@ static int drbd_single_open(struct file *file, int (*show)(struct seq_file *, vo
|
||||
/* serialize with d_delete() */
|
||||
mutex_lock(&d_inode(parent)->i_mutex);
|
||||
/* Make sure the object is still alive */
|
||||
if (debugfs_positive(file->f_path.dentry)
|
||||
if (simple_positive(file->f_path.dentry)
|
||||
&& kref_get_unless_zero(kref))
|
||||
ret = 0;
|
||||
mutex_unlock(&d_inode(parent)->i_mutex);
|
||||
|
||||
@@ -588,7 +588,7 @@ static ssize_t loop_attr_backing_file_show(struct loop_device *lo, char *buf)
|
||||
|
||||
spin_lock_irq(&lo->lo_lock);
|
||||
if (lo->lo_backing_file)
|
||||
p = d_path(&lo->lo_backing_file->f_path, buf, PAGE_SIZE - 1);
|
||||
p = file_path(lo->lo_backing_file, buf, PAGE_SIZE - 1);
|
||||
spin_unlock_irq(&lo->lo_lock);
|
||||
|
||||
if (IS_ERR_OR_NULL(p))
|
||||
|
||||
@@ -277,7 +277,7 @@ static int remove_file(struct dentry *parent, char *name)
|
||||
}
|
||||
|
||||
spin_lock(&tmp->d_lock);
|
||||
if (!d_unhashed(tmp) && d_really_is_positive(tmp)) {
|
||||
if (simple_positive(tmp)) {
|
||||
dget_dlock(tmp);
|
||||
__d_drop(tmp);
|
||||
spin_unlock(&tmp->d_lock);
|
||||
|
||||
@@ -455,7 +455,7 @@ static int remove_file(struct dentry *parent, char *name)
|
||||
}
|
||||
|
||||
spin_lock(&tmp->d_lock);
|
||||
if (!d_unhashed(tmp) && d_really_is_positive(tmp)) {
|
||||
if (simple_positive(tmp)) {
|
||||
__d_drop(tmp);
|
||||
spin_unlock(&tmp->d_lock);
|
||||
simple_unlink(d_inode(parent), tmp);
|
||||
|
||||
+2
-2
@@ -839,7 +839,7 @@ static void bitmap_file_kick(struct bitmap *bitmap)
|
||||
if (bitmap->storage.file) {
|
||||
path = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (path)
|
||||
ptr = d_path(&bitmap->storage.file->f_path,
|
||||
ptr = file_path(bitmap->storage.file,
|
||||
path, PAGE_SIZE);
|
||||
|
||||
printk(KERN_ALERT
|
||||
@@ -1927,7 +1927,7 @@ void bitmap_status(struct seq_file *seq, struct bitmap *bitmap)
|
||||
chunk_kb ? "KB" : "B");
|
||||
if (bitmap->storage.file) {
|
||||
seq_printf(seq, ", file: ");
|
||||
seq_path(seq, &bitmap->storage.file->f_path, " \t\n");
|
||||
seq_file_path(seq, bitmap->storage.file, " \t\n");
|
||||
}
|
||||
|
||||
seq_printf(seq, "\n");
|
||||
|
||||
+1
-1
@@ -5766,7 +5766,7 @@ static int get_bitmap_file(struct mddev *mddev, void __user * arg)
|
||||
/* bitmap disabled, zero the first byte and copy out */
|
||||
if (!mddev->bitmap_info.file)
|
||||
file->pathname[0] = '\0';
|
||||
else if ((ptr = d_path(&mddev->bitmap_info.file->f_path,
|
||||
else if ((ptr = file_path(mddev->bitmap_info.file,
|
||||
file->pathname, sizeof(file->pathname))),
|
||||
IS_ERR(ptr))
|
||||
err = PTR_ERR(ptr);
|
||||
|
||||
@@ -2936,7 +2936,7 @@ int fsg_common_create_lun(struct fsg_common *common, struct fsg_lun_config *cfg,
|
||||
if (fsg_lun_is_open(lun)) {
|
||||
p = "(error)";
|
||||
if (pathbuf) {
|
||||
p = d_path(&lun->filp->f_path, pathbuf, PATH_MAX);
|
||||
p = file_path(lun->filp, pathbuf, PATH_MAX);
|
||||
if (IS_ERR(p))
|
||||
p = "(error)";
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ ssize_t fsg_show_file(struct fsg_lun *curlun, struct rw_semaphore *filesem,
|
||||
|
||||
down_read(filesem);
|
||||
if (fsg_lun_is_open(curlun)) { /* Get the complete pathname */
|
||||
p = d_path(&curlun->filp->f_path, buf, PAGE_SIZE - 1);
|
||||
p = file_path(curlun->filp, buf, PAGE_SIZE - 1);
|
||||
if (IS_ERR(p))
|
||||
rc = PTR_ERR(p);
|
||||
else {
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ struct affs_inode_info {
|
||||
/* short cut to get to the affs specific inode data */
|
||||
static inline struct affs_inode_info *AFFS_I(struct inode *inode)
|
||||
{
|
||||
return list_entry(inode, struct affs_inode_info, vfs_inode);
|
||||
return container_of(inode, struct affs_inode_info, vfs_inode);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -238,11 +238,6 @@ static inline u64 autofs4_get_ino(struct autofs_sb_info *sbi)
|
||||
return d_inode(sbi->sb->s_root)->i_ino;
|
||||
}
|
||||
|
||||
static inline int simple_positive(struct dentry *dentry)
|
||||
{
|
||||
return d_really_is_positive(dentry) && !d_unhashed(dentry);
|
||||
}
|
||||
|
||||
static inline void __autofs4_add_expiring(struct dentry *dentry)
|
||||
{
|
||||
struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user