nfs4proc.c (cd9a1c0e5ac681871d64804f82291649e2a0accb) | nfs4proc.c (f46e0bd34ec002d0727761da52b8fd47f06d4440) |
---|---|
1/* 2 * fs/nfs/nfs4proc.c 3 * 4 * Client-side procedure declarations for NFSv4. 5 * 6 * Copyright (c) 2002 The Regents of the University of Michigan. 7 * All rights reserved. 8 * --- 2010 unchanged lines hidden (view full) --- 2019 return 0; 2020 } 2021 ret = PTR_ERR(filp); 2022out_close: 2023 nfs4_close_sync(path, state, fmode & (FMODE_READ|FMODE_WRITE)); 2024 return ret; 2025} 2026 | 1/* 2 * fs/nfs/nfs4proc.c 3 * 4 * Client-side procedure declarations for NFSv4. 5 * 6 * Copyright (c) 2002 The Regents of the University of Michigan. 7 * All rights reserved. 8 * --- 2010 unchanged lines hidden (view full) --- 2019 return 0; 2020 } 2021 ret = PTR_ERR(filp); 2022out_close: 2023 nfs4_close_sync(path, state, fmode & (FMODE_READ|FMODE_WRITE)); 2024 return ret; 2025} 2026 |
2027struct dentry * | 2027struct inode * |
2028nfs4_atomic_open(struct inode *dir, struct nfs_open_context *ctx, int open_flags, struct iattr *attr) 2029{ | 2028nfs4_atomic_open(struct inode *dir, struct nfs_open_context *ctx, int open_flags, struct iattr *attr) 2029{ |
2030 struct dentry *dentry = ctx->path.dentry; 2031 struct dentry *parent; | |
2032 struct nfs4_state *state; | 2030 struct nfs4_state *state; |
2033 struct dentry *res; | |
2034 | 2031 |
2035 parent = dentry->d_parent; | |
2036 /* Protect against concurrent sillydeletes */ | 2032 /* Protect against concurrent sillydeletes */ |
2037 nfs_block_sillyrename(parent); | |
2038 state = nfs4_do_open(dir, &ctx->path, ctx->mode, open_flags, attr, ctx->cred); | 2033 state = nfs4_do_open(dir, &ctx->path, ctx->mode, open_flags, attr, ctx->cred); |
2039 if (IS_ERR(state)) { 2040 if (PTR_ERR(state) == -ENOENT) { 2041 d_add(dentry, NULL); 2042 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); 2043 } 2044 nfs_unblock_sillyrename(parent); 2045 return (struct dentry *)state; 2046 } 2047 res = d_add_unique(dentry, igrab(state->inode)); 2048 if (res != NULL) { 2049 struct dentry *dummy = ctx->path.dentry; 2050 2051 ctx->path.dentry = dget(res); 2052 dput(dummy); 2053 } | 2034 if (IS_ERR(state)) 2035 return ERR_CAST(state); |
2054 ctx->state = state; | 2036 ctx->state = state; |
2055 nfs_set_verifier(ctx->path.dentry, nfs_save_change_attribute(dir)); 2056 nfs_unblock_sillyrename(parent); 2057 return res; | 2037 return igrab(state->inode); |
2058} 2059 2060int 2061nfs4_open_revalidate(struct inode *dir, struct dentry *dentry, int openflags, struct nameidata *nd) 2062{ 2063 struct path path = { 2064 .mnt = nd->path.mnt, 2065 .dentry = dentry, --- 3389 unchanged lines hidden --- | 2038} 2039 2040int 2041nfs4_open_revalidate(struct inode *dir, struct dentry *dentry, int openflags, struct nameidata *nd) 2042{ 2043 struct path path = { 2044 .mnt = nd->path.mnt, 2045 .dentry = dentry, --- 3389 unchanged lines hidden --- |