vfs_inode.c (47237687d73cbeae1dd7a133c3fc3d7239094568) vfs_inode.c (d95852777bc8ba6b3ad3397d495c5f9dd8ca8383)
1/*
2 * linux/fs/9p/vfs_inode.c
3 *
4 * This file contains vfs inode ops for the 9P2000 protocol.
5 *
6 * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com>
7 * Copyright (C) 2002 by Ron Minnich <rminnich@lanl.gov>
8 *

--- 842 unchanged lines hidden (view full) ---

851error_iput:
852 iput(inode);
853error:
854 p9_client_clunk(fid);
855
856 return ERR_PTR(result);
857}
858
1/*
2 * linux/fs/9p/vfs_inode.c
3 *
4 * This file contains vfs inode ops for the 9P2000 protocol.
5 *
6 * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com>
7 * Copyright (C) 2002 by Ron Minnich <rminnich@lanl.gov>
8 *

--- 842 unchanged lines hidden (view full) ---

851error_iput:
852 iput(inode);
853error:
854 p9_client_clunk(fid);
855
856 return ERR_PTR(result);
857}
858
859static struct file *
859static int
860v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
861 struct opendata *od, unsigned flags, umode_t mode,
862 int *opened)
863{
864 int err;
865 u32 perm;
866 struct file *filp;
867 struct v9fs_inode *v9inode;
868 struct v9fs_session_info *v9ses;
869 struct p9_fid *fid, *inode_fid;
870 struct dentry *res = NULL;
871
872 if (d_unhashed(dentry)) {
873 res = v9fs_vfs_lookup(dir, dentry, NULL);
874 if (IS_ERR(res))
860v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
861 struct opendata *od, unsigned flags, umode_t mode,
862 int *opened)
863{
864 int err;
865 u32 perm;
866 struct file *filp;
867 struct v9fs_inode *v9inode;
868 struct v9fs_session_info *v9ses;
869 struct p9_fid *fid, *inode_fid;
870 struct dentry *res = NULL;
871
872 if (d_unhashed(dentry)) {
873 res = v9fs_vfs_lookup(dir, dentry, NULL);
874 if (IS_ERR(res))
875 return ERR_CAST(res);
875 return PTR_ERR(res);
876
877 if (res)
878 dentry = res;
879 }
880
881 /* Only creates */
882 if (!(flags & O_CREAT) || dentry->d_inode) {
883 finish_no_open(od, res);
876
877 if (res)
878 dentry = res;
879 }
880
881 /* Only creates */
882 if (!(flags & O_CREAT) || dentry->d_inode) {
883 finish_no_open(od, res);
884 return NULL;
884 return 1;
885 }
886
887 err = 0;
888 fid = NULL;
889 v9ses = v9fs_inode2v9ses(dir);
890 perm = unixmode2p9mode(v9ses, mode);
891 fid = v9fs_create(v9ses, dir, dentry, NULL, perm,
892 v9fs_uflags2omode(flags,

--- 35 unchanged lines hidden (view full) ---

928#ifdef CONFIG_9P_FSCACHE
929 if (v9ses->cache)
930 v9fs_cache_inode_set_cookie(dentry->d_inode, filp);
931#endif
932
933 *opened |= FILE_CREATED;
934out:
935 dput(res);
885 }
886
887 err = 0;
888 fid = NULL;
889 v9ses = v9fs_inode2v9ses(dir);
890 perm = unixmode2p9mode(v9ses, mode);
891 fid = v9fs_create(v9ses, dir, dentry, NULL, perm,
892 v9fs_uflags2omode(flags,

--- 35 unchanged lines hidden (view full) ---

928#ifdef CONFIG_9P_FSCACHE
929 if (v9ses->cache)
930 v9fs_cache_inode_set_cookie(dentry->d_inode, filp);
931#endif
932
933 *opened |= FILE_CREATED;
934out:
935 dput(res);
936 return filp;
936 return err;
937
938error:
939 if (fid)
940 p9_client_clunk(fid);
937
938error:
939 if (fid)
940 p9_client_clunk(fid);
941
942 filp = ERR_PTR(err);
943 goto out;
944}
945
946/**
947 * v9fs_vfs_unlink - VFS unlink hook to delete an inode
948 * @i: inode that is being unlinked
949 * @d: dentry that is being unlinked
950 *

--- 611 unchanged lines hidden ---
941 goto out;
942}
943
944/**
945 * v9fs_vfs_unlink - VFS unlink hook to delete an inode
946 * @i: inode that is being unlinked
947 * @d: dentry that is being unlinked
948 *

--- 611 unchanged lines hidden ---