nfsd: fix horrible indentation in nfsd_setattr
Subsystems (2)
PATCH 1/1 nfsd: fix horrible indentation in nfsd_setattr
fs/nfsd/vfs.c +26 -17
@@ -277,7 +277,8 @@if (!iap->ia_valid) goto out; -/* NFSv2 does not differentiate between "set-[ac]time-to-now" +/* +* NFSv2 does not differentiate between "set-[ac]time-to-now" * which only requires access, and "set-[ac]time-to-X" which * requires ownership. * So if it looks like it might be "set both to the same time which
@@ -290,25 +291,33 @@*/ #define BOTH_TIME_SET (ATTR_ATIME_SET | ATTR_MTIME_SET)#define MAX_TOUCH_TIME_ERROR (30*60) -if ((iap->ia_valid &BOTH_TIME_SET ) ==BOTH_TIME_SET - && iap->ia_mtime.tv_sec == iap->ia_atime.tv_sec - ) { -/* Looks probable. Now just make sure time is in the right ballpark. -* Solaris, at least, doesn't seem to care what the time request is. -* We require it be within 30 minutes of now. -*/ -time_t delta = iap->ia_atime.tv_sec -get_seconds (); -if (delta<0 ) delta = -delta; -if (delta <MAX_TOUCH_TIME_ERROR && -inode_change_ok (inode, iap) !=0 ) { -/* turn off ATTR_[AM]TIME_SET but leave ATTR_[AM]TIME -* this will cause notify_change to set these times to "now" +if ((iap->ia_valid &BOTH_TIME_SET ) ==BOTH_TIME_SET && + iap->ia_mtime.tv_sec == iap->ia_atime.tv_sec) { +/* +* Looks probable. +* +* Now just make sure time is in the right ballpark. +* Solaris, at least, doesn't seem to care what the time +* request is. We require it be within 30 minutes of now. */ - iap->ia_valid &= ~BOTH_TIME_SET ; - } +time_t delta = iap->ia_atime.tv_sec -get_seconds (); +if (delta <0 ) + delta = -delta; +if (delta <MAX_TOUCH_TIME_ERROR && +inode_change_ok (inode, iap) !=0 ) { +/* +* Turn off ATTR_[AM]TIME_SET but leave ATTR_[AM]TIME. +* This will cause notify_change to set these times +* to "now" +*/ + iap->ia_valid &= ~BOTH_TIME_SET ; + } } -/* The size case is special. It changes the file as well as the attributes. */ +/* +* The size case is special. +* It changes the file as well as the attributes. +*/ if (iap->ia_valid &ATTR_SIZE ) {if (iap->ia_size < inode->i_size) { err =nfsd_permission (fhp->fh_export, dentry,MAY_TRUNC |MAY_OWNER_OVERRIDE );
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 2 lines · Christoph Hellwig
Signed-off-by Christoph Hellwig <[email protected]>
ping?
Quoted 67 lines
Index:
linux-2.6/fs/nfsd/vfs.c
===================================================================fs/nfsd/vfs.c +26
-18@@ -277,7 +277,8 @@if (!iap->ia_valid) goto out; -/* NFSv2 does not differentiate between "set-[ac]time-to-now" +/* +* NFSv2 does not differentiate between "set-[ac]time-to-now" * which only requires access, and "set-[ac]time-to-X" which * requires ownership. * So if it looks like it might be "set both to the same time which @@ -290,25 +291,33 @@*/ #define BOTH_TIME_SET (ATTR_ATIME_SET | ATTR_MTIME_SET)#define MAX_TOUCH_TIME_ERROR (30*60) -if ((iap->ia_valid &BOTH_TIME_SET ) ==BOTH_TIME_SET - && iap->ia_mtime.tv_sec == iap->ia_atime.tv_sec - ) { -/* Looks probable. Now just make sure time is in the right ballpark. -* Solaris, at least, doesn't seem to care what the time request is. -* We require it be within 30 minutes of now. -*/ -time_t delta = iap->ia_atime.tv_sec -get_seconds (); -if (delta<0 ) delta = -delta; -if (delta <MAX_TOUCH_TIME_ERROR && -inode_change_ok (inode, iap) !=0 ) { -/* turn off ATTR_[AM]TIME_SET but leave ATTR_[AM]TIME -* this will cause notify_change to set these times to "now" +if ((iap->ia_valid &BOTH_TIME_SET ) ==BOTH_TIME_SET && + iap->ia_mtime.tv_sec == iap->ia_atime.tv_sec) { +/* +* Looks probable. +* +* Now just make sure time is in the right ballpark. +* Solaris, at least, doesn't seem to care what the time +* request is. We require it be within 30 minutes of now. */ - iap->ia_valid &= ~BOTH_TIME_SET ; - } +time_t delta = iap->ia_atime.tv_sec -get_seconds (); +if (delta <0 ) + delta = -delta; +if (delta <MAX_TOUCH_TIME_ERROR && +inode_change_ok (inode, iap) !=0 ) { +/* +* Turn off ATTR_[AM]TIME_SET but leave ATTR_[AM]TIME. +* This will cause notify_change to set these times +* to "now" +*/ + iap->ia_valid &= ~BOTH_TIME_SET ; + } } -/* The size case is special. It changes the file as well as the attributes. */ +/* +* The size case is special. +* It changes the file as well as the attributes. +*/ if (iap->ia_valid &ATTR_SIZE ) {if (iap->ia_size < inode->i_size) { err =nfsd_permission (fhp->fh_export, dentry,MAY_TRUNC |MAY_OWNER_OVERRIDE ); -------------------------------------------------------------------------
Quoted 7 lines
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
---end quoted text---
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 6 lines · On Sunday May 13, [email protected] wrote:
Quoted 2 lines · Christoph Hellwig
Signed-off-by Christoph Hellwig <[email protected]>ping?
I don't remember seeing this, and I don't see to still have it sitting unread in my INBOX...
Except for spending a whole line on "/*" which I would rather avoid (inside functions) it's all very sensible. I will apply it.
Thanks,
NeilBrown
Quoted 9 lines
Quoted 9 lines
Index:
linux-2.6/fs/nfsd/vfs.c
===================================================================fs/nfsd/vfs.c +0
-0@@ -277,7 +277,8 @@if (!iap->ia_valid) goto out;
Quoted 6 lines
fs/nfsd/vfs.c line 284
Quoted 6 lines
fs/nfsd/vfs.c +2
-1-/* NFSv2 does not differentiate between "set-[ac]time-to-now" +/* +* NFSv2 does not differentiate between "set-[ac]time-to-now" * which only requires access, and "set-[ac]time-to-X" which * requires ownership. * So if it looks like it might be "set both to the same time which
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines · Christoph Hellwig
Signed-off-by Christoph Hellwig <[email protected]>ping?
ping^2
Quoted 66 lines
Quoted 66 lines
Index:
linux-2.6/fs/nfsd/vfs.c
===================================================================fs/nfsd/vfs.c +26
-17@@ -277,7 +277,8 @@if (!iap->ia_valid) goto out; -/* NFSv2 does not differentiate between "set-[ac]time-to-now" +/* +* NFSv2 does not differentiate between "set-[ac]time-to-now" * which only requires access, and "set-[ac]time-to-X" which * requires ownership. * So if it looks like it might be "set both to the same time which @@ -290,25 +291,33 @@*/ #define BOTH_TIME_SET (ATTR_ATIME_SET | ATTR_MTIME_SET)#define MAX_TOUCH_TIME_ERROR (30*60) -if ((iap->ia_valid &BOTH_TIME_SET ) ==BOTH_TIME_SET - && iap->ia_mtime.tv_sec == iap->ia_atime.tv_sec - ) { -/* Looks probable. Now just make sure time is in the right ballpark. -* Solaris, at least, doesn't seem to care what the time request is. -* We require it be within 30 minutes of now. -*/ -time_t delta = iap->ia_atime.tv_sec -get_seconds (); -if (delta<0 ) delta = -delta; -if (delta <MAX_TOUCH_TIME_ERROR && -inode_change_ok (inode, iap) !=0 ) { -/* turn off ATTR_[AM]TIME_SET but leave ATTR_[AM]TIME -* this will cause notify_change to set these times to "now" +if ((iap->ia_valid &BOTH_TIME_SET ) ==BOTH_TIME_SET && + iap->ia_mtime.tv_sec == iap->ia_atime.tv_sec) { +/* +* Looks probable. +* +* Now just make sure time is in the right ballpark. +* Solaris, at least, doesn't seem to care what the time +* request is. We require it be within 30 minutes of now. */ - iap->ia_valid &= ~BOTH_TIME_SET ; - } +time_t delta = iap->ia_atime.tv_sec -get_seconds (); +if (delta <0 ) + delta = -delta; +if (delta <MAX_TOUCH_TIME_ERROR && +inode_change_ok (inode, iap) !=0 ) { +/* +* Turn off ATTR_[AM]TIME_SET but leave ATTR_[AM]TIME. +* This will cause notify_change to set these times +* to "now" +*/ + iap->ia_valid &= ~BOTH_TIME_SET ; + } } -/* The size case is special. It changes the file as well as the attributes. */ +/* +* The size case is special. +* It changes the file as well as the attributes. +*/ if (iap->ia_valid &ATTR_SIZE ) {if (iap->ia_size < inode->i_size) { err =nfsd_permission (fhp->fh_export, dentry,MAY_TRUNC |MAY_OWNER_OVERRIDE );
Quoted 9 lines
Quoted 8 lines
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs---end quoted text---
---end quoted text---
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 8 lines · Christoph Hellwig
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines · Christoph Hellwig
Signed-off-by Christoph Hellwig <[email protected]>ping?
ping^2
Git is whining because the indention for the first line of multi-line comments has spaces in between two tabs.
Other than that seems fine, thanks. I've added it to my tree and will submit it eventually if nobody else picks it up....
--b.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs