dir.c (47237687d73cbeae1dd7a133c3fc3d7239094568) | dir.c (d95852777bc8ba6b3ad3397d495c5f9dd8ca8383) |
---|---|
1#include <linux/ceph/ceph_debug.h> 2 3#include <linux/spinlock.h> 4#include <linux/fs_struct.h> 5#include <linux/namei.h> 6#include <linux/slab.h> 7#include <linux/sched.h> 8 --- 620 unchanged lines hidden (view full) --- 629 err = ceph_mdsc_do_request(mdsc, NULL, req); 630 err = ceph_handle_snapdir(req, dentry, err); 631 dentry = ceph_finish_lookup(req, dentry, err); 632 ceph_mdsc_put_request(req); /* will dput(dentry) */ 633 dout("lookup result=%p\n", dentry); 634 return dentry; 635} 636 | 1#include <linux/ceph/ceph_debug.h> 2 3#include <linux/spinlock.h> 4#include <linux/fs_struct.h> 5#include <linux/namei.h> 6#include <linux/slab.h> 7#include <linux/sched.h> 8 --- 620 unchanged lines hidden (view full) --- 629 err = ceph_mdsc_do_request(mdsc, NULL, req); 630 err = ceph_handle_snapdir(req, dentry, err); 631 dentry = ceph_finish_lookup(req, dentry, err); 632 ceph_mdsc_put_request(req); /* will dput(dentry) */ 633 dout("lookup result=%p\n", dentry); 634 return dentry; 635} 636 |
637struct file *ceph_atomic_open(struct inode *dir, struct dentry *dentry, 638 struct opendata *od, unsigned flags, umode_t mode, 639 int *opened) | 637int ceph_atomic_open(struct inode *dir, struct dentry *dentry, 638 struct opendata *od, unsigned flags, umode_t mode, 639 int *opened) |
640{ 641 int err; 642 struct dentry *res = NULL; | 640{ 641 int err; 642 struct dentry *res = NULL; |
643 struct file *filp; | |
644 645 if (!(flags & O_CREAT)) { 646 if (dentry->d_name.len > NAME_MAX) | 643 644 if (!(flags & O_CREAT)) { 645 if (dentry->d_name.len > NAME_MAX) |
647 return ERR_PTR(-ENAMETOOLONG); | 646 return -ENAMETOOLONG; |
648 649 err = ceph_init_dentry(dentry); 650 if (err < 0) | 647 648 err = ceph_init_dentry(dentry); 649 if (err < 0) |
651 return ERR_PTR(err); | 650 return err; |
652 653 return ceph_lookup_open(dir, dentry, od, flags, mode, opened); 654 } 655 656 if (d_unhashed(dentry)) { 657 res = ceph_lookup(dir, dentry, NULL); 658 if (IS_ERR(res)) | 651 652 return ceph_lookup_open(dir, dentry, od, flags, mode, opened); 653 } 654 655 if (d_unhashed(dentry)) { 656 res = ceph_lookup(dir, dentry, NULL); 657 if (IS_ERR(res)) |
659 return ERR_CAST(res); | 658 return PTR_ERR(res); |
660 661 if (res) 662 dentry = res; 663 } 664 665 /* We don't deal with positive dentries here */ 666 if (dentry->d_inode) { 667 finish_no_open(od, res); | 659 660 if (res) 661 dentry = res; 662 } 663 664 /* We don't deal with positive dentries here */ 665 if (dentry->d_inode) { 666 finish_no_open(od, res); |
668 return NULL; | 667 return 1; |
669 } 670 671 *opened |= FILE_CREATED; | 668 } 669 670 *opened |= FILE_CREATED; |
672 filp = ceph_lookup_open(dir, dentry, od, flags, mode, opened); | 671 err = ceph_lookup_open(dir, dentry, od, flags, mode, opened); |
673 dput(res); 674 | 672 dput(res); 673 |
675 return filp; | 674 return err; |
676} 677 678/* 679 * If we do a create but get no trace back from the MDS, follow up with 680 * a lookup (the VFS expects us to link up the provided dentry). 681 */ 682int ceph_handle_notrace_create(struct inode *dir, struct dentry *dentry) 683{ --- 711 unchanged lines hidden --- | 675} 676 677/* 678 * If we do a create but get no trace back from the MDS, follow up with 679 * a lookup (the VFS expects us to link up the provided dentry). 680 */ 681int ceph_handle_notrace_create(struct inode *dir, struct dentry *dentry) 682{ --- 711 unchanged lines hidden --- |