Skip to content

Commit

Permalink
merge: aufs-base
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Nelson <[email protected]>
  • Loading branch information
RobertCNelson committed Mar 8, 2022
1 parent 9a8e725 commit 04ed0da
Show file tree
Hide file tree
Showing 14 changed files with 94 additions and 10 deletions.
13 changes: 13 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2606,6 +2606,19 @@ F: include/linux/audit.h
F: include/uapi/linux/audit.h
F: kernel/audit*

AUFS (advanced multi layered unification filesystem) FILESYSTEM
M: "J. R. Okajima" <[email protected]>
L: [email protected] (members only)
L: [email protected]
W: http://aufs.sourceforge.net
T: git://github.com/sfjro/aufs4-linux.git
S: Supported
F: Documentation/filesystems/aufs/
F: Documentation/ABI/testing/debugfs-aufs
F: Documentation/ABI/testing/sysfs-aufs
F: fs/aufs/
F: include/uapi/linux/aufs_type.h

AUXILIARY DISPLAY DRIVERS
M: Miguel Ojeda Sandonis <[email protected]>
S: Maintained
Expand Down
18 changes: 18 additions & 0 deletions drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,24 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
return error;
}

/*
* for AUFS
* no get/put for file.
*/
struct file *loop_backing_file(struct super_block *sb)
{
struct file *ret;
struct loop_device *l;

ret = NULL;
if (MAJOR(sb->s_dev) == LOOP_MAJOR) {
l = sb->s_bdev->bd_disk->private_data;
ret = l->lo_backing_file;
}
return ret;
}
EXPORT_SYMBOL_GPL(loop_backing_file);

/* loop sysfs attributes */

static ssize_t loop_attr_show(struct device *dev, char *page,
Expand Down
2 changes: 1 addition & 1 deletion fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ enum d_walk_ret {
*
* The @enter() callbacks are called with d_lock held.
*/
static void d_walk(struct dentry *parent, void *data,
void d_walk(struct dentry *parent, void *data,
enum d_walk_ret (*enter)(void *, struct dentry *))
{
struct dentry *this_parent;
Expand Down
4 changes: 3 additions & 1 deletion fs/fcntl.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | O_DIRECT | O_NOATIME)

static int setfl(int fd, struct file * filp, unsigned long arg)
int setfl(int fd, struct file *filp, unsigned long arg)
{
struct inode * inode = file_inode(filp);
int error = 0;
Expand Down Expand Up @@ -63,6 +63,8 @@ static int setfl(int fd, struct file * filp, unsigned long arg)

if (filp->f_op->check_flags)
error = filp->f_op->check_flags(arg);
if (!error && filp->f_op->setfl)
error = filp->f_op->setfl(filp, arg);
if (error)
return error;

Expand Down
2 changes: 1 addition & 1 deletion fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,7 @@ EXPORT_SYMBOL(generic_update_time);
* This does the actual work of updating an inodes time or version. Must have
* had called mnt_want_write() before calling this.
*/
static int update_time(struct inode *inode, struct timespec64 *time, int flags)
int update_time(struct inode *inode, struct timespec64 *time, int flags)
{
int (*update_time)(struct inode *, struct timespec64 *, int);

Expand Down
6 changes: 6 additions & 0 deletions fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,12 @@ static inline int check_mnt(struct mount *mnt)
return mnt->mnt_ns == current->nsproxy->mnt_ns;
}

/* for aufs, CONFIG_AUFS_BR_FUSE */
int is_current_mnt_ns(struct vfsmount *mnt)
{
return check_mnt(real_mount(mnt));
}

/*
* vfsmount lock must be held for write
*/
Expand Down
22 changes: 22 additions & 0 deletions fs/read_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,28 @@ ssize_t __vfs_write(struct file *file, const char __user *p, size_t count,
return -EINVAL;
}

vfs_readf_t vfs_readf(struct file *file)
{
const struct file_operations *fop = file->f_op;

if (fop->read)
return fop->read;
if (fop->read_iter)
return new_sync_read;
return ERR_PTR(-ENOSYS); /* doesn't have ->read(|_iter)() op */
}

vfs_writef_t vfs_writef(struct file *file)
{
const struct file_operations *fop = file->f_op;

if (fop->write)
return fop->write;
if (fop->write_iter)
return new_sync_write;
return ERR_PTR(-ENOSYS); /* doesn't have ->write(|_iter)() op */
}

ssize_t __kernel_write(struct file *file, const void *buf, size_t count, loff_t *pos)
{
mm_segment_t old_fs;
Expand Down
10 changes: 5 additions & 5 deletions fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,8 +838,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
/*
* Attempt to initiate a splice from pipe to file.
*/
static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
loff_t *ppos, size_t len, unsigned int flags)
long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
loff_t *ppos, size_t len, unsigned int flags)
{
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *,
loff_t *, size_t, unsigned int);
Expand All @@ -855,9 +855,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
/*
* Attempt to initiate a splice from a file to a pipe.
*/
static long do_splice_to(struct file *in, loff_t *ppos,
struct pipe_inode_info *pipe, size_t len,
unsigned int flags)
long do_splice_to(struct file *in, loff_t *ppos,
struct pipe_inode_info *pipe, size_t len,
unsigned int flags)
{
ssize_t (*splice_read)(struct file *, loff_t *,
struct pipe_inode_info *, size_t, unsigned int);
Expand Down
2 changes: 1 addition & 1 deletion fs/sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* wait == 1 case since in that case write_inode() functions do
* sync_dirty_buffer() and thus effectively write one block at a time.
*/
static int __sync_filesystem(struct super_block *sb, int wait)
int __sync_filesystem(struct super_block *sb, int wait)
{
if (wait)
sync_inodes_sb(sb);
Expand Down
10 changes: 10 additions & 0 deletions include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@ extern void fasync_free(struct fasync_struct *);
/* can be called from interrupts */
extern void kill_fasync(struct fasync_struct **, int, int);

extern int setfl(int fd, struct file *filp, unsigned long arg);
extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
extern int f_setown(struct file *filp, unsigned long arg, int force);
extern void f_delown(struct file *filp);
Expand Down Expand Up @@ -1759,6 +1760,7 @@ struct file_operations {
ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
int (*check_flags)(int);
int (*setfl)(struct file *, unsigned long);
int (*flock) (struct file *, int, struct file_lock *);
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
Expand Down Expand Up @@ -1830,6 +1832,12 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
struct iovec *fast_pointer,
struct iovec **ret_pointer);

typedef ssize_t (*vfs_readf_t)(struct file *, char __user *, size_t, loff_t *);
typedef ssize_t (*vfs_writef_t)(struct file *, const char __user *, size_t,
loff_t *);
vfs_readf_t vfs_readf(struct file *file);
vfs_writef_t vfs_writef(struct file *file);

extern ssize_t __vfs_read(struct file *, char __user *, size_t, loff_t *);
extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
Expand Down Expand Up @@ -2255,6 +2263,7 @@ extern int current_umask(void);
extern void ihold(struct inode * inode);
extern void iput(struct inode *);
extern int generic_update_time(struct inode *, struct timespec64 *, int);
extern int update_time(struct inode *, struct timespec64 *, int);

/* /sys/fs */
extern struct kobject *fs_kobj;
Expand Down Expand Up @@ -2542,6 +2551,7 @@ static inline bool sb_is_blkdev_sb(struct super_block *sb)
return false;
}
#endif
extern int __sync_filesystem(struct super_block *, int);
extern int sync_filesystem(struct super_block *);
extern const struct file_operations def_blk_fops;
extern const struct file_operations def_chr_fops;
Expand Down
3 changes: 3 additions & 0 deletions include/linux/lockdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ static inline int lockdep_match_key(struct lockdep_map *lock,
return lock->key == key;
}

struct lock_class *lockdep_hlock_class(struct held_lock *hlock);

/*
* Acquire a lock.
*
Expand Down Expand Up @@ -439,6 +441,7 @@ struct lockdep_map { };

#define lockdep_depth(tsk) (0)

#define lockdep_is_held(lock) (1)
#define lockdep_is_held_type(l, r) (1)

#define lockdep_assert_held(l) do { (void)(l); } while (0)
Expand Down
3 changes: 3 additions & 0 deletions include/linux/mnt_namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
struct mnt_namespace;
struct fs_struct;
struct user_namespace;
struct vfsmount;

extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
struct user_namespace *, struct fs_struct *);
extern void put_mnt_ns(struct mnt_namespace *ns);

extern int is_current_mnt_ns(struct vfsmount *mnt);

extern const struct file_operations proc_mounts_operations;
extern const struct file_operations proc_mountinfo_operations;
extern const struct file_operations proc_mountstats_operations;
Expand Down
6 changes: 6 additions & 0 deletions include/linux/splice.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,10 @@ extern void splice_shrink_spd(struct splice_pipe_desc *);

extern const struct pipe_buf_operations page_cache_pipe_buf_ops;
extern const struct pipe_buf_operations default_pipe_buf_ops;

extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
loff_t *ppos, size_t len, unsigned int flags);
extern long do_splice_to(struct file *in, loff_t *ppos,
struct pipe_inode_info *pipe, size_t len,
unsigned int flags);
#endif
3 changes: 2 additions & 1 deletion kernel/locking/lockdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ static struct lock_list list_entries[MAX_LOCKDEP_ENTRIES];
unsigned long nr_lock_classes;
static struct lock_class lock_classes[MAX_LOCKDEP_KEYS];

static inline struct lock_class *hlock_class(struct held_lock *hlock)
inline struct lock_class *lockdep_hlock_class(struct held_lock *hlock)
{
if (!hlock->class_idx) {
/*
Expand All @@ -151,6 +151,7 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock)
}
return lock_classes + hlock->class_idx - 1;
}
#define hlock_class(hlock) lockdep_hlock_class(hlock)

#ifdef CONFIG_LOCK_STAT
static DEFINE_PER_CPU(struct lock_class_stats[MAX_LOCKDEP_KEYS], cpu_lock_stats);
Expand Down

0 comments on commit 04ed0da

Please sign in to comment.