aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-26 23:16:07 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-26 23:16:07 -0500
commitd895cb1af15c04c522a25c79cc429076987c089b (patch)
tree895dc9157e28f603d937a58be664e4e440d5530c /fs/ocfs2
parent9626357371b519f2b955fef399647181034a77fe (diff)
parentd3d009cb965eae7e002ea5badf603ea8f4c34915 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs pile (part one) from Al Viro: "Assorted stuff - cleaning namei.c up a bit, fixing ->d_name/->d_parent locking violations, etc. The most visible changes here are death of FS_REVAL_DOT (replaced with "has ->d_weak_revalidate()") and a new helper getting from struct file to inode. Some bits of preparation to xattr method interface changes. Misc patches by various people sent this cycle *and* ocfs2 fixes from several cycles ago that should've been upstream right then. PS: the next vfs pile will be xattr stuff." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits) saner proc_get_inode() calling conventions proc: avoid extra pde_put() in proc_fill_super() fs: change return values from -EACCES to -EPERM fs/exec.c: make bprm_mm_init() static ocfs2/dlm: use GFP_ATOMIC inside a spin_lock ocfs2: fix possible use-after-free with AIO ocfs2: Fix oops in ocfs2_fast_symlink_readpage() code path get_empty_filp()/alloc_file() leave both ->f_pos and ->f_version zero target: writev() on single-element vector is pointless export kernel_write(), convert open-coded instances fs: encode_fh: return FILEID_INVALID if invalid fid_type kill f_vfsmnt vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op nfsd: handle vfs_getattr errors in acl protocol switch vfs_getattr() to struct path default SET_PERSONALITY() in linux/elf.h ceph: prepopulate inodes only when request is aborted d_hash_and_lookup(): export, switch open-coded instances 9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate() 9p: split dropping the acls from v9fs_set_create_acl() ...
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/aops.c6
-rw-r--r--fs/ocfs2/dir.c4
-rw-r--r--fs/ocfs2/dlm/dlmmaster.c2
-rw-r--r--fs/ocfs2/dlmfs/dlmfs.c6
-rw-r--r--fs/ocfs2/export.c4
-rw-r--r--fs/ocfs2/file.c14
-rw-r--r--fs/ocfs2/ioctl.c4
-rw-r--r--fs/ocfs2/mmap.c10
-rw-r--r--fs/ocfs2/move_extents.c2
-rw-r--r--fs/ocfs2/refcounttree.c4
-rw-r--r--fs/ocfs2/symlink.c2
11 files changed, 29 insertions, 29 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 9796330d8f04..20dfec72e903 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -569,7 +569,7 @@ static void ocfs2_dio_end_io(struct kiocb *iocb,
569 int ret, 569 int ret,
570 bool is_async) 570 bool is_async)
571{ 571{
572 struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; 572 struct inode *inode = file_inode(iocb->ki_filp);
573 int level; 573 int level;
574 wait_queue_head_t *wq = ocfs2_ioend_wq(inode); 574 wait_queue_head_t *wq = ocfs2_ioend_wq(inode);
575 575
@@ -593,9 +593,9 @@ static void ocfs2_dio_end_io(struct kiocb *iocb,
593 level = ocfs2_iocb_rw_locked_level(iocb); 593 level = ocfs2_iocb_rw_locked_level(iocb);
594 ocfs2_rw_unlock(inode, level); 594 ocfs2_rw_unlock(inode, level);
595 595
596 inode_dio_done(inode);
596 if (is_async) 597 if (is_async)
597 aio_complete(iocb, ret, 0); 598 aio_complete(iocb, ret, 0);
598 inode_dio_done(inode);
599} 599}
600 600
601/* 601/*
@@ -626,7 +626,7 @@ static ssize_t ocfs2_direct_IO(int rw,
626 unsigned long nr_segs) 626 unsigned long nr_segs)
627{ 627{
628 struct file *file = iocb->ki_filp; 628 struct file *file = iocb->ki_filp;
629 struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host; 629 struct inode *inode = file_inode(file)->i_mapping->host;
630 630
631 /* 631 /*
632 * Fallback to buffered I/O if we see an inode without 632 * Fallback to buffered I/O if we see an inode without
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
index fc121350d8cb..f1e1aed8f638 100644
--- a/fs/ocfs2/dir.c
+++ b/fs/ocfs2/dir.c
@@ -2014,12 +2014,12 @@ int ocfs2_dir_foreach(struct inode *inode, loff_t *f_pos, void *priv,
2014int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir) 2014int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir)
2015{ 2015{
2016 int error = 0; 2016 int error = 0;
2017 struct inode *inode = filp->f_path.dentry->d_inode; 2017 struct inode *inode = file_inode(filp);
2018 int lock_level = 0; 2018 int lock_level = 0;
2019 2019
2020 trace_ocfs2_readdir((unsigned long long)OCFS2_I(inode)->ip_blkno); 2020 trace_ocfs2_readdir((unsigned long long)OCFS2_I(inode)->ip_blkno);
2021 2021
2022 error = ocfs2_inode_lock_atime(inode, filp->f_vfsmnt, &lock_level); 2022 error = ocfs2_inode_lock_atime(inode, filp->f_path.mnt, &lock_level);
2023 if (lock_level && error >= 0) { 2023 if (lock_level && error >= 0) {
2024 /* We release EX lock which used to update atime 2024 /* We release EX lock which used to update atime
2025 * and get PR lock again to reduce contention 2025 * and get PR lock again to reduce contention
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index 005261c333b0..33ecbe0e6734 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -2020,7 +2020,7 @@ int dlm_dispatch_assert_master(struct dlm_ctxt *dlm,
2020 int ignore_higher, u8 request_from, u32 flags) 2020 int ignore_higher, u8 request_from, u32 flags)
2021{ 2021{
2022 struct dlm_work_item *item; 2022 struct dlm_work_item *item;
2023 item = kzalloc(sizeof(*item), GFP_NOFS); 2023 item = kzalloc(sizeof(*item), GFP_ATOMIC);
2024 if (!item) 2024 if (!item)
2025 return -ENOMEM; 2025 return -ENOMEM;
2026 2026
diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
index 16b712d260d4..4c5fc8d77dc2 100644
--- a/fs/ocfs2/dlmfs/dlmfs.c
+++ b/fs/ocfs2/dlmfs/dlmfs.c
@@ -224,7 +224,7 @@ static int dlmfs_file_setattr(struct dentry *dentry, struct iattr *attr)
224static unsigned int dlmfs_file_poll(struct file *file, poll_table *wait) 224static unsigned int dlmfs_file_poll(struct file *file, poll_table *wait)
225{ 225{
226 int event = 0; 226 int event = 0;
227 struct inode *inode = file->f_path.dentry->d_inode; 227 struct inode *inode = file_inode(file);
228 struct dlmfs_inode_private *ip = DLMFS_I(inode); 228 struct dlmfs_inode_private *ip = DLMFS_I(inode);
229 229
230 poll_wait(file, &ip->ip_lockres.l_event, wait); 230 poll_wait(file, &ip->ip_lockres.l_event, wait);
@@ -245,7 +245,7 @@ static ssize_t dlmfs_file_read(struct file *filp,
245 int bytes_left; 245 int bytes_left;
246 ssize_t readlen, got; 246 ssize_t readlen, got;
247 char *lvb_buf; 247 char *lvb_buf;
248 struct inode *inode = filp->f_path.dentry->d_inode; 248 struct inode *inode = file_inode(filp);
249 249
250 mlog(0, "inode %lu, count = %zu, *ppos = %llu\n", 250 mlog(0, "inode %lu, count = %zu, *ppos = %llu\n",
251 inode->i_ino, count, *ppos); 251 inode->i_ino, count, *ppos);
@@ -293,7 +293,7 @@ static ssize_t dlmfs_file_write(struct file *filp,
293 int bytes_left; 293 int bytes_left;
294 ssize_t writelen; 294 ssize_t writelen;
295 char *lvb_buf; 295 char *lvb_buf;
296 struct inode *inode = filp->f_path.dentry->d_inode; 296 struct inode *inode = file_inode(filp);
297 297
298 mlog(0, "inode %lu, count = %zu, *ppos = %llu\n", 298 mlog(0, "inode %lu, count = %zu, *ppos = %llu\n",
299 inode->i_ino, count, *ppos); 299 inode->i_ino, count, *ppos);
diff --git a/fs/ocfs2/export.c b/fs/ocfs2/export.c
index 322216a5f0dd..29651167190d 100644
--- a/fs/ocfs2/export.c
+++ b/fs/ocfs2/export.c
@@ -195,11 +195,11 @@ static int ocfs2_encode_fh(struct inode *inode, u32 *fh_in, int *max_len,
195 195
196 if (parent && (len < 6)) { 196 if (parent && (len < 6)) {
197 *max_len = 6; 197 *max_len = 6;
198 type = 255; 198 type = FILEID_INVALID;
199 goto bail; 199 goto bail;
200 } else if (len < 3) { 200 } else if (len < 3) {
201 *max_len = 3; 201 *max_len = 3;
202 type = 255; 202 type = FILEID_INVALID;
203 goto bail; 203 goto bail;
204 } 204 }
205 205
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 0a2924a2d9e6..6474cb44004d 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1950,7 +1950,7 @@ out:
1950int ocfs2_change_file_space(struct file *file, unsigned int cmd, 1950int ocfs2_change_file_space(struct file *file, unsigned int cmd,
1951 struct ocfs2_space_resv *sr) 1951 struct ocfs2_space_resv *sr)
1952{ 1952{
1953 struct inode *inode = file->f_path.dentry->d_inode; 1953 struct inode *inode = file_inode(file);
1954 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 1954 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
1955 int ret; 1955 int ret;
1956 1956
@@ -1978,7 +1978,7 @@ int ocfs2_change_file_space(struct file *file, unsigned int cmd,
1978static long ocfs2_fallocate(struct file *file, int mode, loff_t offset, 1978static long ocfs2_fallocate(struct file *file, int mode, loff_t offset,
1979 loff_t len) 1979 loff_t len)
1980{ 1980{
1981 struct inode *inode = file->f_path.dentry->d_inode; 1981 struct inode *inode = file_inode(file);
1982 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 1982 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
1983 struct ocfs2_space_resv sr; 1983 struct ocfs2_space_resv sr;
1984 int change_size = 1; 1984 int change_size = 1;
@@ -2233,7 +2233,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
2233 loff_t old_size, *ppos = &iocb->ki_pos; 2233 loff_t old_size, *ppos = &iocb->ki_pos;
2234 u32 old_clusters; 2234 u32 old_clusters;
2235 struct file *file = iocb->ki_filp; 2235 struct file *file = iocb->ki_filp;
2236 struct inode *inode = file->f_path.dentry->d_inode; 2236 struct inode *inode = file_inode(file);
2237 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 2237 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
2238 int full_coherency = !(osb->s_mount_opt & 2238 int full_coherency = !(osb->s_mount_opt &
2239 OCFS2_MOUNT_COHERENCY_BUFFERED); 2239 OCFS2_MOUNT_COHERENCY_BUFFERED);
@@ -2517,7 +2517,7 @@ static ssize_t ocfs2_file_splice_read(struct file *in,
2517 unsigned int flags) 2517 unsigned int flags)
2518{ 2518{
2519 int ret = 0, lock_level = 0; 2519 int ret = 0, lock_level = 0;
2520 struct inode *inode = in->f_path.dentry->d_inode; 2520 struct inode *inode = file_inode(in);
2521 2521
2522 trace_ocfs2_file_splice_read(inode, in, in->f_path.dentry, 2522 trace_ocfs2_file_splice_read(inode, in, in->f_path.dentry,
2523 (unsigned long long)OCFS2_I(inode)->ip_blkno, 2523 (unsigned long long)OCFS2_I(inode)->ip_blkno,
@@ -2527,7 +2527,7 @@ static ssize_t ocfs2_file_splice_read(struct file *in,
2527 /* 2527 /*
2528 * See the comment in ocfs2_file_aio_read() 2528 * See the comment in ocfs2_file_aio_read()
2529 */ 2529 */
2530 ret = ocfs2_inode_lock_atime(inode, in->f_vfsmnt, &lock_level); 2530 ret = ocfs2_inode_lock_atime(inode, in->f_path.mnt, &lock_level);
2531 if (ret < 0) { 2531 if (ret < 0) {
2532 mlog_errno(ret); 2532 mlog_errno(ret);
2533 goto bail; 2533 goto bail;
@@ -2547,7 +2547,7 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
2547{ 2547{
2548 int ret = 0, rw_level = -1, have_alloc_sem = 0, lock_level = 0; 2548 int ret = 0, rw_level = -1, have_alloc_sem = 0, lock_level = 0;
2549 struct file *filp = iocb->ki_filp; 2549 struct file *filp = iocb->ki_filp;
2550 struct inode *inode = filp->f_path.dentry->d_inode; 2550 struct inode *inode = file_inode(filp);
2551 2551
2552 trace_ocfs2_file_aio_read(inode, filp, filp->f_path.dentry, 2552 trace_ocfs2_file_aio_read(inode, filp, filp->f_path.dentry,
2553 (unsigned long long)OCFS2_I(inode)->ip_blkno, 2553 (unsigned long long)OCFS2_I(inode)->ip_blkno,
@@ -2590,7 +2590,7 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
2590 * like i_size. This allows the checks down below 2590 * like i_size. This allows the checks down below
2591 * generic_file_aio_read() a chance of actually working. 2591 * generic_file_aio_read() a chance of actually working.
2592 */ 2592 */
2593 ret = ocfs2_inode_lock_atime(inode, filp->f_vfsmnt, &lock_level); 2593 ret = ocfs2_inode_lock_atime(inode, filp->f_path.mnt, &lock_level);
2594 if (ret < 0) { 2594 if (ret < 0) {
2595 mlog_errno(ret); 2595 mlog_errno(ret);
2596 goto bail; 2596 goto bail;
diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c
index f20edcbfe700..752f0b26221d 100644
--- a/fs/ocfs2/ioctl.c
+++ b/fs/ocfs2/ioctl.c
@@ -881,7 +881,7 @@ bail:
881 881
882long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 882long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
883{ 883{
884 struct inode *inode = filp->f_path.dentry->d_inode; 884 struct inode *inode = file_inode(filp);
885 unsigned int flags; 885 unsigned int flags;
886 int new_clusters; 886 int new_clusters;
887 int status; 887 int status;
@@ -994,7 +994,7 @@ long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg)
994{ 994{
995 bool preserve; 995 bool preserve;
996 struct reflink_arguments args; 996 struct reflink_arguments args;
997 struct inode *inode = file->f_path.dentry->d_inode; 997 struct inode *inode = file_inode(file);
998 struct ocfs2_info info; 998 struct ocfs2_info info;
999 void __user *argp = (void __user *)arg; 999 void __user *argp = (void __user *)arg;
1000 1000
diff --git a/fs/ocfs2/mmap.c b/fs/ocfs2/mmap.c
index 47a87dda54ce..10d66c75cecb 100644
--- a/fs/ocfs2/mmap.c
+++ b/fs/ocfs2/mmap.c
@@ -62,7 +62,7 @@ static int __ocfs2_page_mkwrite(struct file *file, struct buffer_head *di_bh,
62 struct page *page) 62 struct page *page)
63{ 63{
64 int ret = VM_FAULT_NOPAGE; 64 int ret = VM_FAULT_NOPAGE;
65 struct inode *inode = file->f_path.dentry->d_inode; 65 struct inode *inode = file_inode(file);
66 struct address_space *mapping = inode->i_mapping; 66 struct address_space *mapping = inode->i_mapping;
67 loff_t pos = page_offset(page); 67 loff_t pos = page_offset(page);
68 unsigned int len = PAGE_CACHE_SIZE; 68 unsigned int len = PAGE_CACHE_SIZE;
@@ -131,7 +131,7 @@ out:
131static int ocfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) 131static int ocfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
132{ 132{
133 struct page *page = vmf->page; 133 struct page *page = vmf->page;
134 struct inode *inode = vma->vm_file->f_path.dentry->d_inode; 134 struct inode *inode = file_inode(vma->vm_file);
135 struct buffer_head *di_bh = NULL; 135 struct buffer_head *di_bh = NULL;
136 sigset_t oldset; 136 sigset_t oldset;
137 int ret; 137 int ret;
@@ -180,13 +180,13 @@ int ocfs2_mmap(struct file *file, struct vm_area_struct *vma)
180{ 180{
181 int ret = 0, lock_level = 0; 181 int ret = 0, lock_level = 0;
182 182
183 ret = ocfs2_inode_lock_atime(file->f_dentry->d_inode, 183 ret = ocfs2_inode_lock_atime(file_inode(file),
184 file->f_vfsmnt, &lock_level); 184 file->f_path.mnt, &lock_level);
185 if (ret < 0) { 185 if (ret < 0) {
186 mlog_errno(ret); 186 mlog_errno(ret);
187 goto out; 187 goto out;
188 } 188 }
189 ocfs2_inode_unlock(file->f_dentry->d_inode, lock_level); 189 ocfs2_inode_unlock(file_inode(file), lock_level);
190out: 190out:
191 vma->vm_ops = &ocfs2_file_vm_ops; 191 vma->vm_ops = &ocfs2_file_vm_ops;
192 return 0; 192 return 0;
diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c
index 6083432f667e..9f8dcadd9a50 100644
--- a/fs/ocfs2/move_extents.c
+++ b/fs/ocfs2/move_extents.c
@@ -1055,7 +1055,7 @@ int ocfs2_ioctl_move_extents(struct file *filp, void __user *argp)
1055{ 1055{
1056 int status; 1056 int status;
1057 1057
1058 struct inode *inode = filp->f_path.dentry->d_inode; 1058 struct inode *inode = file_inode(filp);
1059 struct ocfs2_move_extents range; 1059 struct ocfs2_move_extents range;
1060 struct ocfs2_move_extents_context *context = NULL; 1060 struct ocfs2_move_extents_context *context = NULL;
1061 1061
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index 934a4ac3e7fc..998b17eda09d 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -2927,7 +2927,7 @@ int ocfs2_duplicate_clusters_by_page(handle_t *handle,
2927 u32 new_cluster, u32 new_len) 2927 u32 new_cluster, u32 new_len)
2928{ 2928{
2929 int ret = 0, partial; 2929 int ret = 0, partial;
2930 struct inode *inode = file->f_path.dentry->d_inode; 2930 struct inode *inode = file_inode(file);
2931 struct ocfs2_caching_info *ci = INODE_CACHE(inode); 2931 struct ocfs2_caching_info *ci = INODE_CACHE(inode);
2932 struct super_block *sb = ocfs2_metadata_cache_get_super(ci); 2932 struct super_block *sb = ocfs2_metadata_cache_get_super(ci);
2933 u64 new_block = ocfs2_clusters_to_blocks(sb, new_cluster); 2933 u64 new_block = ocfs2_clusters_to_blocks(sb, new_cluster);
@@ -3020,7 +3020,7 @@ int ocfs2_duplicate_clusters_by_jbd(handle_t *handle,
3020 u32 new_cluster, u32 new_len) 3020 u32 new_cluster, u32 new_len)
3021{ 3021{
3022 int ret = 0; 3022 int ret = 0;
3023 struct inode *inode = file->f_path.dentry->d_inode; 3023 struct inode *inode = file_inode(file);
3024 struct super_block *sb = inode->i_sb; 3024 struct super_block *sb = inode->i_sb;
3025 struct ocfs2_caching_info *ci = INODE_CACHE(inode); 3025 struct ocfs2_caching_info *ci = INODE_CACHE(inode);
3026 int i, blocks = ocfs2_clusters_to_blocks(sb, new_len); 3026 int i, blocks = ocfs2_clusters_to_blocks(sb, new_len);
diff --git a/fs/ocfs2/symlink.c b/fs/ocfs2/symlink.c
index f1fbb4b552ad..66edce7ecfd7 100644
--- a/fs/ocfs2/symlink.c
+++ b/fs/ocfs2/symlink.c
@@ -57,7 +57,7 @@
57static int ocfs2_fast_symlink_readpage(struct file *unused, struct page *page) 57static int ocfs2_fast_symlink_readpage(struct file *unused, struct page *page)
58{ 58{
59 struct inode *inode = page->mapping->host; 59 struct inode *inode = page->mapping->host;
60 struct buffer_head *bh; 60 struct buffer_head *bh = NULL;
61 int status = ocfs2_read_inode_block(inode, &bh); 61 int status = ocfs2_read_inode_block(inode, &bh);
62 struct ocfs2_dinode *fe; 62 struct ocfs2_dinode *fe;
63 const char *link; 63 const char *link;