aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-23 17:07:38 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-22 23:31:31 -0500
commit496ad9aa8ef448058e36ca7a787c61f2e63f0f54 (patch)
tree8f4abde793cd7db5bb8fde6d27ebcacd0e54379a /fs/ceph
parent57eccb830f1cc93d4b506ba306d8dfa685e0c88f (diff)
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/addr.c12
-rw-r--r--fs/ceph/dir.c6
-rw-r--r--fs/ceph/file.c10
-rw-r--r--fs/ceph/ioctl.c16
-rw-r--r--fs/ceph/locks.c2
5 files changed, 23 insertions, 23 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 064d1a68d2c1..d4f81edd9a5d 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -195,7 +195,7 @@ static int ceph_releasepage(struct page *page, gfp_t g)
195 */ 195 */
196static int readpage_nounlock(struct file *filp, struct page *page) 196static int readpage_nounlock(struct file *filp, struct page *page)
197{ 197{
198 struct inode *inode = filp->f_dentry->d_inode; 198 struct inode *inode = file_inode(filp);
199 struct ceph_inode_info *ci = ceph_inode(inode); 199 struct ceph_inode_info *ci = ceph_inode(inode);
200 struct ceph_osd_client *osdc = 200 struct ceph_osd_client *osdc =
201 &ceph_inode_to_client(inode)->client->osdc; 201 &ceph_inode_to_client(inode)->client->osdc;
@@ -370,7 +370,7 @@ out:
370static int ceph_readpages(struct file *file, struct address_space *mapping, 370static int ceph_readpages(struct file *file, struct address_space *mapping,
371 struct list_head *page_list, unsigned nr_pages) 371 struct list_head *page_list, unsigned nr_pages)
372{ 372{
373 struct inode *inode = file->f_dentry->d_inode; 373 struct inode *inode = file_inode(file);
374 struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 374 struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
375 int rc = 0; 375 int rc = 0;
376 int max = 0; 376 int max = 0;
@@ -977,7 +977,7 @@ static int ceph_update_writeable_page(struct file *file,
977 loff_t pos, unsigned len, 977 loff_t pos, unsigned len,
978 struct page *page) 978 struct page *page)
979{ 979{
980 struct inode *inode = file->f_dentry->d_inode; 980 struct inode *inode = file_inode(file);
981 struct ceph_inode_info *ci = ceph_inode(inode); 981 struct ceph_inode_info *ci = ceph_inode(inode);
982 struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; 982 struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc;
983 loff_t page_off = pos & PAGE_CACHE_MASK; 983 loff_t page_off = pos & PAGE_CACHE_MASK;
@@ -1086,7 +1086,7 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping,
1086 loff_t pos, unsigned len, unsigned flags, 1086 loff_t pos, unsigned len, unsigned flags,
1087 struct page **pagep, void **fsdata) 1087 struct page **pagep, void **fsdata)
1088{ 1088{
1089 struct inode *inode = file->f_dentry->d_inode; 1089 struct inode *inode = file_inode(file);
1090 struct ceph_inode_info *ci = ceph_inode(inode); 1090 struct ceph_inode_info *ci = ceph_inode(inode);
1091 struct ceph_file_info *fi = file->private_data; 1091 struct ceph_file_info *fi = file->private_data;
1092 struct page *page; 1092 struct page *page;
@@ -1144,7 +1144,7 @@ static int ceph_write_end(struct file *file, struct address_space *mapping,
1144 loff_t pos, unsigned len, unsigned copied, 1144 loff_t pos, unsigned len, unsigned copied,
1145 struct page *page, void *fsdata) 1145 struct page *page, void *fsdata)
1146{ 1146{
1147 struct inode *inode = file->f_dentry->d_inode; 1147 struct inode *inode = file_inode(file);
1148 struct ceph_inode_info *ci = ceph_inode(inode); 1148 struct ceph_inode_info *ci = ceph_inode(inode);
1149 struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 1149 struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
1150 struct ceph_mds_client *mdsc = fsc->mdsc; 1150 struct ceph_mds_client *mdsc = fsc->mdsc;
@@ -1228,7 +1228,7 @@ const struct address_space_operations ceph_aops = {
1228 */ 1228 */
1229static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) 1229static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
1230{ 1230{
1231 struct inode *inode = vma->vm_file->f_dentry->d_inode; 1231 struct inode *inode = file_inode(vma->vm_file);
1232 struct page *page = vmf->page; 1232 struct page *page = vmf->page;
1233 struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; 1233 struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc;
1234 loff_t off = page_offset(page); 1234 loff_t off = page_offset(page);
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 8c1aabe93b67..6d797f46d772 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -238,7 +238,7 @@ static int note_last_dentry(struct ceph_file_info *fi, const char *name,
238static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir) 238static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir)
239{ 239{
240 struct ceph_file_info *fi = filp->private_data; 240 struct ceph_file_info *fi = filp->private_data;
241 struct inode *inode = filp->f_dentry->d_inode; 241 struct inode *inode = file_inode(filp);
242 struct ceph_inode_info *ci = ceph_inode(inode); 242 struct ceph_inode_info *ci = ceph_inode(inode);
243 struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 243 struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
244 struct ceph_mds_client *mdsc = fsc->mdsc; 244 struct ceph_mds_client *mdsc = fsc->mdsc;
@@ -1138,7 +1138,7 @@ static ssize_t ceph_read_dir(struct file *file, char __user *buf, size_t size,
1138 loff_t *ppos) 1138 loff_t *ppos)
1139{ 1139{
1140 struct ceph_file_info *cf = file->private_data; 1140 struct ceph_file_info *cf = file->private_data;
1141 struct inode *inode = file->f_dentry->d_inode; 1141 struct inode *inode = file_inode(file);
1142 struct ceph_inode_info *ci = ceph_inode(inode); 1142 struct ceph_inode_info *ci = ceph_inode(inode);
1143 int left; 1143 int left;
1144 const int bufsize = 1024; 1144 const int bufsize = 1024;
@@ -1188,7 +1188,7 @@ static ssize_t ceph_read_dir(struct file *file, char __user *buf, size_t size,
1188static int ceph_dir_fsync(struct file *file, loff_t start, loff_t end, 1188static int ceph_dir_fsync(struct file *file, loff_t start, loff_t end,
1189 int datasync) 1189 int datasync)
1190{ 1190{
1191 struct inode *inode = file->f_path.dentry->d_inode; 1191 struct inode *inode = file_inode(file);
1192 struct ceph_inode_info *ci = ceph_inode(inode); 1192 struct ceph_inode_info *ci = ceph_inode(inode);
1193 struct list_head *head = &ci->i_unsafe_dirops; 1193 struct list_head *head = &ci->i_unsafe_dirops;
1194 struct ceph_mds_request *req; 1194 struct ceph_mds_request *req;
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index e51558fca3a3..11b57c2c8f15 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -393,7 +393,7 @@ more:
393static ssize_t ceph_sync_read(struct file *file, char __user *data, 393static ssize_t ceph_sync_read(struct file *file, char __user *data,
394 unsigned len, loff_t *poff, int *checkeof) 394 unsigned len, loff_t *poff, int *checkeof)
395{ 395{
396 struct inode *inode = file->f_dentry->d_inode; 396 struct inode *inode = file_inode(file);
397 struct page **pages; 397 struct page **pages;
398 u64 off = *poff; 398 u64 off = *poff;
399 int num_pages, ret; 399 int num_pages, ret;
@@ -466,7 +466,7 @@ static void sync_write_commit(struct ceph_osd_request *req,
466static ssize_t ceph_sync_write(struct file *file, const char __user *data, 466static ssize_t ceph_sync_write(struct file *file, const char __user *data,
467 size_t left, loff_t *offset) 467 size_t left, loff_t *offset)
468{ 468{
469 struct inode *inode = file->f_dentry->d_inode; 469 struct inode *inode = file_inode(file);
470 struct ceph_inode_info *ci = ceph_inode(inode); 470 struct ceph_inode_info *ci = ceph_inode(inode);
471 struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 471 struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
472 struct ceph_osd_request *req; 472 struct ceph_osd_request *req;
@@ -483,7 +483,7 @@ static ssize_t ceph_sync_write(struct file *file, const char __user *data,
483 int ret; 483 int ret;
484 struct timespec mtime = CURRENT_TIME; 484 struct timespec mtime = CURRENT_TIME;
485 485
486 if (ceph_snap(file->f_dentry->d_inode) != CEPH_NOSNAP) 486 if (ceph_snap(file_inode(file)) != CEPH_NOSNAP)
487 return -EROFS; 487 return -EROFS;
488 488
489 dout("sync_write on file %p %lld~%u %s\n", file, *offset, 489 dout("sync_write on file %p %lld~%u %s\n", file, *offset,
@@ -637,7 +637,7 @@ static ssize_t ceph_aio_read(struct kiocb *iocb, const struct iovec *iov,
637 struct ceph_file_info *fi = filp->private_data; 637 struct ceph_file_info *fi = filp->private_data;
638 loff_t *ppos = &iocb->ki_pos; 638 loff_t *ppos = &iocb->ki_pos;
639 size_t len = iov->iov_len; 639 size_t len = iov->iov_len;
640 struct inode *inode = filp->f_dentry->d_inode; 640 struct inode *inode = file_inode(filp);
641 struct ceph_inode_info *ci = ceph_inode(inode); 641 struct ceph_inode_info *ci = ceph_inode(inode);
642 void __user *base = iov->iov_base; 642 void __user *base = iov->iov_base;
643 ssize_t ret; 643 ssize_t ret;
@@ -707,7 +707,7 @@ static ssize_t ceph_aio_write(struct kiocb *iocb, const struct iovec *iov,
707{ 707{
708 struct file *file = iocb->ki_filp; 708 struct file *file = iocb->ki_filp;
709 struct ceph_file_info *fi = file->private_data; 709 struct ceph_file_info *fi = file->private_data;
710 struct inode *inode = file->f_dentry->d_inode; 710 struct inode *inode = file_inode(file);
711 struct ceph_inode_info *ci = ceph_inode(inode); 711 struct ceph_inode_info *ci = ceph_inode(inode);
712 struct ceph_osd_client *osdc = 712 struct ceph_osd_client *osdc =
713 &ceph_sb_to_client(inode->i_sb)->client->osdc; 713 &ceph_sb_to_client(inode->i_sb)->client->osdc;
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c
index 36549a46e311..f5ed767806df 100644
--- a/fs/ceph/ioctl.c
+++ b/fs/ceph/ioctl.c
@@ -16,11 +16,11 @@
16 */ 16 */
17static long ceph_ioctl_get_layout(struct file *file, void __user *arg) 17static long ceph_ioctl_get_layout(struct file *file, void __user *arg)
18{ 18{
19 struct ceph_inode_info *ci = ceph_inode(file->f_dentry->d_inode); 19 struct ceph_inode_info *ci = ceph_inode(file_inode(file));
20 struct ceph_ioctl_layout l; 20 struct ceph_ioctl_layout l;
21 int err; 21 int err;
22 22
23 err = ceph_do_getattr(file->f_dentry->d_inode, CEPH_STAT_CAP_LAYOUT); 23 err = ceph_do_getattr(file_inode(file), CEPH_STAT_CAP_LAYOUT);
24 if (!err) { 24 if (!err) {
25 l.stripe_unit = ceph_file_layout_su(ci->i_layout); 25 l.stripe_unit = ceph_file_layout_su(ci->i_layout);
26 l.stripe_count = ceph_file_layout_stripe_count(ci->i_layout); 26 l.stripe_count = ceph_file_layout_stripe_count(ci->i_layout);
@@ -63,12 +63,12 @@ static long __validate_layout(struct ceph_mds_client *mdsc,
63 63
64static long ceph_ioctl_set_layout(struct file *file, void __user *arg) 64static long ceph_ioctl_set_layout(struct file *file, void __user *arg)
65{ 65{
66 struct inode *inode = file->f_dentry->d_inode; 66 struct inode *inode = file_inode(file);
67 struct inode *parent_inode; 67 struct inode *parent_inode;
68 struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; 68 struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc;
69 struct ceph_mds_request *req; 69 struct ceph_mds_request *req;
70 struct ceph_ioctl_layout l; 70 struct ceph_ioctl_layout l;
71 struct ceph_inode_info *ci = ceph_inode(file->f_dentry->d_inode); 71 struct ceph_inode_info *ci = ceph_inode(file_inode(file));
72 struct ceph_ioctl_layout nl; 72 struct ceph_ioctl_layout nl;
73 int err; 73 int err;
74 74
@@ -76,7 +76,7 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg)
76 return -EFAULT; 76 return -EFAULT;
77 77
78 /* validate changed params against current layout */ 78 /* validate changed params against current layout */
79 err = ceph_do_getattr(file->f_dentry->d_inode, CEPH_STAT_CAP_LAYOUT); 79 err = ceph_do_getattr(file_inode(file), CEPH_STAT_CAP_LAYOUT);
80 if (err) 80 if (err)
81 return err; 81 return err;
82 82
@@ -136,7 +136,7 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg)
136 */ 136 */
137static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg) 137static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg)
138{ 138{
139 struct inode *inode = file->f_dentry->d_inode; 139 struct inode *inode = file_inode(file);
140 struct ceph_mds_request *req; 140 struct ceph_mds_request *req;
141 struct ceph_ioctl_layout l; 141 struct ceph_ioctl_layout l;
142 int err; 142 int err;
@@ -179,7 +179,7 @@ static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg)
179static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg) 179static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg)
180{ 180{
181 struct ceph_ioctl_dataloc dl; 181 struct ceph_ioctl_dataloc dl;
182 struct inode *inode = file->f_dentry->d_inode; 182 struct inode *inode = file_inode(file);
183 struct ceph_inode_info *ci = ceph_inode(inode); 183 struct ceph_inode_info *ci = ceph_inode(inode);
184 struct ceph_osd_client *osdc = 184 struct ceph_osd_client *osdc =
185 &ceph_sb_to_client(inode->i_sb)->client->osdc; 185 &ceph_sb_to_client(inode->i_sb)->client->osdc;
@@ -234,7 +234,7 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg)
234static long ceph_ioctl_lazyio(struct file *file) 234static long ceph_ioctl_lazyio(struct file *file)
235{ 235{
236 struct ceph_file_info *fi = file->private_data; 236 struct ceph_file_info *fi = file->private_data;
237 struct inode *inode = file->f_dentry->d_inode; 237 struct inode *inode = file_inode(file);
238 struct ceph_inode_info *ci = ceph_inode(inode); 238 struct ceph_inode_info *ci = ceph_inode(inode);
239 239
240 if ((fi->fmode & CEPH_FILE_MODE_LAZY) == 0) { 240 if ((fi->fmode & CEPH_FILE_MODE_LAZY) == 0) {
diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c
index 80576d05d687..202dd3d68be0 100644
--- a/fs/ceph/locks.c
+++ b/fs/ceph/locks.c
@@ -13,7 +13,7 @@
13static int ceph_lock_message(u8 lock_type, u16 operation, struct file *file, 13static int ceph_lock_message(u8 lock_type, u16 operation, struct file *file,
14 int cmd, u8 wait, struct file_lock *fl) 14 int cmd, u8 wait, struct file_lock *fl)
15{ 15{
16 struct inode *inode = file->f_dentry->d_inode; 16 struct inode *inode = file_inode(file);
17 struct ceph_mds_client *mdsc = 17 struct ceph_mds_client *mdsc =
18 ceph_sb_to_client(inode->i_sb)->mdsc; 18 ceph_sb_to_client(inode->i_sb)->mdsc;
19 struct ceph_mds_request *req; 19 struct ceph_mds_request *req;