dir.c (057316cc6a5b521b332a1d7ccc871cd60c904c74) dir.c (3516586a424ea5727be089da6541cbd5644f0497)
1/*
2 * linux/fs/nfs/dir.c
3 *
4 * Copyright (C) 1992 Rick Sladkey
5 *
6 * nfs directory handling functions
7 *
8 * 10 Apr 1996 Added silly rename for unlink --okir

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

702/*
703 * Use intent information to check whether or not we're going to do
704 * an O_EXCL create using this path component.
705 */
706static int nfs_is_exclusive_create(struct inode *dir, struct nameidata *nd)
707{
708 if (NFS_PROTO(dir)->version == 2)
709 return 0;
1/*
2 * linux/fs/nfs/dir.c
3 *
4 * Copyright (C) 1992 Rick Sladkey
5 *
6 * nfs directory handling functions
7 *
8 * 10 Apr 1996 Added silly rename for unlink --okir

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

702/*
703 * Use intent information to check whether or not we're going to do
704 * an O_EXCL create using this path component.
705 */
706static int nfs_is_exclusive_create(struct inode *dir, struct nameidata *nd)
707{
708 if (NFS_PROTO(dir)->version == 2)
709 return 0;
710 if (nd == NULL || nfs_lookup_check_intent(nd, LOOKUP_CREATE) == 0)
711 return 0;
712 return (nd->intent.open.flags & O_EXCL) != 0;
710 return nd && nfs_lookup_check_intent(nd, LOOKUP_EXCL);
713}
714
715/*
716 * Inode and filehandle revalidation for lookups.
717 *
718 * We force revalidation in the cases where the VFS sets LOOKUP_REVAL,
719 * or if the intent information indicates that we're about to open this
720 * particular file and the "nocto" mount flag is not set.

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

1004 if (dentry->d_name.len > NFS_SERVER(dir)->namelen) {
1005 res = ERR_PTR(-ENAMETOOLONG);
1006 goto out;
1007 }
1008 dentry->d_op = NFS_PROTO(dir)->dentry_ops;
1009
1010 /* Let vfs_create() deal with O_EXCL. Instantiate, but don't hash
1011 * the dentry. */
711}
712
713/*
714 * Inode and filehandle revalidation for lookups.
715 *
716 * We force revalidation in the cases where the VFS sets LOOKUP_REVAL,
717 * or if the intent information indicates that we're about to open this
718 * particular file and the "nocto" mount flag is not set.

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

1002 if (dentry->d_name.len > NFS_SERVER(dir)->namelen) {
1003 res = ERR_PTR(-ENAMETOOLONG);
1004 goto out;
1005 }
1006 dentry->d_op = NFS_PROTO(dir)->dentry_ops;
1007
1008 /* Let vfs_create() deal with O_EXCL. Instantiate, but don't hash
1009 * the dentry. */
1012 if (nd->intent.open.flags & O_EXCL) {
1010 if (nd->flags & LOOKUP_EXCL) {
1013 d_instantiate(dentry, NULL);
1014 goto out;
1015 }
1016
1017 /* Open the file on the server */
1018 res = nfs4_atomic_open(dir, dentry, nd);
1019 if (IS_ERR(res)) {
1020 error = PTR_ERR(res);

--- 957 unchanged lines hidden ---
1011 d_instantiate(dentry, NULL);
1012 goto out;
1013 }
1014
1015 /* Open the file on the server */
1016 res = nfs4_atomic_open(dir, dentry, nd);
1017 if (IS_ERR(res)) {
1018 error = PTR_ERR(res);

--- 957 unchanged lines hidden ---