diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 19:10:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 19:10:49 -0500 |
commit | cbfe0de303a55ed96d8831c2d5f56f8131cd6612 (patch) | |
tree | b327762303c6a015421e4077e7c713b8a47a5e0e /fs/cifs | |
parent | 8322b6fddfd2cee41a7732284e5f04750511f4b2 (diff) | |
parent | ba00410b8131b23edfb0e09f8b6dd26c8eb621fb (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull VFS changes from Al Viro:
"First pile out of several (there _definitely_ will be more). Stuff in
this one:
- unification of d_splice_alias()/d_materialize_unique()
- iov_iter rewrite
- killing a bunch of ->f_path.dentry users (and f_dentry macro).
Getting that completed will make life much simpler for
unionmount/overlayfs, since then we'll be able to limit the places
sensitive to file _dentry_ to reasonably few. Which allows to have
file_inode(file) pointing to inode in a covered layer, with dentry
pointing to (negative) dentry in union one.
Still not complete, but much closer now.
- crapectomy in lustre (dead code removal, mostly)
- "let's make seq_printf return nothing" preparations
- assorted cleanups and fixes
There _definitely_ will be more piles"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (63 commits)
copy_from_iter_nocache()
new helper: iov_iter_kvec()
csum_and_copy_..._iter()
iov_iter.c: handle ITER_KVEC directly
iov_iter.c: convert copy_to_iter() to iterate_and_advance
iov_iter.c: convert copy_from_iter() to iterate_and_advance
iov_iter.c: get rid of bvec_copy_page_{to,from}_iter()
iov_iter.c: convert iov_iter_zero() to iterate_and_advance
iov_iter.c: convert iov_iter_get_pages_alloc() to iterate_all_kinds
iov_iter.c: convert iov_iter_get_pages() to iterate_all_kinds
iov_iter.c: convert iov_iter_npages() to iterate_all_kinds
iov_iter.c: iterate_and_advance
iov_iter.c: macros for iterating over iov_iter
kill f_dentry macro
dcache: fix kmemcheck warning in switch_names
new helper: audit_file()
nfsd_vfs_write(): use file_inode()
ncpfs: use file_inode()
kill f_dentry uses
lockd: get rid of ->f_path.dentry->d_sb
...
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsfs.c | 3 | ||||
-rw-r--r-- | fs/cifs/cifsglob.h | 6 | ||||
-rw-r--r-- | fs/cifs/file.c | 12 | ||||
-rw-r--r-- | fs/cifs/inode.c | 2 | ||||
-rw-r--r-- | fs/cifs/readdir.c | 10 |
5 files changed, 19 insertions, 14 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 9d7996e8e793..d72fe37f5420 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -209,8 +209,7 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
209 | 209 | ||
210 | static long cifs_fallocate(struct file *file, int mode, loff_t off, loff_t len) | 210 | static long cifs_fallocate(struct file *file, int mode, loff_t off, loff_t len) |
211 | { | 211 | { |
212 | struct super_block *sb = file->f_path.dentry->d_sb; | 212 | struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file); |
213 | struct cifs_sb_info *cifs_sb = CIFS_SB(sb); | ||
214 | struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); | 213 | struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); |
215 | struct TCP_Server_Info *server = tcon->ses->server; | 214 | struct TCP_Server_Info *server = tcon->ses->server; |
216 | 215 | ||
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 02a33e529904..6e139111fdb2 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -1168,6 +1168,12 @@ CIFS_SB(struct super_block *sb) | |||
1168 | return sb->s_fs_info; | 1168 | return sb->s_fs_info; |
1169 | } | 1169 | } |
1170 | 1170 | ||
1171 | static inline struct cifs_sb_info * | ||
1172 | CIFS_FILE_SB(struct file *file) | ||
1173 | { | ||
1174 | return CIFS_SB(file_inode(file)->i_sb); | ||
1175 | } | ||
1176 | |||
1171 | static inline char CIFS_DIR_SEP(const struct cifs_sb_info *cifs_sb) | 1177 | static inline char CIFS_DIR_SEP(const struct cifs_sb_info *cifs_sb) |
1172 | { | 1178 | { |
1173 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) | 1179 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 3e4d00a06c44..d535e168a9d3 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -1586,7 +1586,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock) | |||
1586 | cifs_read_flock(flock, &type, &lock, &unlock, &wait_flag, | 1586 | cifs_read_flock(flock, &type, &lock, &unlock, &wait_flag, |
1587 | tcon->ses->server); | 1587 | tcon->ses->server); |
1588 | 1588 | ||
1589 | cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); | 1589 | cifs_sb = CIFS_FILE_SB(file); |
1590 | netfid = cfile->fid.netfid; | 1590 | netfid = cfile->fid.netfid; |
1591 | cinode = CIFS_I(file_inode(file)); | 1591 | cinode = CIFS_I(file_inode(file)); |
1592 | 1592 | ||
@@ -2305,7 +2305,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync) | |||
2305 | struct cifs_tcon *tcon; | 2305 | struct cifs_tcon *tcon; |
2306 | struct TCP_Server_Info *server; | 2306 | struct TCP_Server_Info *server; |
2307 | struct cifsFileInfo *smbfile = file->private_data; | 2307 | struct cifsFileInfo *smbfile = file->private_data; |
2308 | struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); | 2308 | struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file); |
2309 | struct inode *inode = file->f_mapping->host; | 2309 | struct inode *inode = file->f_mapping->host; |
2310 | 2310 | ||
2311 | rc = filemap_write_and_wait_range(inode->i_mapping, start, end); | 2311 | rc = filemap_write_and_wait_range(inode->i_mapping, start, end); |
@@ -2585,7 +2585,7 @@ cifs_iovec_write(struct file *file, struct iov_iter *from, loff_t *poffset) | |||
2585 | iov_iter_truncate(from, len); | 2585 | iov_iter_truncate(from, len); |
2586 | 2586 | ||
2587 | INIT_LIST_HEAD(&wdata_list); | 2587 | INIT_LIST_HEAD(&wdata_list); |
2588 | cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); | 2588 | cifs_sb = CIFS_FILE_SB(file); |
2589 | open_file = file->private_data; | 2589 | open_file = file->private_data; |
2590 | tcon = tlink_tcon(open_file->tlink); | 2590 | tcon = tlink_tcon(open_file->tlink); |
2591 | 2591 | ||
@@ -3010,7 +3010,7 @@ ssize_t cifs_user_readv(struct kiocb *iocb, struct iov_iter *to) | |||
3010 | return 0; | 3010 | return 0; |
3011 | 3011 | ||
3012 | INIT_LIST_HEAD(&rdata_list); | 3012 | INIT_LIST_HEAD(&rdata_list); |
3013 | cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); | 3013 | cifs_sb = CIFS_FILE_SB(file); |
3014 | open_file = file->private_data; | 3014 | open_file = file->private_data; |
3015 | tcon = tlink_tcon(open_file->tlink); | 3015 | tcon = tlink_tcon(open_file->tlink); |
3016 | 3016 | ||
@@ -3155,7 +3155,7 @@ cifs_read(struct file *file, char *read_data, size_t read_size, loff_t *offset) | |||
3155 | __u32 pid; | 3155 | __u32 pid; |
3156 | 3156 | ||
3157 | xid = get_xid(); | 3157 | xid = get_xid(); |
3158 | cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); | 3158 | cifs_sb = CIFS_FILE_SB(file); |
3159 | 3159 | ||
3160 | /* FIXME: set up handlers for larger reads and/or convert to async */ | 3160 | /* FIXME: set up handlers for larger reads and/or convert to async */ |
3161 | rsize = min_t(unsigned int, cifs_sb->rsize, CIFSMaxBufSize); | 3161 | rsize = min_t(unsigned int, cifs_sb->rsize, CIFSMaxBufSize); |
@@ -3462,7 +3462,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, | |||
3462 | int rc; | 3462 | int rc; |
3463 | struct list_head tmplist; | 3463 | struct list_head tmplist; |
3464 | struct cifsFileInfo *open_file = file->private_data; | 3464 | struct cifsFileInfo *open_file = file->private_data; |
3465 | struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); | 3465 | struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file); |
3466 | struct TCP_Server_Info *server; | 3466 | struct TCP_Server_Info *server; |
3467 | pid_t pid; | 3467 | pid_t pid; |
3468 | 3468 | ||
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 197cb503d528..0c3ce464cae4 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -895,7 +895,7 @@ inode_has_hashed_dentries(struct inode *inode) | |||
895 | struct dentry *dentry; | 895 | struct dentry *dentry; |
896 | 896 | ||
897 | spin_lock(&inode->i_lock); | 897 | spin_lock(&inode->i_lock); |
898 | hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) { | 898 | hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) { |
899 | if (!d_unhashed(dentry) || IS_ROOT(dentry)) { | 899 | if (!d_unhashed(dentry) || IS_ROOT(dentry)) { |
900 | spin_unlock(&inode->i_lock); | 900 | spin_unlock(&inode->i_lock); |
901 | return true; | 901 | return true; |
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index 803030c9ab68..8eaf20a80649 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c | |||
@@ -123,7 +123,7 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name, | |||
123 | if (!inode) | 123 | if (!inode) |
124 | goto out; | 124 | goto out; |
125 | 125 | ||
126 | alias = d_materialise_unique(dentry, inode); | 126 | alias = d_splice_alias(inode, dentry); |
127 | if (alias && !IS_ERR(alias)) | 127 | if (alias && !IS_ERR(alias)) |
128 | dput(alias); | 128 | dput(alias); |
129 | out: | 129 | out: |
@@ -261,7 +261,7 @@ initiate_cifs_search(const unsigned int xid, struct file *file) | |||
261 | int rc = 0; | 261 | int rc = 0; |
262 | char *full_path = NULL; | 262 | char *full_path = NULL; |
263 | struct cifsFileInfo *cifsFile; | 263 | struct cifsFileInfo *cifsFile; |
264 | struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); | 264 | struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file); |
265 | struct tcon_link *tlink = NULL; | 265 | struct tcon_link *tlink = NULL; |
266 | struct cifs_tcon *tcon; | 266 | struct cifs_tcon *tcon; |
267 | struct TCP_Server_Info *server; | 267 | struct TCP_Server_Info *server; |
@@ -561,7 +561,7 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon, loff_t pos, | |||
561 | loff_t first_entry_in_buffer; | 561 | loff_t first_entry_in_buffer; |
562 | loff_t index_to_find = pos; | 562 | loff_t index_to_find = pos; |
563 | struct cifsFileInfo *cfile = file->private_data; | 563 | struct cifsFileInfo *cfile = file->private_data; |
564 | struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); | 564 | struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file); |
565 | struct TCP_Server_Info *server = tcon->ses->server; | 565 | struct TCP_Server_Info *server = tcon->ses->server; |
566 | /* check if index in the buffer */ | 566 | /* check if index in the buffer */ |
567 | 567 | ||
@@ -679,7 +679,7 @@ static int cifs_filldir(char *find_entry, struct file *file, | |||
679 | char *scratch_buf, unsigned int max_len) | 679 | char *scratch_buf, unsigned int max_len) |
680 | { | 680 | { |
681 | struct cifsFileInfo *file_info = file->private_data; | 681 | struct cifsFileInfo *file_info = file->private_data; |
682 | struct super_block *sb = file->f_path.dentry->d_sb; | 682 | struct super_block *sb = file_inode(file)->i_sb; |
683 | struct cifs_sb_info *cifs_sb = CIFS_SB(sb); | 683 | struct cifs_sb_info *cifs_sb = CIFS_SB(sb); |
684 | struct cifs_dirent de = { NULL, }; | 684 | struct cifs_dirent de = { NULL, }; |
685 | struct cifs_fattr fattr; | 685 | struct cifs_fattr fattr; |
@@ -753,7 +753,7 @@ static int cifs_filldir(char *find_entry, struct file *file, | |||
753 | */ | 753 | */ |
754 | fattr.cf_flags |= CIFS_FATTR_NEED_REVAL; | 754 | fattr.cf_flags |= CIFS_FATTR_NEED_REVAL; |
755 | 755 | ||
756 | cifs_prime_dcache(file->f_dentry, &name, &fattr); | 756 | cifs_prime_dcache(file->f_path.dentry, &name, &fattr); |
757 | 757 | ||
758 | ino = cifs_uniqueid_to_ino_t(fattr.cf_uniqueid); | 758 | ino = cifs_uniqueid_to_ino_t(fattr.cf_uniqueid); |
759 | return !dir_emit(ctx, name.name, name.len, ino, fattr.cf_dtype); | 759 | return !dir_emit(ctx, name.name, name.len, ino, fattr.cf_dtype); |